Nginx安装手册
安装环境:
CentOS6.5 Nginx1.7.0
一、创建用户组及用户(nginx /nginx)
#su -
#groupadd nginx
#useradd -g nginx -d /home/nginx -p nginx nginx
二、创建安装及WWW目录
#su -
1、安装目录:/app/nginx
#cd / app
#mkdir nginx
#chown -Rf nginx:nginx ./nginx
2、WWW目录:/data/wwwroot
#cd data
#mkdir wwwroot
#chown -Rf nginx:nginx ./wwwroot
三、下载安装介质:
浏览并选择相关版本
http://nginx.org/download/
#tar -zxvf nginx-1.7.0.tar.gz
四、检查安装前置条件
su -
是否安装 openssl 、pcre、zlib
#rpm -qa|grep openssl-devel
#rpm -qa|grep pcre-devel
#rpm -qa|grep zlib
在连网的情况可以执行下面命令安装
#yum -y install pcre-devel
#yum -y install openssl-devel
服务器未连接网情况下可参考
http://inotgaoshou.iteye.com/blog/962946
五、编译并安装
su - nginx
1、编译相关参数
#./configure
http://inotgaoshou.iteye.com/blog/962946
五、编译并安装
su - nginx
1、编译相关参数
#./configure
--prefix=/app/nginx --
user=nginx
--group=nginx
--with-http_stub_status_module
--with-http_ssl_module
--without-http_fastcgi_module
#make
#make install
六、配置启动(非root用户启动80端口)
#su -
#chmod 777 /etc/sudoers
#vi /etc/sudoers
nginx ALL=NOPASSWD: /app/nginx/sbin/nginx
#chmod 640 /etc/sudoers
七、启动和重新启动
#sudo /app/nginx/sbin/nginx
#sudo /app/nginx/sbin/nginx -s reload
八、查看进程
ps -ef|grep nginx
九、修改root目录
root /data/wwwroot;
十、开启支持shtml
ssi on;
ssi_silent_errors on;
ssi_types text/shtml;
ssi_silent_errors on;
ssi_types text/shtml;
相关资料参考网址
http://www.sunbloger.com/article/228.html
99、相关错误
./configure: error: SSL modules require the OpenSSL library.
You can either do not enable the modules, or install the OpenSSL library
into the system, or build the OpenSSL library statically from the source
with nginx by using --with-openssl=<path> option.
说明未安装openssl 模块,请先安装openssl
#yum -y install openssl-devel