您的位置:首页 > 运维架构 > Nginx

Nginx的安装

2015-09-17 21:00 597 查看
本文主要介绍Nginx的安装流程,不包含配置。

1.配置安装环境
yum groupinstall "Development Tools""Server Platform "
yum install pcre-devel openssl -devel

2.新建运行账号:

groupadd -r nginx
useradd -r -g nginx nginx
3.查看帮助文件:
./configure --help | less
4.编译安装:
#./configure --prefix=/usr/local/nginx --conf-path=/etc/nginx/nginx.conf --user=nginx --group=nginx --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi
# make && make install
5.查看安装状态:
/usr/local/nginx/sbin/nginx -t
6. 启动nginx(未配置服务脚本之前):

/usr/local/nginx/sbin/nginx
7.关闭nginx:
killall nginx
8.服务脚本设置:

Vim /etc/rc.d/init.d/nginx 服务脚本,可根据提供文档设置
chmod +x /etc/rc.d/init.d/nginx
chkconfig --add nginx
chkconfig --list nginx
service nginx start
9.启动服务,运行正常页面显示如下:



本文出自 “学无止境” 博客,请务必保留此出处http://chickengg.blog.51cto.com/10402610/1695828
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: