nginx安装

2023-01-22  本文已影响0人  jimy123

yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
mkdir -p /var/temp/nginx
mkdir -p /www/xiaozhushe/nginx
cd /www/xiaozhushe/nginx
wget http://nginx.org/download/nginx-1.22.1.tar.gz
tar -zxvf nginx-1.22.1.tar.gz
cd nginx-1.22.1
./configure \
--prefix=/usr/local/nginx \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/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/fastgi \
--http-uwsgi-temp-path=/var/temp/nginx/uwsgi \
--http-scgi-temp-path=/var/temp/nginx/scgi \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_stub_status_module
make
make install
cd /usr/local/nginx/sbin

启动:
./nginx
停止:
./nginx -s stop
重新加载:
./nginx -s reload
vim /etc/profile
在文件的尾部追加:
export NGINX_HOME=/usr/local/nginx
export PATH=$NGINX_HOME/sbin:$PATH
重启配置文件:
source /etc/profile

查看版本:
nginx -v
查看配置:
nginx -V


nginx配置.png
上一篇 下一篇

猜你喜欢

热点阅读