Linux installation Nginx

Source: Internet
Author: User
Tags install openssl openssl iptables

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.