標籤:centos 7 nginx
環境:CentOS7+Nginx1.9.3
1安裝依賴的類庫
[[email protected] ~]# yum install zlib zlib-devel openssl openssl-devel pcre pcre-devel
2 下載nginx
[[email protected] ~]# wget http://nginx.org/download/nginx-1.9.4.tar.gz
3 安裝nginx
[[email protected] src]# tar -zxvf nginx-1.9.4.tar.gz -C /src[[email protected] src]# cd nginx-1.9.4/[[email protected] nginx-1.9.4]# ./configure --prefix=/usr/local/nginx --with-http_stub_status_module[[email protected] nginx-1.9.4]# make && make install
4 nginx 啟動
[[email protected] nginx-1.9.4]# /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
5 開始firewall連接埠服務
firewall-cmd --permanent --zone=public --add-service=http
6 nginx 常用命令
/usr/local/nginx/sbin/nginx -s reload/usr/local/nginx/sbin/nginx -s stop /usr/local/nginx/sbin/nginx -t -c /usr/local/conf/nginx.cnf
本文出自 “站在巨人的肩膀上看世界” 部落格,請務必保留此出處http://lixiaotao.blog.51cto.com/985722/1690243
CentOS 7 + Nginx 1.9.4