首页
日常琐事
关于
友链
Search
1
nginx安装
177 阅读
2
kubectl资源类型与别名
167 阅读
3
欢迎使用 Typecho
143 阅读
4
pod配置文件
140 阅读
5
记录一次SecureCRT登录失败
101 阅读
linux
Python
django
nginx
K8S
资源调度
登录
Search
标签搜索
nginx
Typecho
累计撰写
6
篇文章
累计收到
30
条评论
首页
栏目
linux
Python
django
nginx
K8S
资源调度
页面
日常琐事
关于
友链
搜索到
1
篇与
的结果
2024-01-10
nginx安装
Nginx的安装版本区别常用版本分为四大阵营Nginx开源版http://nginx.org/Nginx plus 商业版https://www.nginx.comopenrestyhttp://openresty.org/cn/Tenginehttp://tengine.taobao.org/编译安装./configure --prefix=/usr/local/nginx make make install如果出现警告或报错提示checking for OS+ Linux 3.10.0-693.el7.x86_64 x86_64checking for C compiler ... not found./configure: error: C compiler cc is not found安装gccyum install -y gcc提示:./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcre=<path> option. 安装perl库 yum install -y pcre pcre-devel 提示: ./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlib=<path> option. 安装zlib库 yum install -y zlib zlib-devel 接下来执行 make make install启动Nginx进入安装好的目录 /usr/local/nginx/sbin./nginx 启动 ./nginx -s stop 快速停止 ./nginx -s quit 优雅关闭,在退出前完成已经接受的连接请求 ./nginx -s reload 重新加载配置关于防火墙关闭防火墙systemctl stop firewalld.service禁止防火墙开机启动systemctl disable firewalld.service放行端口 firewall-cmd --zone=public --add-port=80/tcp --permanent重启防火墙firewall-cmd --reload安装成系统服务创建服务脚本vi /usr/lib/systemd/system/nginx.service服务脚本内容[Unit] Description=nginx - web server After=network.target remote-fs.target nss-lookup.target [Service] Type=forking PIDFile=/usr/local/nginx/logs/nginx.pid ExecStartPre=/usr/local/nginx/sbin/nginx -t -c /usr/local/nginx/conf/nginx.conf ExecStart=/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ExecReload=/usr/local/nginx/sbin/nginx -s reload ExecStop=/usr/local/nginx/sbin/nginx -s stop ExecQuit=/usr/local/nginx/sbin/nginx -s quit PrivateTmp=true [Install] WantedBy=multi-user.target重新加载系统服务systemctl daemon-reload启动服务systemctl start nginx.service开机启动systemctl enable nginx.service
2024年01月10日
177 阅读
5 评论
0 点赞