Ubuntu 12.04 Apache2 - Index of page instead of Home page

I'm new to hosting. I walked thru the "Hosting a Website tutorial" and I have read thru much documentation.

I installed LAMP. I updated /etc/apache2/apache2.conf. I created /etc/apache2/sites-available/mydomain.com.conf. I created the /var/www/mydomain/publichtml,log,backups directories. I ran a2ensite. I put a index.html file in the publichosts directory and set the permissions.

When I enter the IP address for my site hosted on Linode, I get the following:

Index of /

Name Last modified Size Description



Apache/2.2.22(Ubuntu) Server at my IP Port 80

Sorry for what I am sure is a dumb question.

3 Replies

You need to setup a DNS entry for a domain name, and then USE that domain name instead of just a IP. The IP will always result in the holding page.

To expand slightly: requests coming into the IP address will be handled by the first VirtualHost configured. This is probably "000-default" serving out of /var/www/html. Try running a2dissite 000-default to disable it.

Note that the first enabled site configuration, sorted by the configuration file name, will be the one that responds to requests coming to the bare IP address. If multiple sites are on the same server, I usually name them "001-primarysite.org," "002-secondarysite.org," etc. so that the main site will be the one that people land on in such a case.

Thank you for the help. I'll try to minimize the rookie mistakes. I did get it to work. It was DNS issues. happened to be spelling errors that I should have caught earlier, especially when I did reverse DNS setup. Just didn't know what to expect. Anyway, Thanks to both replies.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct