MultiViews dont work [CentOS] [Apache2] [php5]

Mich

Verified User
Joined
Aug 29, 2007
Messages
19
Hi,

I cant get Multiviews to work :(

I have added a .htaccess file with the following contents:
Options +MultiViews

And i do not get a Internal server error, so i assume its OK.

But when i go to the document, :

http://www.hostingmanager.eu/test1/test/

(http://www.hostingmanager.eu/test1/test.php)

i only get 404 errors.

When i move the exact same folder (test1) to another server, it works fine.

My configuration is:

Apache 2.0 Handler
PHP Version 5.2.4

Loaded Modules core mod_authn_file mod_authn_default mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_default mod_auth_basic mod_include mod_filter mod_deflate mod_log_config mod_logio mod_env mod_headers mod_unique_id mod_setenvif mod_ssl prefork http_core mod_mime mod_dav mod_status mod_autoindex mod_asis mod_suexec mod_cgi mod_dav_fs mod_dav_lock mod_negotiation mod_dir mod_actions mod_userdir mod_alias mod_rewrite mod_so mod_php5

And my httpd.conf:

Code:
ServerRoot "/etc/httpd"
Listen 80

LoadModule php5_module        /usr/lib/apache/libphp5.so

User apache
Group apache

ServerAdmin admin@localhost
DocumentRoot "/var/www/html"

<Directory /home/*>
    AllowOverride All
    Options -Indexes FollowSymlinks IncludesNoExec +Includes +MultiViews
<Limit GET POST OPTIONS PROPFIND>
    Order allow,deny
    Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
    Order deny,allow
    Deny from all
</LimitExcept>
</Directory>

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all  
   <IfModule mod_suphp.c>
        suPHP_Engine On
 	suPHP_UserGroup webapps webapps
   </IfModule>
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html index.htm index.shtml index.php index.php5 index.php4 index.php3 index.phtml index.cgi
</IfModule>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog /var/log/httpd/error_log
LogLevel debug

<IfModule log_config_module>
    #replace %b with %O for more accurate logging
    <IfModule logio_module> 
      LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
      LogFormat "%h %l %u %t \"%r\" %>s %O" common
      LogFormat "%O" bytes
    
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    
    CustomLog /var/log/httpd/access_log common
</IfModule>
    
<IfModule alias_module>
    # Include some DirectAdmin alias
    Include conf/extra/httpd-alias.conf
</IfModule>

<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>


DefaultType text/plain
    
<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-gzip .tgz
    AddEncoding x-compress .Z
    AddEncoding x-gzip .gz .tgz
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
    AddHandler cgi-script .cgi
    AddHandler type-map var
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
</IfModule>
    
#EnableMMAP off
#EnableSendfile off

######################################################################################
# Do not change anything in included files, because they are rewritten by DirectAdmin #
#######################################################################################

# This is needed for PHP
Include conf/extra/httpd-php-handlers.conf
      
# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf

# Fancy directory listings
Include conf/extra/httpd-autoindex.conf

# Language settings
Include conf/extra/httpd-languages.conf
    
# User home directories
#Include conf/extra/httpd-userdir.conf

# Real-time info on requests and configuration
Include conf/extra/httpd-info.conf
    
# Virtual hosts   
Include conf/extra/httpd-vhosts.conf
    
# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf

# Distributed authoring and versioning (WebDAV)
Include conf/extra/httpd-dav.conf  
    
# Various default settings
Include conf/extra/httpd-default.conf
    
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf
    
# Deflate module settings
Include conf/extra/httpd-deflate.conf
    
# All the DirectAdmin vhosts
Include conf/extra/directadmin-vhosts.conf

# All suPHP directives
Include conf/extra/httpd-suphp.conf
 All suPHP directives
Include conf/extra/httpd-suphp.conf

# All the other includes needed by the custombuild script
Include conf/extra/httpd-includes.conf

#######################################################################################
# End of included files that are rewritten by DirectAdmin                             #
#######################################################################################

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

I googled for about 2 hours, i found topics with the same error but not the solotion/fix for me :(

Does anyone see the problem here?

Thanks in advance.
 
I had the same problem and i solved it by doing this:

Code:
vi /etc/httpd/conf/extra/httpd-php-handlers.conf
Added this line to the file:
Code:
AddType text/html php
Service restart:
Code:
service httpd restart

Now it should work fine. If someone has a better solution please let me know.
 
Lol, yeah that fixed the problem for me too :D

But it looks like a dirty solution, or just plain and logic?

Well, it works again, that saves me a bunch of e-mail from customers.

Thanks in advance!
 
I am going to fix it in CustomBuild script. Thank you. :)
 
After an upgrade of Apache on FreeBSD from version 1.3 to 2.0.63 via default /usr/local/directadmin/custombuild/build MultiViews are not anymore working for PHP scripts (suPHP).

http://www.domain.com/test.php - works fine
http://www.domain.com/test/ - get 404 error with the log message

[Tue May 19 14:34:16 2009] [error] [client aaa.bbb.ccc.ddd] File does not exist: /home/username/domains/domain.com/public_html/script.php/, referer: http://www.domain.com/

Request http://www.domain.com/test displays PHP source.

What is wrong?
 
Now we should force script to be parsed by PHP.
PHP is used via suPHP without mod_php at all.
 
Back
Top