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: