linux安装nginx服务
一、安装依赖
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
二、上传或下载nginx的tar.gz包
wget下载:wget http://nginx.org/download/nginx-1.24.0.tar.gz
三、解压nginx
tar -zxvf nginx-1.24.0.tar.gz -C path(解压目录)
四、编译安装
./configure --with-http_stub_status_module --with-http_ssl_module --perfix=path(安装路径)
make && make install
五、启动、重启和关闭
进入安装(非解压)路径下的sbin目录,默认安装路径是/usr/local/nginx
启动:./nginx
重启:./nginx -s reload
关闭:./nginx -s stop