nginx
1、安装依赖
yum -y install gcc gcc-c++ make libtool zlib zlib-devel openssl openssl-devel pcre pcre-devel
2、下载Nginx版本
wget -c https://nginx.org/download/nginx-1.18.0.tar.gz
3、解压
tar -zxvf nginx-1.18.0.tar.gz
cd nginx-1.18.0
4、配置
1.不需要SSL
./configure --prefix=/usr/local/nginx
2.需要SSL
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
5、编译安装
make
make install
6、启动Nginx
# 启动
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
# 重启
/usr/local/nginx/sbin/nginx -s reload
7、设置开机启动
1、即在rc.local增加启动代码就可以了。
vim /etc/rc.local
最后增加一行
/usr/local/nginx/sbin/nginx
2、设置执行权限
chmod 755 /etc/rc.local
8、卸载Nginx
1.卸载Nginx
yum remove nginx
2.查看Nginx是否还存在
which nginx