Ngnix installation, Semaphore, virtual host configuration

Source: Internet
Author: User

First, Ngnix installation

The installation of the Ngnix is simple

1, first download from Ngnix official website Ngnix compression Package

  wget http://nginx.org/download/nginx-1.6.2.tar.gz

2. Unzip and enter the directory

  TAR-ZXF nginx-1.6.2.tar.gz

  CD nginx-1.6.2

3. Compile and install

  ./configure--prefix=/usr/local/ngnix

#此处有可能报错, Ngnix relies on the Pcre library, so install the Pcre library first

    Yum Install pcre Pcre-deveyum install Pcre Pcre-deve

  Make && make install

Installation succeeded at this time

4. Start

Go to Cd/usr/local/ngnix and look at the 4 directories inside.

... conf configuration file

... HTML Web page file

... logs log files

... sbin main binary program

Start:./sbin/ngnix

This may cause an error.

(1)

  

Workaround:

  

(2)

  

Workaround: Turn off the software or service that occupies port 80.

  

  

Second, the signal volume

Nginx to use the signal to control the Nginx stop, smooth restart, nginx support the following several signals:1) term,int fast close SIGINT SIGTERM namely: Ngx_terminate_signal and SIGINT2) QUIT calmly closed (graceful closing process, i.e., after the request is over and then closed) sigquit that is ngx_shutdown_signal3) HUP Smooth Restart, reload configuration file SIGHUP i.e. ngx_reconfigure_signal4) USR1 re-open the log file, the use of large SIGUSR1 when cutting the log ngx_reopen_signal5) USR2 Smooth upgrade executable program SIGUSR2 i.e. ngx_changebin_signal6) WINCH calmly close the work process that is ngx_noaccept_signal      three, virtual host configurationFirst look at the configuration filevim/usr/local/ngnix/conf/ngnix.conf       Let's configure the virtual host.(1) domain-based virtual host  
(2) port-based virtual host configuration  (3) IP-based virtual host configuration (if a host has two network cards)  

Ngnix installation, Semaphore, virtual host configuration

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.