lnmp环境之Nginx安装

一. nginx是什么?
1)Nginx是千篇一律慢慢悠悠轻量级的Web
服务器/反为代理服务器及电子邮件代理服务器,并当一个BSD-like
协议下发行。
2)特点: 占有内存少, 并发能力强 ,
事实上nginx的产出能力确实当与种的网页服务器受到显现于好。

1.设置前准备:

#率先肯定是免是起安编译包和局部仗包
# yum install gcc gcc-c++ openssl openssl-devel zib-devel zib

2.安装pcre
# wget
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.39.tar.gz
#tar zxvf pcre-8.39.tar.gz
编译安装
# cd pcre-8.39
# ./configure –prefix=/usr/local/pcre
# make && make install

3.安装nginx
# wget http://nginx.org/download/nginx-1.6.2.tar.gz
# tar -zxvf nginx-1.6.2.tar.gz
# cd nginx-1.6.2
# ./configure –prefix=/usr/local/nginx –with-pcre=usr/local/pcre
–with-http_stub_status_module
# make && make install

5.启动nginx
检查nginx配置文件语法有没有问题
#/usr/local/nginx/sbin/nginx -t
假如无见面面世,下面提示
nginx: the configuration file /usr/local/nginx-1.4.6/conf/nginx.conf
syntax is ok
nginx: configuration file /usr/local/nginx-1.4.6/conf/nginx.conf test is
successful

启动nginx
#/usr/local/nginx/sbin/nginx
重加载nginx
#/usr/local/nginx/sbin/nginx –s reload

暨立刻无异步没有啊错误,就足以ip访问了.

 

二.设置着报错解决:

1.解决nginx: [error] open() "/usr/local/nginx/logs/nginx.pid"
failed错误 

化解措施:电子科技
[root@localhost nginx]# /usr/local/nginx/sbin/nginx -c
/usr/local/nginx/conf/nginx.conf

2.解决 ./configure: error: the HTTP rewrite module requires the PCRE
library.

#yum -y install pcre-devel

如上才为私家安装,仅供参考!

 

相关文章