Linux - Install Nginx Steps
Install Nginx Related Dependencies
yum install gcc
yum install pcre-devel
yum install zlib zlib-devel
yum install openssl openssl-develOf course you can also install together
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-develDownload Nginx tar Archive
Go to webpage http://nginx.org/download/
Choose the version you need:
# Enter local folder
cd /usr/local
# I chose a relatively new version, download to current directory
wget http://nginx.org/download/nginx-1.13.9.tar.gz
# Extract
tar -xvf nginx-1.13.9.tar.gz
# Rename
mv nginx-1.13.9.tar.gz nginx
# Enter nginx directory
cd nginx
# Execute following commands
./configure
# Compile
makeAfter completing the above steps, your nginx is already installed
Nginx Common Commands
All following operations are performed in nginx directory
Start:
./sbin/nginxStop:
./sbin/nginx -s stop
#or
./sbin/nginx -s quitRestart:
./sbin/nginx -s reloadCheck Process Command
ps -ef | grep nginx