Ai
1 Star 0 Fork 3

paul008/nginx-api-gateway

forked from Evan Wu/nginx-api-gateway 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nginx.sh 773 Bytes
一键复制 编辑 原始数据 按行查看 历史
吴强强 提交于 2019-05-12 06:07 +08:00 . Nginx 配置错误修复
rm -rf /etc/yum.repos.d/nginx.repo
touch /etc/yum.repos.d/nginx.repo
cat >> /etc/yum.repos.d/nginx.repo << EOF
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/\$releasever/\$basearch/
gpgcheck=0
enabled=1
EOF
yum clean all
#安装NGINX
yum install nginx -y
#创建Nginx日志目录
mkdir -p /data/logs/nginx
mkdir -p /data/backup/nginx-modules
chmod -R 755 /data/logs/nginx
chown -R nginx:nginx /data/logs/nginx
#备份,编辑Nginx配置文件
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
sed -i 's#/var/log/nginx/error.log#/data/logs/nginx/error.log#' /etc/nginx/nginx.conf
sed -i 's#/var/log/nginx/access.log#/data/logs/nginx/access.log#' /etc/nginx/nginx.conf
#设置nginx开机启动
systemctl start nginx
systemctl enable nginx
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Shell
1
https://gitee.com/paul008/nginx-api-gateway.git
git@gitee.com:paul008/nginx-api-gateway.git
paul008
nginx-api-gateway
nginx-api-gateway
master

搜索帮助