1. Run command at Terminal:$sudo apt-get Install Nginx
Ubuntu after installing Nginx file structure is roughly:
All configuration files are under/etc/nginx, and each virtual host is already under/etc/nginx/sites-available
Startup program Files in/usr/sbin/nginx
The logs were placed in the/var/log/nginx, Access.log and Error.log, respectively.
and has created a startup script Nginx under/etc/init.d/
The default virtual host directory is set to/usr/share/nginx/html
After installation, enter http://localhost/in the browser and a welcome word will appear. This page is/usr/share/nginx/html under the index.html.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/58/9A/wKiom1S05xqz2ie6AAFBG5dM5w0827.jpg "title=" 1.png " alt= "Wkiom1s05xqz2ie6aafbg5dm5w0827.jpg"/>,
Run command nginx-v to know the current version
2. Create your own virtual directories and virtual host names
Creating Catalogs/var/www/ecc and/var/www/vhosts
Create the file/var/www/ecc/index.html, and write the word "a" in index.html on the "a" test page.
Create File/VAR/WWW/VHOSTS/ECC (this is a configure file)
server{Listen 80; server_name ecc.com location/{index.index.html; ROOT/VAR/WWW/ECC; }}
Edit the file/etc/nginx/nginx.conf, near the end line, row include/etc/nginx/sites-enabled/*, followed by a row
include/var/www/vhosts/*;
3. Run the command sudo nginx-t to test the syntax and configuration of the Configure file correctly.
If correct, there will be results:
Nginx:the configuration file/etc/nginx/nginx.conf syntax is oknginx:configuration file/etc/nginx/nginx.conf test is su Ccessful
4. Add the newly created domain name in the/etc/hosts file (if it is running natively)
Ecc.com
5. Restart the nginx.
Run command: Sudo/etc/init.d/nginx restart
6. Enter ecc.com in the browser to browse your test page index.html
This article is from the "Epicor, Magento" blog, so be sure to keep this source http://3154408.blog.51cto.com/3144408/1603643
Installation and configuration process of nginx in Ubuntu