centos8安装nginx1.9.1的详细过程
1.17.9 更香,真的
nginx下载地址:https://nginx.org/download/
1.下载nginx
2.解压nginx
tar -zxvf nginx-1.9.9.tar.gz
3.安装依赖包
yum -y install gcc gcc-c++ pcre pcre-devel zlib zlib-devel openssl openssl-devel
4.配置nginx
cd nginx-1.9.9/ ./configure \--prefix=/usr/local/nginx \--with-http_ssl_module \--conf-path=/usr/local/nginx/conf/nginx.conf \--pid-path=/usr/local/nginx/conf/nginx.pid \--lock-path=/var/lock/nginx.lock \--error-log-path=/var/logs/nginx/error.log \--http-log-path=/var/logs/nginx/access.log \--with-http_gzip_static_module \--http-client-body-temp-path=/var/temp/nginx/client \--http-proxy-temp-path=/var/temp/nginx/proxy \--http-fastcgi-temp-path=/var/temp/nginx/fastcgi \--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \--http-scgi-temp-path=/var/temp/nginx/scgi
5.编辑部分配置,为下面执行make命令做准备
编辑文件 nginx 根目录:objs/Makefile
编辑文件:src/os/unix/ngx_user.c
6.编译
make
7.安装
make install
8.开放80端口
检查80端口是否开放:
firewall-cmd --zone=public --list-ports
如果没有 80/tcp 执行以下命令,开放端口
#永久开放80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent #更新防火墙规则 firewall-cmd --reload
9.启动nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
10.web访问
到此这篇关于centos8安装nginx1.9.1的详细过程的文章就介绍到这了,更多相关centos8安装nginx1.9.1内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!
相关文章
nginx运行报错:unknown directive “stream“的解决方案
这篇文章主要给大家介绍了nginx 运行报错:unknown directive "stream"的原因,主要是因为没有安装stream模块导致的,我们只需要编译安装一下stream模块即可解决这个问题,文中有详细的解决方案,需要的朋友可以参考下2023-09-09
最新评论