Installation dependencies
Yum install Gccyum install pcre-develyum install zlib zlib-develyum install OpenSSL OpenSSL-< C4>devel// one button installation above four dependent yum-y install gcc zlib zlib-devel pcre-devel OpenSSL openssl-devel
Download the Nginx tar package
// Create a folder cd/usr/localmkdir nginxcd nginx// Download tar package wget http: // nginx.org/download/nginx-1.13.7.tar.gzTAR-XVF nginx-1.13.7.tar.g
Installing Nginx
// Enter Nginx directory cd/usr/local/nginx// Execute command ./Configure// Execute make command make// execute make install command make install
Nginx Common Commands
// Test The/nginx/sbin/nginx-t under the profile installation path
// Start Command installation path under the/nginx/sbin/nginx// Stop command under installation path/nginx/sbin/nginx-: Nginx- S quit // Restart the command installation path under/nginx/sbin/nginx-s reload
// View process command Ps-ef | grep nginx // Smooth restart kill-hup nginx main process number
Configuring firewalls
// Open firewall file sudo vim/etc/sysconfig/iptables// New line Open 80 port new -M TCP-- Dport-J ACCEPT// save back/restart firewall sudo service iptables restart
Nginx virtual domain name configuration and test verification
// edit nginx.confsudo vim/usr/local/nginx/conf/nginx. conf // include vhost/*conf//Save exit//New Vhost folder in/usr/local/nginx/conf directory mkdir vhost// Create a configuration for each domain name sudo vim jimisun.com.conf//node in the configuration port forwarding or accessing the file system to add in the response
Nginx Boot
// Enter the Nginx installation directory ./nginx
Test access
http://IP address
Linux installation Nginx