首页 > 其他 > 详细

源码安装nginx

时间:2014-03-05 23:42:19      阅读:670      评论:0      收藏:0      [点我收藏+]

准备工作

1)确保以安装开发工具和开发库

2)卸载已安装的其他web服务软件

3)新建用户:nginx

4)安装依赖库

# yum -y install pcre-devel


1、解包

[root@web01 nginx-package]# tar -zxfnginx-0.8.55.tar.gz



2、配置

./configure常用选项

--prefix=PATH  //指定安装路径

--user=USER

--group=GROUP

//为进程设置非特权用户的组

--with-http_stub_status_module  //添加stub模块

--with-http_ssl_module//添加ssl模块


[root@web01 nginx-0.8.55]# ./configure--prefix=/usr/local/nginx --user=nginx  --group=nginx  --with-http_stub_status_module   --with-http_ssl_module



3、编译安装

[root@web01 nginx-0.8.55]# make &&make install




4、将nginx加入环境变量

[root@web01 ~]# vim .bash_profile
10 PATH=$PATH:$HOME/bin:/usr/local/nginx/sbin
[root@web01 ~]# source .bash_profile



5、启动nginx,并查看状态


[root@web01 ~]# nginx
[root@web01 ~]# netstat -anltp | grep nginx
tcp        0      0 0.0.0.0:80                  0.0.0.0:*                   LISTEN      8212/nginx        
[root@web01 ~]#

监听端口80

进程名:nginx

传输协议:tcp


6、访问测试


[root@web01 ~]# elinks --dump http://localhost
                               Welcome to nginx!
[root@web01 ~]#



本文出自 “小风” 博客,请务必保留此出处http://huanglianfeng.blog.51cto.com/4813074/1368832

源码安装nginx,布布扣,bubuko.com

源码安装nginx

原文:http://huanglianfeng.blog.51cto.com/4813074/1368832

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!