http://www.21ops.com/ops/8960.html
流程: 1.前序必须安装的 :gcc pcre zlib openssl 等库和工具
2.wget http://nginx.org/download/nginx-1.5.4.tar.gz 下载 解压 进入目录./config --prex=/usr/local/nginx-.. 自定义的安装目录
3.在目录下make编译
出现的问题:1. 提示./configure -....没有相应的option 原因:下载的包解压缩时出现了错误 解决办法:重写下载压缩包 解压
2. 执行 进入usr/local/nginx../sbin/ 执行./nginx ,也可将nginx命令移动到/usr/sbin目录下(/usr/sbin:主要放置网路管理的必备程序) http://www.jb51.net/LINUXjishu/86669.html
3. 80端口被appach或其他的程序占用,关闭80端口的进程:
1.使用kill - 9 命令,发现关闭了后又启动了
2.使用命令:fuser -k 80/tcp 可以关闭
结果:
执行nginx后 :
- [root@host nginx-1.5.4]#
- [root@host nginx-1.5.4]# nginx
- [root@host nginx-1.5.4]# netstat -antp | grep 80
- tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 5182/nginx
- [root@host nginx-1.5.4]#
从windows进入: http://192.168.137.128/ ,提示:
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
查看连接:
- [root@host nginx-1.5.4]#
- [root@host nginx-1.5.4]# netstat -antp | grep 80
- tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 5182/nginx
- tcp 0 0 192.168.137.128:80 192.168.137.1:4562 ESTABLISHED 5183/nginx
- tcp 0 0 192.168.137.128:80 192.168.137.1:4561 ESTABLISHED 5183/nginx
- tcp 0 0 192.168.137.128:80 192.168.137.1:4546 ESTABLISHED 5183/nginx
- tcp 0 0 192.168.137.128:80 192.168.137.1:4550 ESTABLISHED 5183/nginx
- [root@host nginx-1.5.4]#
今天 vmware出现的问题:异常关闭导致windows下的我的电脑-》管理--》服务--》vmware dhcp 和vmware nat 服务没有开启:
进入设置开启,并调整属性->自动开启