Report this

What is the reason for this report?

Error while creating Virtual Host on Nginx

Posted on January 18, 2016
Khay

By Khay

Hi,

I am currently creating new virtual host on my droplet which is already installed Ghost (blog) via DigitalOcean’s Ghost Application. I tried to set up virtual host using this guide, but it is not working correctly.

My root directory is under var/www . New config for sites-available is as below:

server {
        listen 80; ## listen for ipv4; this line is default and implied
        #listen [::]:80 default ipv6only=on; ## listen for ipv6

        root /var/www/test;
        index index.html index.htm;

        # Make site accessible from http://localhost/
        server_name arkaraung.me;
}

And also added new domain in /etc/hosts file. (let say my ip is 111.111.111.111)

111.111.111.1111 arkaraung.me

Please let me know if there is something wrong with my doing. And also please tell me what should I do. Thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

so you have to checck whether the apache service is running on your pc then sudo service apache2 stop sudo service nginx restart because in apache we have given the same http address 80 and also in nginx is given address 80 so that it telll like that

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.