No PHP on Virtual Hosts

Discussion in 'Installation/Configuration' started by tmeyer, Feb 25, 2006.

  1. tmeyer

    tmeyer New Member

    I am new to Apache, PHP and ISPConfig. I have one virtual host I am trying to setup. I have PHP Scripts seleted but not safe mode in the ISPConfig interface..

    I have a simple php info test page at root level. When I try to open test.php in a browser, I get a dialog box:

    You have chosen to open test.php which is a: PHP script from http://www....
    What should Firefox do with this file? Open with ......., etc.


    I am running on Fedora core 4 Apache/1.3.33 (Unix) PHP/5.0.4 mod_ssl/2.8.23 OpenSSL/0.9.8

    I downloaded the latest ISPConfig setup yesterday and installed.

    I have phpmyadmin running just fine and it is talking to MySQL. So PHP is working on the server, just not in virtual hosted domains.

    Any help would be more than appreciated.

    Tim Meyer
     
  2. till

    till Super Moderator

    Which directory is "at root level"?

    The root level of a ISPConfig website is like /home/www/web[ID]/web or /var/www/web[ID]/web.
     
  3. tmeyer

    tmeyer New Member

    The root directory is /home/www/web4/web.

    This is the directory ISPConfig created. There is also a symlink /home/www.domainname.com that points to /home/www/web4

    I might mention that SSI and perl scripts are running fine.

    Thanks for any help in this matter.
     
  4. falko

    falko Super Moderator

    What's in your Vhosts_ispconfig.conf file?
    Also, anything in the Apache error log?
     
  5. tmeyer

    tmeyer New Member

    First off, below is the last several entries in the apache error log:

    [Sun Feb 26 12:09:26 2006] [error] [client 192.168.1.18] Directory index forbidden by rule: /var/www/sharedip/
    [Sun Feb 26 12:09:26 2006] [warn] [client 192.168.1.18] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed
    [Sun Feb 26 12:09:26 2006] [warn] [client 192.168.1.18] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed
    [Sun Feb 26 12:14:28 2006] [error] [client 192.168.1.18] Directory index forbidden by rule: /var/www/sharedip/
    [Sun Feb 26 12:14:28 2006] [warn] [client 192.168.1.18] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed
    [Sun Feb 26 12:14:28 2006] [warn] [client 192.168.1.18] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed
    [Sun Feb 26 12:19:29 2006] [error] [client 192.168.1.18] Directory index forbidden by rule: /var/www/sharedip/
    [Sun Feb 26 12:19:29 2006] [warn] [client 192.168.1.18] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed
    [Sun Feb 26 12:19:29 2006] [warn] [client 192.168.1.18] mod_include: Options +Includes (or IncludesNoExec) wasn't set, INCLUDES filter removed



    Below is the virtual host doc :

    ###################################
    #
    # ISPConfig vHost Configuration File
    # Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.2.55:80
    <VirtualHost 192.168.2.55:80>
    ServerName localhost
    ServerAdmin root@localhost
    DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.dmcityview.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.55:80>
    ServerName www.dmcityview.com:80
    ServerAdmin webmaster@dmcityview.com
    DocumentRoot /home/www/web4/web
    ServerAlias dmcityview.com
    DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
    ScriptAlias /cgi-bin/ /home/www/web4/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /home/www/web4/log/error.log
    AddType application/x-httpd-php .php .php3 .php4 .php5
    <Files *.php>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php3>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php4>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    <Files *.php5>
    SetOutputFilter PHP
    SetInputFilter PHP
    </Files>
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/home/www/web4/web/error/"
    ErrorDocument 400 /error/invalidSyntax.html
    ErrorDocument 401 /error/authorizationRequired.html
    ErrorDocument 403 /error/forbidden.html
    ErrorDocument 404 /error/fileNotFound.html
    ErrorDocument 405 /error/methodNotAllowed.html
    ErrorDocument 500 /error/internalServerError.html
    ErrorDocument 503 /error/overloaded.html
    AliasMatch ^/~([^/]+)(/(.*))? /home/www/web4/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /home/www/web4/user/$1/web/$3
    </VirtualHost>
    #
    #
    #


    Thanks...
     
  6. till

    till Super Moderator

    The warnings in the logfile are all for the sharedIP site.

    You are using the domain: www.dmcityview.com in your browser to get the .php file and not the IP address?

    www.dmcityview.com currently oints to an active site in the internet. Is this site currently located in the folder /home/www/web4/web of your server?
     
  7. tmeyer

    tmeyer New Member

  8. till

    till Super Moderator

    Please check if mod_php is loaded in your httpd.conf and if there are no php related errors in your apache error log.
     
  9. tmeyer

    tmeyer New Member

    No PHP in Virtual Hosts

    the last line ine the LoadModule section of /etc/httpd/conf/httpd.conf is:

    LoadModule php5_module modules/libphp5.so

    Also, in /usr/lib/httpd/modules there is a libphp5.so file.


    In the error log, I did find a bunch of these:

    [Sun Feb 26 09:50:57 2006] [error] an unknown filter was not added: PHP
    [Sun Feb 26 09:50:57 2006] [error] an unknown filter was not added: PHP
    [Sun Feb 26 09:51:08 2006] [error] an unknown filter was not added: PHP
    [Sun Feb 26 09:51:08 2006] [error] an unknown filter was not added: PHP
     
  10. falko

    falko Super Moderator

    Is 209.234.75.244 your public IP address?
     
  11. tmeyer

    tmeyer New Member

    Yes, that is the public IP.
     
  12. falko

    falko Super Moderator

    Does PHP work for other web sites on that server?
     
  13. tmeyer

    tmeyer New Member

    Actually, that is the only virtual host I have set up. The first 3, I had deleted just working with the setup.

    ISPConfig and phpmyadmin are running fine, however, I think that ISPConfig sets up its own server separate from the virtuals.

    Thanks.
     
  14. falko

    falko Super Moderator

    ISPConfig has indeed its own Apache which serves the ISPConfig web interface on port 81. It is totally independent from your main Apache and has nothing to do with the problem.
     

Share This Page