a question about the directoryindex directive

Preston Hagar prestonh at gmail.com
Mon Oct 26 17:57:57 UTC 2009


On Mon, Oct 26, 2009 at 12:48 PM, Preston Hagar <prestonh at gmail.com> wrote:
> On Fri, Oct 23, 2009 at 7:37 PM, Scott Berry <scottbb1973 at gmail.com> wrote:
>> Hello there,
>>
>> I am wondering where does the directoryindex directive need to go
>> in /etc/apache2/apache2.conf.  I am having a problem where Drupal5 is
>> not loading when I type:
>>
>> http://localhost/install.php
>> or
>> http://127.0.0.1/install.php.
>>
>> I think I have the problem narrowed down to the fact that it does not
>> know that Apache2 is looking for php script and Apache2 is not aware of
>> this.  Also what would the example be?  Is it something like:
>>
>> <directoryindex>
>> directoryindex index.php
>>
>> Thanks for the help.
>> Scott Berry
>> MCP and A Plus Certified
>> scottbb1973 at gmail.com
>>
>
> Mine is in the apache2.conf file towards the bottom.  I don't know
> that it matters a great deal exactly where in the file it is.
> Depending on your needs and how your server is setup, you can put it
> in apache2.conf as an overall server config, or in a VirtualHost block
> for a specific virtual host.  You can also put it in a specific
> Directory block.
>
> Mine is server-wide and looks like this:
>
> DirectoryIndex index.rhtml index.html index.rsp index.psp index.php
> index.pl index.htm index.php
>
> They should work in order of appearance, so for example, with my
> config above, it will first look for an index.rhtml followed by
> index.html, then index.rsp and so on.
>
> Here is a good link with more info:
>
> http://httpd.apache.org/docs/2.0/mod/mod_dir.html
>
> Preston
>

As a reply to my own reply.  I just re-read you initial problem a
little more closely right after I hit send.  Although the info above
is correct for DirectoryIndex, I doubt that is your issue.  The
DirectoryIndex specifies which file to look for if just a directory is
given in the URL.  For example, if you went to simply:

http://localhost/
or
http://127.0.0.1/

The DirectoryIndex parameter would tell it which files to look for in
which order.  If you are specifying a specific file like you
mentioned:

http://localhost/install.php

then DirectoryIndex is not used since you have already told it to go
to install.php in the ServerRoot directory.  To provide more help, it
would be good to perhaps look at your error.log and access.log.  If
you still can't figure out why it isn't working, we would probably
need more info from your apache conf files, your error.log and a more
detailed description of what the browser shows/tells you when you go
to http://localhost/install.php  Also, make sure that you have apache
running:

sudo /etc/init.d/apache2 status

Hope this helps,
Preston




More information about the ubuntu-users mailing list