Nginx installation and use

1. Installation

<!--[if !supportLists]-->1, <!--[endif]-->System Environment

It is recommended to use centos6.5 in the system environment, and close the system firewall after installing the mirror successfully

2. Installation steps

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

cd /usr/local

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

Unzip tar -zxvf nginx-1.5.9.tar.gz

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

Install prce (redirect support) and openssl (https support, if you don't need https, you can not install it.)

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]-->Create logs file

mkdir /usr/local/nginx/logs

<!--[if !supportLists]-->⑤ <!--[endif]-->Start, restart, shutdown commands

/usr/local/nginx/sbin/nginx

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

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

<!--[if !supportLists]-->⑥ <!--[endif]-->Check whether the configuration file is normal

sudo ./sbin/nginx -t

 

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

Enter the virtual machine IP in the browser

2. Deployment and use

Reference URL: http://my.oschina.net/liting/blog/417188?fromerr=IqxKVlSy

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326990490&siteId=291194637