CentOS Install Apache command
Yum Install Httpd-y
Nginx installation Please see my blog post:
http://tianxingzhe.blog.51cto.com/3390077/1684642
First install Nginx and bind to 80 port, install Apache bound listening 8080 port. Then set the Nginx Server directory for the Www_nginx,apache server directory as Www_apache, respectively, in 2 directories to create a new index.html file, which is written in the Nginx,apache2 word is sufficient.
Then we configure the Nginx configuration file, generally nginx.conf this file, modify the configuration information inside.
Location/{
Proxy_pass http://127.0.0.1:8080;
}
At the same time to start Nginx and Apache, visit 127.0.0.1, you will find a magical thing, altogether output Apache, obviously nginx server directory there is no output, but Apache, that is because Nginx has a reverse proxy, Go to Apache to listen for the 8080 port to content, and then Apache returned to his processed results.
This is a simple example, in fact, we can let Nginx handle static pages, processing images, CSS, JS and other files, and let Apache handle dynamic files. For example, we can modify this:
Location ~ \.php$ {
Proxy_pass http://127.0.0.1:8080;
}
This is only PHP files to the Apache processing, the other is nginx to deal with.
Reference blog:
Http://www.cnblogs.com/Ihaveadream/p/4136377.html
This article is from the "Nothing-skywalker" blog, please be sure to keep this source http://tianxingzhe.blog.51cto.com/3390077/1684720
Nginx Reverse Proxy