Nginx

安装和配置Nginx容器 文件目录 /home/nginx/conf.d 用于存放配置文件 /home/nginx/cert 用于存放https证书 /home/nginx/html 用于存放网页文件 /home/nginx/logs 用于存放日志 运行nginx容器 docker run -d \ --name nginx --restart always \ -p 80:80 -p 443:443 \ -e "TZ=Asia/Shanghai" \ -v /home/nginx/nginx.conf:/etc/nginx/nginx.conf \ -v /home/nginx/conf.d:/etc/nginx/conf.d \ -v /home/nginx/logs:/var/log/nginx \ -v /home/nginx/cert:/etc/nginx/cert \ -v /home/nginx/html:/usr/share/nginx/html \ nginx:alpine 配置nginx 这里使用Nginx反向代理访问后端服务,由于容器内部通信,因此需要使用容器的IP,也就是172.17.0.1。 在/home/nginx/conf.d创建一个{name}.conf的配置文件,文件内容如下 server { listen 80; server_name 域名/外网IP; index index.html; root /usr/share/nginx/html/{name}/dist; #dist上传的路径 # 避免访问出现 404 错误 location / { try_files $uri $uri/ @router; index index....

March 30, 2021 · 1 min · Steven Jiang

Install PostgreSQL in CentOS 7.4

进入PostgreSQL官网:https://www.postgresql.org/download/linux/redhat/ 选择软件版本和系统版本 在服务器上执行脚本,以CentOS7.4和PostgreSQL13为例 # Install the repository RPM: sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm # Install PostgreSQL: sudo yum install -y postgresql13-server # Optionally initialize the database and enable automatic start: sudo /usr/pgsql-13/bin/postgresql-13-setup initdb sudo systemctl enable postgresql-13 sudo systemctl start postgresql-13 远程连接,密码配置 配置文件路径/var/lib/pgsql/13/data/pg_hba.conf。修改127.0.0.1/32为0.0.0.0/0 配置文件路径/var/lib/pgsql/13/data/postgresql.conf。修改listen_address="*",取消port=5432的注释 重启postgresql 配置防火墙,放行5432端口 sudo firewall-cmd --permanent --add-port=5432/tcp sudo firewall-cmd –reload 修改密码 su – postgres psql ALTER USER postgres WITH PASSWORD '这里输入你的密码'; \q exit

March 30, 2021 · 1 min · Steven Jiang

Install Gitlab CE in CentOS 7.4

Introduce Tell you how to install Gitlab CE(Community Edition) in CentOS 7.4 step by step. Doc https://about.gitlab.com/install/?version=ce#centos-7 Install # Prerequisite sudo yum install -y curl policycoreutils-python openssh-server openssh-clients perl sudo systemctl enable sshd sudo systemctl start sshd # Firewall setting sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https sudo systemctl reload firewalld # Install Gitlab ce repo curl -sS https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash # Install Gitlab CE and set EXTERNAL_URL(your ip or host,http or https) sudo EXTERNAL_URL="http://192....

March 17, 2021 · 1 min · Steven Jiang