red hat 5.4 安装 nginx
red hat 5.4 安装 nginx1,yum 安装
修改 yum 源 /etc/yum.repos.d/nginx.repo 添加
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
#yum install nginx
#service nginx start
2,源码安装
#wget http://nginx.org/download/nginx-1.0.14.tar.gz
#tar xzvf nginx-1.0.14.tar.gz
#cd nginx-1.0.14
#./configure --prefix=/usr/local/nginx
出现错误
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
需要安装库
yum install pcre-devel
#./configure --prefix=/usr/local/nginx
#make && make install
安装成功
#ln -s /usr/local/nginx/sbin/nginx /etc/init.d/nginx
#pkill -9 nginx 强制停止
#service nginx 开始
#nginx -s reload 重启
#echo “/usr/local/nginx/sbin/nginx” >>/etc/rc.local 自动启动
支持 PHP
#wget http://cn2.php.net/get/php-5.3.10.tar.bz2/from/cn.php.net/mirror
#tar xvf php-5.3.10.tar.bz2
#cd php-5.3.10