centos 6下面安装nginx

上一篇 / 下一篇  2012-02-16 19:37:19 / 个人分类:others

   这个过程花费了我一天,faint,效率低啊,总结下遇见的问题和解决的方法,以及存在的疑问

1、首先获取centos的安装文件,我使用的是centos6.0版本的安装文件
2、在获取centos安装文件并安装完成之后,开始获取nginx安装文件、pcre安装文件
3、安装顺序为(在centos安装完成的情况下),先安装完pcre,然后安装nginx,如果能够上网的话,直接使用yum命令进行在线安装

这里有个疑问,在安装nginx的时候,tar解压完成,进入对应的目录,准备编译的时候,编译的命令我使用的是
./configure --user=zhangy --group=users --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-pcre=/usr/local/pcre

先说执行到这里出现的问题和解决办法:
a、gcc is not found
  直接用yum install gcc解决
b、./configure: error: the HTTP rewrite module requires the PCRE library.
   直接使用yum install pcre-devel解决
c、./configure: error: the HTTP SSL module requires OpenSSL library
   直接使用yum install openssl-devel解决
d、使用yum时Another app is currently holding the yum lock; waiting for it to exit…
   进入/var/run/,直接执行rm -rf yum.pid,再次执行yum恢复正常使用。
e、用命令行的方式更改用户所属组
  usermod -G group user

以上是遇见的问题并且解决了的,但是疑问还是一直存在,带有以上参数的nginx在编译后,就是make不了,火大了,直接不带参数./configure了,然后直接make...............它居然,,,,,,,,通过了,faint
继续尝试使用make install,然后也没看到报错,并且貌似看信息nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
nginx应该是成功安装了。
尝试来到cd /usr/local/nginx下面进入sbin,./nginx,静静的等待了下,,,,,,,,恩,发现也没错误提示,于是我忐忑的敲了下
ps -aux|grep nginx|grep -v grep

root     20489  0.0  0.0  21548   536 ?        Ss   03:33   0:00 nginx: master process ./nginx
nobody   20490  0.0  0.2  21936  1364 ?        S    03:33   0:00 nginx: worker process
..............显示启动正常,,,,,,,HJMMXD,,,,,,,,
输入http://localhost
看到nginx works的提示,验证确实成功啦........

网络摘抄几个好的nginx配置参数解释的网站地址
http://blog.csdn.net/bing19880122/article/details/6156678


TAG:

 

评分:0

我来说两句

Open Toolbar