linux centos-7.2-64bit 安装配置启动nginx

时间:2021-10-10 07:54:35

1.安装依赖包
yum -y install openssl openssl-devel
yum install pcre*
yum install openssl*
yum install zlib
yum install zlib-devel
yum install wget

2.下载,解压nginx包
cd /usr/local/software
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -zxvf nginx-1.8.0.tar.gz

3.配置,编译nginx 到 /usr/local/nginx
cd nginx-1.8.0
./configure --prefix=/usr/local/nginx \--with-http_ssl_module --with-http_spdy_module \--with-http_stub_status_module --with-pcre
make && make install

4.平滑启动nginx 及 重启命令
cd /usr/local/nginx
./sbin/nginx
ps -ef|grep "nginx"
./sbin/nginx -s reload #平滑重启nginx

5.阿里云开放80端口 后打开网址(服务器公网ip)X.X.X.X 出现

linux centos-7.2-64bit 安装配置启动nginx