Sekedar Info

Information about the operating system, application, Server configuration, Web Service and Supporting Software Tools for Computer networks and Ubuntu, Windows, Virtual-Box, Nginx, Apache, PHP, Mysql, MariaDB. Tip and trick in overcoming and solution of the problem on your computer.

Saturday, January 27, 2018

How To Setup (Virtual Hosts) NGINX Server Block on Ubuntu

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.

     Either directly to the first stage in doing server configuration block nginx.

  1. Create a directory for the web root document placement
    gambar 1. Create directory

  2. Set Permissions For Directories

    gambar 2. set permission


  3. Create A Simple Web Page
    gambar 3. simple 

  4. Creating A Server Configuration File Blocks

         Next 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.local
    gambar 4. copy the file to the default file test

    If it then edit the file as shown below.

    gambar 5. the configuration file

  5. The Activation Server Block

    gambar 6. server activation block
    If it then delete the configuration defaults.

    gambar 7. delete the default configuration

  6. Register your Domain on the Host Local NGINX

    gambar 8. local domain list

  7. Restart Service NGINX dan PHP

    gambar 9. restart service nginx
    gambar 10. restart service php

  8. 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.

8 comments:

  1. Replies
    1. in terminal ubuntu, first you must login as a super user. and then you write this syntax # tail -f /var/log/nginx/error.log

      Delete
  2. Its 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

    ReplyDelete
  3. This 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. שרת וירטואלי

    ReplyDelete
  4. I’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