2

I have a VPS running Ubuntu 13.10 and has an Apache2 website, and whenever I go to the VPS's IP http://5.231.37.8 ,I get the default/test page for Apache instead of my website located in /var/www.

It's an html + css website.

Edit: My solution below

1

Make sure the html home page file is in /var/www, and is called index.html - index.html is the first/default webpage you should get on typing the sites domain name/IP address. All other files can be linked to & from the index.html root/home file.

  • My website is in /var/www but it won't load if i directly go to my VPS's ip address. Only loads if i go to mywebsite.com – wolfy1339 Jan 31 '14 at 0:59
  • Even http://???.???.?.??/index.html? Could be the wrong IP address... – Wilf Jan 31 '14 at 10:21
  • no, it wasn't incorrect – wolfy1339 Feb 1 '14 at 1:21
1

My solution:

Add a new virtual host for the ip address in the file located at \etc\apache2\sites-available\000-default.conf as <VirtualHost *:80> and change ServerName to the IP.

In \etc\apache2\sites-available\default-ssl.conf (if you have ssl enabled) as

<VirtualHost *:443>

and change ServerName to the IP.

0

The default apache2 start page is found under /var/www and named index.html. It will run by default whenevr you try to access your webserver(apache2) either by calling http://localhost/ or http://your-ip

For your site to run smoothly just put your html and css files inside a directory in /var/www name it mysite for example. Then you can run your default(index.html) file of your site just by locating to /var/www/mysite

  • That's where my website is as stated in my question. – wolfy1339 Feb 1 '14 at 1:32

protected by Community Jan 5 '17 at 18:38

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.