Download it at nginx.org/download/
1. Enter the folder
cd /usr/local/src
Copy the code
Second, the download
Wget HTTP: / / http://nginx.org/download/nginx-1.6.2.tar.gzCopy the code
3. Install dependencies
If you did not install it in the “Need to Install” tutorial, follow this sentence
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
Copy the code
Four, decompression
The tar - ZXVF nginx - 1.6.2. Tar. GzCopy the code
5. Go to the decompressed folder
CD nginx 1.6.2 /Copy the code
6. Execute the configuration file
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module
Copy the code
/usr/local/nginx
If prompted by the following sentence. Whether the dependencies in the “need to install” article have been installed. Then run./configure
// make: *** no target specified and no makefile found. Stop.
Copy the code
Now make also executes the install command
make && make install
Copy the code
Eight, the command
The installation location is in the /usr/local/nginx directory, which means the configuration file is also there
Start the server
/usr/local/nginx/sbin/nginx
Copy the code
Reload the configuration file
/usr/local/nginx/sbin/nginx -s reload
Copy the code
Restart the Nginx
/usr/local/nginx/sbin/nginx -s reopen
Copy the code
Stop Nginx
/usr/local/nginx/sbin/nginx -s stop
Copy the code
【 the original address: https://lolku.cn/web/details/posts/37