PHP on Virtual Sites (SuSE 10.2) troubled

Discussion in 'Installation/Configuration' started by jervolpe, Jul 7, 2007.

  1. jervolpe

    jervolpe New Member

    The Perfect SuSE 10.2 Setup (completed five times now)
    ISPConfig Installed without error (after about 10 failures)

    Virtual sites configured with PHP scripting activated, but PHP pages will not present if found in the 'web' level directory (the old download issue).... BUT if the PHP page is nested in another directory... for example the 'src' directory in Squirrelmail, the PHP files run correctly.

    I've tested the basic phpinfo.php page...
    <?php
    phpinfo() ;
    ?>

    both in 'web' and nested one level down. It won't execute in 'web' but it will when nested. Ownerships and privileges are the same.


    I have read back through the past three months on Howtoforge searching for answers... mostly I seem to be ready OpenSuSE bashing. Too bad, I've used SuSE successfully since version 5.2.

    Has anyone actually fixed this problem without replacing the distro? I have tried changing
    $go_info ........... = 'addhandler'; in the config.inc.php file... but not difference in outcome.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You must change one of your websites and then hit save after you changed the line in config.inc.php
     
  3. jervolpe

    jervolpe New Member

    PHP problem

    Yes, I know and yes I did. No effect. My suspect is Mod_php5-5.2.0-14. I obtained the newest version from SuSE 10.3 and I'll try that tomorrow to see if it improves this situation. (mod_php5-5.2.3-2).
     
  4. falko

    falko Super Moderator ISPConfig Developer

    Any errors in Apache's error log?

    In what directory does ISPConfig create the web sites? Do you see that PHP is enabled in Vhosts_ispconfig.conf?
     
  5. jervolpe

    jervolpe New Member

    Yes, I an sleuthing the error! There is a scent!

    Yesterday, I finally got around the the httpd error log (not sure why I was so slow on the uptake) and found the probable source of my consternation.

    Every time I evoke an update from ISPConfig I find seven errors. Now it just so happens I have seven virtual websites configured via ISPConfig as well. The error seems to explain the symptoms:

    Directory Index forbidden by Options Directive /srv/www/htdocs/

    As it had been about three years since I more or less retired myself from IT and building apache servers I had to take a short course in apache2 configuration files. Started doing that last evening. There does not seem to be a conflict withing the virtual definitions themselves, the Options Directive referred to is a more global setting being inherited by the virtual servers. Now what is interesting is how the symptoms of this error does not appear to be recursive... meaning that only the web 'top' directory is unable to process .php files... nested directories don't appear to have the problem. This itself is another clue I'm wrapping myself around today. The last thought I had last evening went something like "what if the Options Directive was one that wasn't implicitly declared within a *.conf file but rather one that is an inherit default to apache2? Probably a wild herring. Anyway, now I am reviewing Option Directives and trying to interpret the probably 'meanings' of "Directory Index forbidden.." part of the error itself. For example, is the entire statement null and void because IT IS a Directory Index statement.... OR is it forbidden because one one or more of the 'types' associated to this particular DirectoryIndex is forbidden by an earlier (or implicit) Options directive (is that even possible?)

    So that is where I am. So close to the problem that I am just seeing gray I expect.... just need to perhaps back away a bit and note if they gray is a mouse or an elephant!

    Thoughts?
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    The directory /srv/www/htdocs/ is never used in a ISPConfig setup. If you get errors for this directory, there are the following possibilitys:

    1) ISPConfig is not installed completely.
    2) The ISPConfig configuration httpd file (Vhost_ispconfig.conf) is either empty or not included in your configuration.
    3) You selected a wrong IP address for the website in ISPConfig.

    Please post the content of the file Vhost_ispconfig.conf, the file is located in /etc/apache2/vhosts/ or a similar directory in /etc where your apache configuration is stored.

    Plaese post also the output of the commands:

    ifconfig

    and:

    ls -la /etc/apache2/vhosts/

    (The directory for the ls command may vary depending on your linux distribution).
     
  7. jervolpe

    jervolpe New Member

    Here are the items you asked for, part 1

    First of all here is a snip for my error.log:

    [Sun Jul 08 03:06:] [notice] Graceful restart requested, doing restart
    [Sun Jul 08 03:06:] [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
    [Sun Jul 08 03:06:] [notice] Apache/2.2.3 (Linux/SUSE) configured -- resuming normal operations
    [Sun Jul 08 03:06:] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    [Sun Jul 08 03:06:] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    [Sun Jul 08 03:06:] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    [Sun Jul 08 03:06:] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    [Sun Jul 08 03:06:] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    [Sun Jul 08 03:06:] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    [Sun Jul 08 03:06:] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    [Sun Jul 08 03:06:] [warn] long lost child came home! (pid 21963)
    serenity:/var/log/apache2 #


    Now, I have no idea why it is stating /srv/www/htdocs


    Here is the directory for

    serenity:/srv/www # ls -la
    total 56
    drwxr-xr-x 14 root root 4096 Jul 8 00:30 .
    drwxr-xr-x 5 root root 4096 Jul 6 15:26 ..
    drwxr-xr-x 2 root root 4096 Jul 6 17:07 cgi-bin
    drwxr-xr-x 3 root root 4096 Jul 7 00:21 htdocs
    lrwxrwxrwx 1 root web5 13 Jul 6 21:00 kd6wky.tomorrowsweb.com -> /srv/www/web5
    lrwxrwxrwx 1 root web4 13 Jul 6 20:58 kg6tt.tomorrowsweb.com -> /srv/www/web4
    drwxr-xr-x 3 root root 4096 Jul 8 00:30 localhost
    lrwxrwxrwx 1 root web2 13 Jul 6 20:54 ma.tomorrowsweb.com -> /srv/www/web2
    lrwxrwxrwx 1 root web3 13 Jul 6 20:57 masupport.tomorrowsweb.com -> /srv/www/web3
    lrwxrwxrwx 1 root web6 13 Jul 6 21:01 n6ajr.tomorrowsweb.com -> /srv/www/web6
    drwxr-xr-x 2 root root 4096 Nov perl-lib
    drwxr-xr-x 3 root root 4096 Jul 7 00:30 serenity.tomorrowsweb.com
    lrwxrwxrwx 1 root web7 13 Jul 6 21:05 w6vvr.tomorrowsweb.com -> /srv/www/web7
    drwxr-xr-x 8 root web1 4096 Jul 7 01:14 web1
    drwxr-xr-x 9 root web2 4096 Jul 6 20:54 web2
    drwxr-xr-x 8 root web3 4096 Jul 6 20:57 web3
    drwxr-xr-x 8 root web4 4096 Jul 7 21:32 web4
    drwxr-xr-x 8 root web5 4096 Jul 6 21:00 web5
    drwxr-xr-x 8 root web6 4096 Jul 6 21:01 web6
    drwxr-xr-x 8 root web7 4096 Jul 6 21:05 web7
    lrwxrwxrwx 1 root web1 13 Jul 6 20:51 webmail.tomorrowsweb.com -> /srv/www/web1
    serenity:/srv/www #


    And now the directory for the /srv/www/htdocs/ mentioned in errors

    serenity:/srv/www/htdocs # ls -la
    total 12
    drwxr-xr-x 3 root root 4096 Jul 7 00:21 .
    drwxr-xr-x 14 root root 4096 Jul 8 00:30 ..
    drwxr-xr-x 7 root root 4096 Jul 7 00:04 phpMyAdmin
    serenity:/srv/www/htdocs #

    I'll look into the Include for phpMyAdmin next. Meanwhile here are the items you wanted to see:





    Continuing on........
     
  8. jervolpe

    jervolpe New Member

    The rest of it.... well under 10000 characters of it

    (I did remove the Include for phpMyAdmin. Reset the server and the error messages remained exactly as before)

    The last item...


    serenity:/etc/apache2/vhosts # cat Vhosts_ispconfig.conf
    ###################################
    #
    # ISPConfig vHost Configuration File
    # Version 1.0
    #
    ###################################
    #
    NameVirtualHost 10.10.10.51:80
    <VirtualHost 10.10.10.51:80>
    ServerName localhost
    ServerAdmin root@localhost
    DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: webmail.tomorrowsweb.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.51:80>
    ServerName webmail.tomorrowsweb.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web1/web
    ServerAlias tomorrowsweb.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/ /srv/www/web1/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /srv/www/web1/log/error.log
    AddHandler application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/srv/www/web1/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 ^/~([^/]+)(/(.*))? /srv/www/web1/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web1/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: ma.tomorrowsweb.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.51:80>
    ServerName ma.tomorrowsweb.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web2/web
    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/ /srv/www/web2/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /srv/www/web2/log/error.log
    AddHandler application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/srv/www/web2/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 ^/~([^/]+)(/(.*))? /srv/www/web2/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web2/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: masupport.tomorrowsweb.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.51:80>
    ServerName masupport.tomorrowsweb.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web3/web
    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/ /srv/www/web3/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /srv/www/web3/log/error.log
    AddHandler application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/srv/www/web3/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 ^/~([^/]+)(/(.*))? /srv/www/web3/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web3/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: kg6tt.tomorrowsweb.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.51:80>
    ServerName kg6tt.tomorrowsweb.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web4/web
    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/ /srv/www/web4/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /srv/www/web4/log/error.log
    AddHandler application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode Off
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Alias /error/ "/srv/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 ^/~([^/]+)(/(.*))? /srv/www/web4/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web4/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: kd6wky.tomorrowsweb.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.51:80>
    ServerName kd6wky.tomorrowsweb.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web5/web
    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/ /srv/www/web5/cgi-bin/
    AddHandler cgi-script .cgi
    AddHandler cgi-script .pl
    ErrorLog /srv/www/web5/log/error.log
    AddHandler application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode On
    php_admin_value open_basedir /srv/www/web5/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /srv/www/web5/phptmp/
    php_admin_value session.save_path /srv/www/web5/phptmp/
    Alias /error/ "/srv/www/web5/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 ^/~([^/]+)(/(.*))? /srv/www/web5/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web5/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: n6ajr.tomorrowsweb.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.51:80>
    ServerName n6ajr.tomorrowsweb.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web6/web
    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
    ErrorLog /srv/www/web6/log/error.log
    AddHandler application/x-httpd-php .php .php3 .php4 .php5
    php_admin_flag safe_mode On
    php_admin_value open_basedir /srv/www/web6/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /srv/www/web6/phptmp/
    php_admin_value session.save_path /srv/www/web6/phptmp/
    Alias /error/ "/srv/www/web6/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 ^/~([^/]+)(/(.*))? /srv/www/web6/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web6/user/$1/web/$3
    </VirtualHost>
    #
    #
    #
    ######################################
    # Vhost: w6vvr.tomorrowsweb.com:80
    ######################################
    #
    #
    <VirtualHost 10.10.10.51:80>
    ServerName w6vvr.tomorrowsweb.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web7/web
    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
    ErrorLog /srv/www/web7/log/error.log
    Alias /error/ "/srv/www/web7/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 ^/~([^/]+)(/(.*))? /srv/www/web7/user/$1/web/$3
    AliasMatch ^/users/([^/]+)(/(.*))? /srv/www/web7/user/$1/web/$3
    </VirtualHost>
    #
    #
    #serenity:/etc/apache2/vhosts #
     
  9. jervolpe

    jervolpe New Member

    Ooops, forgot these items you asked for...

    #serenity:/etc/apache2/vhosts # ifconfig
    eth0 Link encap:Ethernet HWaddr 00:E0:18:1C:68:64
    inet addr:10.10.10.51 Bcast:10.10.10.255 Mask:255.255.255.0
    inet6 addr: fe80::2e0:18ff:fe1c:6864/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:80101 errors:0 dropped:0 overruns:0 frame:0
    TX packets:62897 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes: (32.4 Mb) TX bytes: (14.3 Mb)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:11077 errors:0 dropped:0 overruns:0 frame:0
    TX packets:11077 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes: (1.5 Mb) TX bytes: (1.5 Mb)


    ___________________________________________


    serenity:/etc/apache2/vhosts # ls -la
    total 32
    drwxr-xr-x 2 root root 4096 Jul 7 21:27 .
    drwxr-xr-x 12 root root 4096 Jul 7 20:10 ..
    -rw-r--r-- 1 root root 8500 Jul 8 03:06 Vhosts_ispconfig.conf
    -rw-r--r-- 1 root root 8926 Jul 8 03:06 Vhosts_ispconfig.conf~
    serenity:/etc/apache2/vhosts #


    I've poured myself over all the config sections.... I have yet to find any mention to /srv/www/htdocs as a Directory root for anything other than phpmyadmin.... and I can't see how that can generate 7 errors (the number of virtual sites currently defined).
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok, this looks fine so far. Is the file Vhosts_ispconfig.conf included at the end of your apache2.conf or httpd.conf file?
     

Share This Page