Ngnix installation, semaphore, and virtual host configuration

Source: Internet
Author: User

Ngnix installation, semaphore, and virtual host configuration

Ngnix installation is simple

1. Download The ngnix compressed package from the ngnix official website.

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

2. decompress the package and enter its directory.

Tar-zxf nginx-1.6.2.tar.gz

Cd nginx-1.6.2

3. Compile and install

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

# An error may be reported here. Ngnix depends on the pcre Library, so install the pcre Library first.

Yum install pcre-deveyum install pcre-deve

Make & make install

The installation is successful.

4. Start

Go to cd/usr/local/ngnix and check the four directories.

... Conf configuration file

... Html webpage File

... Logs Log File

... Sbin main binary Program

Start:./sbin/ngnix

An error may be reported.

(1)

Solution:

(2)

  

Solution: Close the software or service that uses port 80.

Ii. semaphores

Nginx uses signals to control Nginx stop and smooth restart. Nginx supports the following signals:

1) TERM, INT: Quickly close sigint sigterm: NGX_TERMINATE_SIGNAL and SIGINT

2) QUIT is easy to close (an elegant process is closed after the request ends) SIGQUIT is NGX_SHUTDOWN_SIGNAL

3) HUP restarts smoothly and reloads the configuration file SIGHUP, that is, NGX_RECONFIGURE_SIGNAL.

4) USR1 re-open the log file, which is used for log cutting. SIGUSR1 is NGX_REOPEN_SIGNAL.

5) the executable program SIGUSR2 of USR2 is NGX_CHANGEBIN_SIGNAL.

6) WINCH easily closes the working process, that is, NGX_NOACCEPT_SIGNAL.

Iii. VM Configuration

First look at the configuration file

Vim/usr/local/ngnix/conf/ngnix. conf

Next we will configure the virtual host

(1) domain name-based VM

(2) Port-based Virtual Host Configuration

(3) IP-based virtual host configuration (if a host has two NICS)

-------------------------------------- Split line --------------------------------------

Deployment of Nginx + MySQL + PHP in CentOS 6.2

Build a WEB server using Nginx

Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5

Performance Tuning for Nginx in CentOS 6.3

Configure Nginx to load the ngx_pagespeed module in CentOS 6.3

Install and configure Nginx + Pcre + php-fpm in CentOS 6.4

Nginx installation and configuration instructions

Nginx log filtering using ngx_log_if does not record specific logs

Nginx details: click here
Nginx: click here

This article permanently updates the link address:

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.