9,LNMP 中nginx 的安装

php FCGI 服务端口9000
nginx        端口 80
正向代理: 内网机器,通过路由器的带宽,访问baidu.com
反向代理:外网机器,通过一台代理机器,访问内网的其他机器。

 

安装nginx:
[root@moban tools]# yum install -y pcre pcre-devel openssl openssl-devel
[root@moban tools]# tar xf nginx-1.6.2.tar.gz
[root@moban tools]# cd nginx-1.6.2
[root@moban nginx-1.6.2]#useradd -s /sbin/nologin -M nginx
[root@moban nginx-1.6.2]# ./configure  --user=nginx  --group=nginx  --prefix=/application/nginx1.6.2 --with-http_stub_status_module --with-http_ssl_module
[root@moban nginx-1.6.2]#make && make install
[root@moban nginx-1.6.2]#

 

注意这个是没有创建nginx用户引起的错误:
[root@moban nginx-1.6.2]# /application/nginx1.6.2/sbin/nginx -t
nginx: the configuration file /application/nginx1.6.2/conf/nginx.conf syntax is ok
nginx: [emerg] getpwnam("nginx") failed
nginx: configuration file /application/nginx1.6.2/conf/nginx.conf test failed
[root@moban nginx-1.6.2]# /application/nginx1.6.2/sbin/nginx

 

Nginx 排错三步曲:(前面2步骤在windows系统操作,第3步骤在Linux本机操作)
1.    在windows ping 安装nginx机器的IP,看看物理通不通
2.    Cmd---  telenet 安装nginx机器的IP 和端口,看看浏览器到web服务通不通
3.    在安装的这个nginx 的Linux本机curl 本机IP ,如果能出现nginx默认页面。就说明web服务没问题。

 

 

posted @ 2020-10-28 22:53  pwcc  阅读(125)  评论(0)    收藏  举报