After website migration, index.html no longer automatically loaded

Go To StackoverFlow.com

0

Thanks for any help you can provide!

We just migrated our website to a new server. It's on a Joyent Cloud running Sun/Oracle Solaris, and it has Ruby in addition to PHP. It runs on MySQL and Apache.

Before, we had things set up so that when I navigated to "example.com/community", my browser would find "example.com/community/index.html" and then meta refresh-redirect me appropriately to "example.com/communityboard"

Now, when I navigate to "example.com/community", I get a "file not found" error. However, if I navigate to "example.com/community/index.html", the site works as intended.

I think this is a problem in Apache, but I'm not 100% sure. Is there a way to fix this issue? Step-by-step advice would be much appreciated!

2012-04-03 22:50
by KDP


0

Here's what happened according to my developer. I don't fully understand the explanation, so I'm not sure I can answer follow-up questions! "With the old mongrel cluster, Apache would recognize "/community" as a directory, silently forward to "/community/", which would then pick up the forwarding index.html file. With Phusion Passenger," which I guess we're using now, "Apache sends the request directly to Passenger if "/community" is not a regular file, and Passenger was returning the 404 error. As a fix, we've disabled passenger in the community folder, which fixes the problem."

2012-04-17 11:53
by KDP


0

In your site config (ex. /etc/apache2/sites-available/example.com) you'll need to make sure you have a DirectoryIndex directive. Your config should look something like:

<VirtualHost xx.xxx.xxx.xx>
    ServerName example.com
    DocumentRoot /path/to/webroot
    DirectoryIndex index.html
</VirtualHost>

Then just make sure you do a '/etc/init.d/apache2 restart' and you should be good go.

2012-04-04 01:02
by clexmond
I appreciate the response! I'm running Apache on Joyent in a virtual host. I've used Joyent's Virtual Min to add index.html to the Directory Index Files input box. As a result, the .conf file for my virtual host has this code: DirectoryIndex index.html However, the page is still not being found. What do you think - KDP 2012-04-04 13:05
It may help you to have a look at the apache logs. Try /var/log/apache2/errors.log or access.log. See if you can't find some additional info and post it here - clexmond 2012-04-05 22:59
For some reason, the site is now working as intended! I'm going to find out next week what changes got it going again, and I'll report them here - KDP 2012-04-13 23:47
Here's what happened according to my developer. I don't fully understand the explanation, so I'm not sure I can answer follow-up questions! "With the old mongrel cluster, Apache would recognize "/community" as a directory, silently forward to "/community/", which would then pick up the forwarding index.html file. With Phusion Passenger," which I guess we're using now, "Apache sends the request directly to Passenger if "/community" is not a regular file, and Passenger was returning the 404 error. As a fix, we've disabled passenger in the community folder, which fixes the problem." Tx - KDP 2012-04-16 19:59
Ads