1:查看nginx是否安裝
rpm -qa nginx
2:安裝Nnigx依賴包
1)pcre 安裝正則庫
yum -y install pcre pcre-devel
2)openssl安裝
yum -y install openssl openssl-devel
3:添加用戶和組
groupadd nginx
useradd -g nginx nginx -s /sbin/nologin -M
4:編譯安裝
./configure --prefix=/usr/local/nginx \
--user=nginx \
--group=nginx \
--with-http_ssl_module \
--with-http_sub_module
5:make && make install
6:啓動nginx安裝完畢nginx
7:檢查服務是否啓動(lsof命令和netstat)ssl
lsof -i:80
openssl
netstat -nltup |grep nginx
it