[TOC]
Article Directory
A, Nginx Profile
A high-performance, lightweight Web services software, high stability, low system resources consumption, high processing power of concurrent HTTP connections
Two, Nginx configuration
2.1, the installation and decompression dependencies
2.2, compile and install configuration
2.3, Production Manager script
Modify 2.4, nginx.conf file
2.5, configure the DNS domain name resolution
Third, access control
3.1, based on the authorization of access control
3.2, a client-based access control
A, Nginx Profile
A high-performance, lightweight Web services software, high stability, low system resources consumption, high processing power of concurrent HTTP connections
Two, Nginx configuration
You need to prepare the installation package:
Can be remotely mounted by first compressed manner from a Windows system, mounted to linux system, then after the compression operation.
2.1, the installation and decompression dependencies
In an IP address is 192.168.111.141 in system centos7
1, the installation dependencies
2, create a user named nginx, and not allowed to log into the system
3, mount, and extract the installation package to the specified / opt / in
2.2, compile and install configuration
1, the compiler configuration
2, make the compiler
3, turn off the firewall, optimal path
4. Check for error
5, loading the installation package elinks, elinks test with
nginx -t // check
nginx // start
killall -1 nginx // reload
killall -3 nginx // stop
2.3, Production Manager script
1, Production Manager script to control the open and close of Nginx.
2, add execute permissions, add the script to the list of services
Modify 2.4, nginx.conf file
In the main configuration file /usr/local/nginx/conf/nginx.conf Nginx server, including global configuration, I / O event configuration, HTTP configuration three large content.
1, the global configuration
2, I / O Event Configuration
3, HTTP Configuration
Access to state statistics
nginx built HTTP_STUB_STATUS state statistics module, used to feed the current situation of Web access, you can add --with-http_stub_status_module compile time configuration parameters to enable this module supports.
Can use the command: / usr / local / nginx / sbin / nginx -V to view the installed Nginx contains HTTP_STUB_STATUS module.
To use Nginx state statistical functions, in addition to the built-enabled module, nginx.conf also you need to modify the configuration file, specify the location and add stub_status access configuration code.
Only modified region server {} nginx.conf profile:
After modifying the configuration files, you can restart the service.
2.5, configure the DNS domain name resolution
1, the installation
2, modify
3, start the service named
In a client system win10
Modify the DNS server address
Enter www.king.com/status in win10 browser.
Third, access control
3.1, based on the authorization of access control
Nginx and Apache, like, can be achieved based access control for authorization, when the client wants to access the site will be asked to enter a user name and password before you can access, and Apache configuration steps are basically the same.
Based authorization access control configuration roadmap:
Generate user-password authentication file
Modifying the master configuration file to the appropriate directory, add authentication configuration items
Restart the service, access the test
1, the main configuration file nginx.conf modify, add the appropriate authentication configuration items.
Installation tools package