1、停止原有的web服务器
2、编译安装
安装依赖包
# yum install -y gcc pcre pcre-devel openssl openssl-devel gd gd-devel
添加用户
# useradd nginx
解压编译
# tar xvzf nginx-1.17.10.tar
# cd nginx-1.17.10
# ./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module
# make && make install
启动
# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
查看启动状态
# ps aux | grep nginx
# netstat -lntp | grep 80
3、浏览主页是否可以访问
links 127.0.0.1 //如果显示Welcome to nginx!则说明服务正常