How To Setup (Virtual Hosts) NGINX Server Block on Ubuntu
The Virtual Host is a way to set multiple websites or URLS in one engine or one IP or run more than one domain on a webserver. The term virtual host in apache vhost or called by the virtual host, while on the NGINX server called blocks.
The Virtual Host is a way to set multiple websites or URLS in one engine or one IP or run more than one domain on a webserver. The term virtual host in apache vhost or called by the virtual host, while on the NGINX server called blocks.
Either directly to the first stage in doing server configuration block nginx.
- Create a directory for the web root document placement
gambar 1. Create directory - Set Permissions For Directories
gambar 2. set permission - Create A Simple Web Pagegambar 3. simple
- Creating A Server Configuration File BlocksNext IE configuration in nginx. In fact there is already a default instance for server blocks in /etc/nginx/sites-available/default.Server configuration of the new blocks will we put it in the directory /etc/nginx/sites-available/Please copy the file default to direktory /etc/nginx/sites-available/
# sudo cp/etc/nginx/sites-available/default/etc/nginx/sites-available/test.localgambar 4. copy the file to the default file test
If it then edit the file as shown below.
gambar 5. the configuration file
- Call The Domain On The Ubuntu Web Browser
gambar 10. display the server block succeeded
When it is finished then call his local domain in a web browser, if successful then a simple html page that we created will appear. If not repeat step carefully because of errors in typing the code will thwart restart service nginx. If there are any questions please comment to ask. Thank you see you on the next post.
how to cek error log in nginx ?
ReplyDeletein terminal ubuntu, first you must login as a super user. and then you write this syntax # tail -f /var/log/nginx/error.log
Deleteawesome posts
ReplyDeletethank's
DeleteIts a great pleasure reading your post.Its full of information I am looking for and I love to post a comment that "The content of your post is awesome" Great work. UK RDP
ReplyDeleteThis is my first visit to your web journal! We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work. שרת וירטואלי
ReplyDeleteI'm glad to see the great detail here!. whrmarketing
ReplyDeleteI’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... nemzetközi szállítmányozás és áruszállításEuropa-Road Kft
ReplyDelete