centos6.x Yum does not have an Nginx package by default
Installation method:
to nginx download page http://nginx.org/en/linux_packages.html#stable, copy the CentOS 6 nginx software Source installation package
Run command: wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
Install RPM package Yum install nginx-release-centos-6-0.el6.ngx.noarch.rpm-y, this step is actually added to the Nginx package source
Run the Yum install Nginx-y and the Nginx will be ready.
Nginx is installed as a Linux service by default
Use the service Nginx start, stop, restart, Try-restart, Reload, force-reload, status to operate Nginx
Nginx config file reads the/etc/nginx/nginx.conf file by default
Nginx configuration is composed of directives, directives consists of simple instructions or block instructions
Simple instruction: Listen 80;
Block directives are contained by {}, and block instructions can contain multiple simple and chunk instructions:
{ server { }}
HTTP can have more than one server, and multiple servers can listen to multiple ports on the same server to serve multiple applications.
But if you have multiple domain name www.you.com,news.you.com at the same time, mail.you.com service on the same server, then www.you.com,mail.you.com:8080, news.you.com : 81 Such access is obviously inappropriate, and fortunately, Nginx has already provided rules for filtering through domain names.
server{ 80; server_name www.you.com; location / { #.... proxy_pass http://localhost:8880; } ##### other directive}server{ 80; server_name news.you.com; location / { #.... proxy_pass http://localhost:8881; } ##### other directive}server{ 80; server_name mail.you.com; location / { #.... proxy_pass http://localhost:8882; } ##### other directive}
Finally, each application can be run to listen to the corresponding port.
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the installation and basic configuration of nginx, and a number of domain name services, including the content, I hope that the PHP tutorial interested in a friend helpful.