DirectoryIndex Not Working w/PHP on 2.0.58

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've got a FreeBSD 5.4-RELEASE box that I've just fallen into administering, with an existing Apache 2.0.58 install. One of my first tasks has been to get PHP4 installed, so that the site can support a blog and some other features.

The PHP installation went smoothly, as I did it via FreeBSD's ports tree. Phpinfo() shows a healthy install, and the blog functions great...except for the fact that it relies on index.php being served up for a given directory, which is not working.

Having run into this problem before, I went off and added "index.php" to the global DirectoryIndex, which now looks like:

DirectoryIndex index.html index.html.var index.php

When this didn't work (I'm still getting a directory listing instead of the output of index.php when I hit http://www.myserver.com/subdirectory/), I figured it might have something to do with the fact that the domain in question was being served out of a VirtualHost directive. So I went in and tweaked the DirectoryIndex value for the virtual host, so that it is now:

    DirectoryIndex index.html index.html.var index.asp index.php

(The index.asp piece is because this site was earlier migrated from an IIS box; those files are actually just pure HTML in this case.)

Note that I've also got:

AddType application/x-httpd-php .php

in my global config, and PHP pages will parse properly when called directly.

Even with all this done, I'm still getting directory listings instead of the output of index.php. At this point, I'm baffled. The only thing I can think of is that there's lots of modules loaded, and perhaps one of them is conflicting with another somehow.

In any case, here are those modules, as well as the relevant VirtualHost config:

LoadModule access_module libexec/apache2/mod_access.so
LoadModule auth_module libexec/apache2/mod_auth.so
LoadModule auth_anon_module libexec/apache2/mod_auth_anon.so
LoadModule auth_dbm_module libexec/apache2/mod_auth_dbm.so
#LoadModule auth_digest_module libexec/apache2/mod_auth_digest.so
#LoadModule file_cache_module libexec/apache2/mod_file_cache.so
LoadModule charset_lite_module libexec/apache2/mod_charset_lite.so
#LoadModule cache_module libexec/apache2/mod_cache.so
#LoadModule disk_cache_module libexec/apache2/mod_disk_cache.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule deflate_module libexec/apache2/mod_deflate.so
LoadModule log_config_module libexec/apache2/mod_log_config.so
LoadModule logio_module libexec/apache2/mod_logio.so
LoadModule env_module libexec/apache2/mod_env.so
LoadModule mime_magic_module libexec/apache2/mod_mime_magic.so
LoadModule cern_meta_module libexec/apache2/mod_cern_meta.so
LoadModule expires_module libexec/apache2/mod_expires.so
LoadModule headers_module libexec/apache2/mod_headers.so
LoadModule usertrack_module libexec/apache2/mod_usertrack.so
LoadModule unique_id_module libexec/apache2/mod_unique_id.so
LoadModule setenvif_module libexec/apache2/mod_setenvif.so
LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
<IfDefine SSL>
LoadModule ssl_module libexec/apache2/mod_ssl.so
</IfDefine>
LoadModule autoindex_module libexec/apache2/mod_autoindex.so
LoadModule mime_module libexec/apache2/mod_mime.so
LoadModule dav_module libexec/apache2/mod_dav.so
LoadModule status_module libexec/apache2/mod_status.so
LoadModule asis_module libexec/apache2/mod_asis.so
LoadModule info_module libexec/apache2/mod_info.so
LoadModule cgi_module libexec/apache2/mod_cgi.so
LoadModule dav_fs_module libexec/apache2/mod_dav_fs.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
LoadModule negotiation_module libexec/apache2/mod_negotiation.so
LoadModule imap_module libexec/apache2/mod_imap.so
LoadModule actions_module libexec/apache2/mod_actions.so
LoadModule speling_module libexec/apache2/mod_speling.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule alias_module libexec/apache2/mod_alias.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
#LoadModule php4_module libexec/apache2/libphp4.so
#LoadModule php5_module        libexec/apache2/libphp5.so
LoadModule php4_module        libexec/apache2/libphp4.so
LoadModule dir_module libexec/apache2/mod_dir.so

...

<VirtualHost *:80>
    ServerAdmin peabody@xxxxxxxxxxx
    DocumentRoot /usr/local/www/data
    ServerName webdav.marssociety.org
    DirectoryIndex index.html index.html.var index.asp index.php
    ErrorLog /var/log/webdav-error_log
    CustomLog /var/log/webdav-access_log combined
    <Location /mdrs>
     AuthName "MDRS WebDav"
     AuthType Basic
     AuthUserFile /usr/local/etc/apache2/users
      DAV On
      AllowOverride None
      Options None
      <Limit PUT POST DELETE PROPFIND PROPPATCH MKCOL COPY MOVE LOCK UNLOCK>
        Require user peabody, gus
      </Limit>
   </Location>

# To take acre of attenpts at relay spamming? The domain
# always seems to be fem.to. Or I could use SQUID in the pattern as well
   RewriteEngine On
   RewriteCond %{HTTP:VIA} fem\.to [NC]
   RewriteRule ^.*$ - [F]
</VirtualHost>

Any help at all would be greatly appreciated.

Alex Kirk


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux