部署nginx

部署nginx

1.下载nginxhttp://nginx.org/en/download.html或者http://nginx.org/en/nginx-1.7.9.tar.gz

2.下载好的nginx文件放入到/usr/local/src

3.解压tar.gz文件tar –zxvfnginx-1.7.9.tar.gz –C /usr/local/bin

4.Cd /usr/local/bin进行查看ls含有nginx-1.7.9

5.安装gcc yum –y install gcc-c++

6.安装最基础的模块pcre-devel yum –y install pcre-devle

7.安装gazip yum –y install zlib-devel

8.编译nginx进入到nginx-1.7.9目录下 执行./configure –prefix=/usr/etc/ngin

9.Make

10.Make install

11.启动nginx cd /usr/etc/ngin/sbin./nginx

12.查看nginx是否启动ps –ef |grep nginx

配置nginx.conf文件

1.vi/usr/local/bin/nginx-1.7.9/conf/nginx.conf


部署nginx_第1张图片
部署nginx_第2张图片

2.验证conf文件配置成功

/usr/etc/ngin/sbin/nginx-t -c /usr/local/bin/nginx-1.7.9/conf/nginx.conf

Kill -9 nginx进程

/usr/etc/ngin/sbin/nginx -c /usr/local/bin/nginx-1.7.9/conf/nginx.conf重新启动

.

你可能感兴趣的:(部署nginx)