Setting up DirectoryIndex in Ubuntu Apache 2.2
So in setting up this new Ubuntu box, I ran into a problem that I couldn’t solve for the longest time, even though it is the simplest of problems–how do you setup DirectoryIndex in Apache2.2 without using a .htaccess file?
It turns out that this is VERY simple. Assuming that you are like me and just setting up Apache 2.2 on a home machine and that you are not using virtual hosting, it goes something like this.
First you want to find your default configuration. For me it was in the /etc/apache2 directory. Using your favorite text editor (mine is joe), open the file:
sudo joe /etc/apache2/sites-available/default
locate the following block:
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
then add the following line into the above directory block:
DirectoryIndex nameoffile.extension
For me, it looks like:
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
DirectoryIndex login.php index.php home.html
It’s that easy!
Thanks alot! That is easy!
I knew that it used a DirectoryIndex function but I didn’t know where to put it on my Ubuntu setup, but my MAMP setup had the configuration in httpd.conf, completely different from the Ubuntu box.
Thanks again!