CentOS7,linux下nginx的安装过程——2.配置user,路径,openssl,make install,关闭防火墙,测试——源码
源碼中安裝顯示代碼過(guò)多所以顯示我操作的部分,IP用你們虛擬機(jī)的IP
1. [root@localhost nginx-1.6.3]# useradd www -s /sbin/nologin -M
[root@localhost nginx-1.6.3]# ./configure –user=www –group=www –with-http_ssl_module –with-http_stub_status_module –prefix=/application/nginx-1.6.3
[root@localhost nginx-1.6.3]# yum install openssl openssl-devel -y
[root@localhost nginx-1.6.3]# echo $?
0
出現(xiàn)0前面均正確
[root@localhost nginx-1.6.3]# make install
看到80口處于監(jiān)聽(listen )狀態(tài)
[root@localhost nginx-1.6.3]# netstat -lntup|grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 17331/nginx: master
[root@localhost nginx-1.6.3]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 17331 root 6u IPv4 40493 0t0 TCP *:http (LISTEN)
nginx 17332 www 6u IPv4 40493 0t0 TCP *:http (LISTEN)
[root@localhost nginx-1.6.3]# firewall-cmd –state
running
[root@localhost nginx-1.6.3]# systemctl stop firewalld.service
[root@localhost nginx-1.6.3]# firewall-cmd –state
not running
[root@localhost nginx-1.6.3]# curl 10.10.10.2
看結(jié)果中有welcome nginx
[root@localhost nginx-1.6.3]# wget http://10.10.10.2
–2018-08-01 01:15:36– http://10.10.10.2/
正在連接 192.168.9.128:80… 已連接。
已發(fā)出 HTTP 請(qǐng)求,正在等待回應(yīng)… 200 OK
長(zhǎng)度:612 [text/html]
正在保存至: “index.html.4”
結(jié)果中有200 OK
10. 打開瀏覽器輸入http://10.10.10.2/
看結(jié)果中有welcome nginx 安裝成功
總結(jié)
以上是生活随笔為你收集整理的CentOS7,linux下nginx的安装过程——2.配置user,路径,openssl,make install,关闭防火墙,测试——源码的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: CentOS7,linux下nginx的
- 下一篇: Linux CENTOS6.5 图形命令