Nginx 安装使用

一、安装

<!--[if !supportLists]-->1、<!--[endif]-->系统环境

建议系统环境使用centos6.5 ,安装镜像成功后关闭系统防火墙

2、安装步骤

<!--[if !supportLists]-->① <!--[endif]-->下载

cd /usr/local

wget http://nginx.org/download/nginx-1.5.9.tar.gz

解压  tar -zxvf nginx-1.5.9.tar.gz

<!--[if !supportLists]-->② <!--[endif]-->安装

安装prce(重定向支持)和openssl(https支持,如果不需要https可以不安装。)

yum -y install pcre*

yum -y install openssl*

yum -y install gcc*

<!--[if !supportLists]-->③ <!--[endif]-->编辑

cd /usr/local/nginx/

./configure --prefix=/usr/local/nginx/

make

make install

<!--[if !supportLists]-->④ <!--[endif]-->创建logs文件

mkdir /usr/local/nginx/logs

<!--[if !supportLists]-->⑤ <!--[endif]-->启动、重启、关闭命令

/usr/local/nginx/sbin/nginx

/usr/local/nginx/sbin/nginx -s reload

/usr/local/nginx/sbin/nginx -s stop

<!--[if !supportLists]-->⑥ <!--[endif]-->检查配置文件是否正常

sudo ./sbin/nginx -t

 

<!--[if !supportLists]-->3、<!--[endif]-->验证

在浏览器中输入虚拟机IP

二、部署与使用

参考网址:http://my.oschina.net/liting/blog/417188?fromerr=IqxKVlSy

猜你喜欢

转载自paynexss.iteye.com/blog/2330495