nginx installation

download link:

http://nginx.org/en/download.html

Install dependencies

yum install -y gcc gcc-c++ zlib zlib-devel pcre-devel openssl openssl-devel

Compile and install

./configure --prefix=/usr/local/nginx-1.12.2 --with-http_ssl_module --with-pcre

make

make instll

 

$ nginx -v

bash: nginx: command not found

add environment variable

$ vim /etc/profile

export PATH=$PATH:/usr/local/nginx-1.12.2/sbin

Configuration takes effect

$ source /etc/profile

 

start up

$ /usr/local/nginx-1.12.2/sbin/nginx

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326130003&siteId=291194637