1.17.9 更香,真的
nginx下載地址:https://nginx.org/download/
1.下載nginx
wget https://nginx.org/download/nginx-1.9.9.tar.gz
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.編輯部分配置,為下面執(zhí)行make命令做準(zhǔn)備
編輯文件 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 執(zhí)行以下命令,開放端口
#永久開放80端口
firewall-cmd --zone=public --add-port=80/tcp --permanent
#更新防火墻規(guī)則
firewall-cmd --reload
9.啟動nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
10.web訪問
到此這篇關(guān)于centos8安裝nginx1.9.1的詳細(xì)過程的文章就介紹到這了,更多相關(guān)centos8安裝nginx1.9.1內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!