openSuse10.2, ISPConfig, no PHP

Discussion in 'Installation/Configuration' started by latcarf, Feb 19, 2007.

  1. latcarf

    latcarf New Member

    Hopefully I have posted this in the right place now... previously I was trying to work through a problem here Transferring Hard Drive to new System.

    Since my last post there I started from scratch with opensuse10.2 and the Perfect Setup for opensuse10.2. This time I did not perform the steps that indicated I would install ISPConfig at the end of the HowTo which I did not do. I loaded one of my sites and sure enough I was able to access PHP pages with no problems.

    This leads me to believe that the issue is not with opensuse as some tried to convince me before. I don't believe the issue is with ISPConfig either, however I do believe there is something in the process of installing ISPConfig that is preventing my PHP pages from being accessed.

    I like ISPConfig and would like to figure out why this is happening so I can continue to use it. :) Since I reinstalled opensuse10.2 I don't have anymore of the files from the previous install. Still some information in the thread I linked above though.

    Can we try to figure this out? It could be as simple as ISPConfig not setting my sites up under /srv/www/htdocs (I am thinking about the apache2 error log in the other thread... and that is where I loaded my site after this new install) but if that is the reason why didn't it? how do I fix it?
     
  2. martinfst

    martinfst Member Moderator

    The installation procedure of ISPConfig modifies the PHP settings for Apache(2). It removes the standard allowed php execution. Otherwise you could not select to switch php on or off for a website. If you want to run PHP, you have to set the PHP tick box for every website you want php to work on. Maybe you created a website yourself in the main apache2.conf? If that's true, you should leave the creation of sites and apache configurations to ISPconfig. Just thinking out loud.
     
  3. latcarf

    latcarf New Member

    Hi, thanks for replying!
    Yes, while I don't know the actual process I was aware it did this. I have been through the setup twice with PHP checked for the applicable sites. There was even remedy in the previous thread I linked that indicates not to check the boxes therefore preventing ISPConfig from altering PHP configurations but that did not work either.
    Probably not, I did not mess with the apache configs except where directed by the Perfect Setup for opensuse10.2. I did set up the sites via ISPConfig on the previous tries but again when I access the sites from the internet I could not access any PHP pages or content. On my last install of opensuse10.2 without installing ISPConfig I still didn't mess with the apache config files. I simply copied all the files for a site directly into /srv/www/htdocs and as I said when I tried to access PHP content it worked with no problem.

    With ISPConfig installed, sites up, this is the appache2 error I receive when I tried to access PHP content
    Code:
    [Sun Feb 18 17:52:29 2007] [error] [client ::1] Directory index forbidden by Options directive: /srv/www/htdocs/
    which is why I am thinking maybe ISPConfig should be setting the sites up in /srv/www/htdocs/ instead of /srv/www/. I am willing to give it a try but I do not know where/what to change in ISPConfig to do this.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please copy your websites to the website root directories that ISPConfig creates for your site and not in the default suse directory.
     
  5. latcarf

    latcarf New Member

    I did, web1, web2, web3 etc... correct? ISPConfig also generated directories with the site domain names and when I placed the files in the root directories they were copied into the domain directories also by ISPConfig I assume.

    Each time I tried the setup with ISPConfig an ls of /srv/www/ would look like this
    Code:
    cgi-bin htdig htdoc perl-lib web1 web2 web3 www.thefractalfarm.net www.latcarfproductions.com www.heartwinds.org
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig is not copying any files in the websites. You will have to upload your files to the web directory of the website. Example:

    /srv/www/www.thefractalfarm.net/web/

    Thats perfect, exactly as it should be.
     
  7. latcarf

    latcarf New Member

    I have done this, on the system that is currently in use and on the new one I am trying to setup. The latter being the one we are discussing.

    Maybe "copying" isn't the correct term? Either way if I move (or copy) the files to

    /srv/www/www.thefractalfarm.net/web/

    they also appear in the directory

    /srv/www/web1/web/

    without me having to copy or move them there. It seems to work vise-versa also. I have no doubt I am putting the files where they need to be.

    As I said before I tried it last without ISPConfig and I was able to access PHP content. I am in the process of doing a clean install again with ISPConfig and will see what happens then.
     
  8. martinfst

    martinfst Member Moderator

    That's the intended behavioral. www.thefractalfarm.net is a symbolic link to web1 in the directory /srv/www. Do
    Code:
    ls -l /srv/www
    and you'll see what I mean. Both names are the same. Something like a nickname.
     
  9. latcarf

    latcarf New Member

    Okay... after a complete clean reinstall of opensuse10.2 I once again have no access to PHP content or files. :mad:

    Per Falko's request in another thread; "What's the output of ifconfig"
    Code:
    server:~ # ifconfig
    eth0      Link encap:Ethernet  HWaddr 00:40:CA:6F:A5:F6
              inet addr:192.168.2.2  Bcast:192.168.2.255  Mask:255.255.255.0
              inet6 addr: fe80::240:caff:fe6f:a5f6/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:4250 errors:0 dropped:0 overruns:0 frame:0
              TX packets:3232 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:5073805 (4.8 Mb)  TX bytes:377765 (368.9 Kb)
              Interrupt:177 Base address:0xa000
    
    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:305 errors:0 dropped:0 overruns:0 frame:0
              TX packets:305 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0
              RX bytes:242146 (236.4 Kb)  TX bytes:242146 (236.4 Kb)
    and "what's in Vhosts_ispconfig.conf?"
    Code:
    ###################################
    #
    # ISPConfig vHost Configuration File
    #         Version 1.0
    #
    ###################################
    #
    NameVirtualHost 192.168.2.2:80
    <VirtualHost 192.168.2.2:80>
      ServerName localhost
      ServerAdmin root@localhost
      DocumentRoot /var/www/sharedip
    </VirtualHost>
    #
    #
    ######################################
    # Vhost: www.latcarfproductions.com:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.2:80>
    ServerName www.latcarfproductions.com:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web1/web
    ServerAlias latcarfproductions.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
    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 On
    php_admin_value open_basedir /srv/www/web1/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /srv/www/web1/phptmp/
    php_admin_value session.save_path /srv/www/web1/phptmp/
    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: www.heartwinds.org:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.2:80>
    ServerName www.heartwinds.org:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web2/web
    ServerAlias heartwinds.org
    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
    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 On
    php_admin_value open_basedir /srv/www/web2/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /srv/www/web2/phptmp/
    php_admin_value session.save_path /srv/www/web2/phptmp/
    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: www.thefractalfarm.net:80
    ######################################
    #
    #
    <VirtualHost 192.168.2.2:80>
    ServerName www.thefractalfarm.net:80
    ServerAdmin [email protected]
    DocumentRoot /srv/www/web3/web
    ServerAlias thefractalfarm.net
    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
    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 On
    php_admin_value open_basedir /srv/www/web3/
    php_admin_value file_uploads 1
    php_admin_value upload_tmp_dir /srv/www/web3/phptmp/
    php_admin_value session.save_path /srv/www/web3/phptmp/
    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>
    #
    #
    #
    Is Other Post this referring to changing Vhosts_ispconfig.conf? and is it done via console or direct input? I can see similar lines above in my vhost_ispconfig.conf file that specify AddType versus AddHandler.

    and what file are we changing here?
    Code:
    2. You add these lines in the "Apache directives" field manually:
    
    AddHandler application/x-httpd-php .php4
    AddHandler application/x-httpd-php .php5
    AddHandler application/x-httpd-php .php
    AddHandler application/x-httpd-php-source .php4s
    AddHandler application/x-httpd-php-source .php5s
    AddHandler application/x-httpd-php-source .phps
    
    ((these are the lines copied from the original SUSE Apache2 config)).
    from here
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

  11. latcarf

    latcarf New Member

    thank you! Seems like it took a long time to get here but it is finally working. The last link you gave me did the trick. Maybe there is a way of consolidating all the different posts on fixing this into one post that has the actual fix.

    thanks again! and I look forward to continuing with ISPConfig!! :D
     
  12. falko

    falko Super Moderator Howtoforge Staff

    AFAIK Till has added a fix for OpenSuSE 10.2 into the new ISPConfig 2.2.10. :)
     
  13. latcarf

    latcarf New Member

    Sounds good to me! lol... it will probably be openSuse 10.3 before we know it. I don't plan on setting up another server for a while (I hope!).
     
  14. latcarf

    latcarf New Member

    I tried to access PHP content today and got the window asking me if I wanted to open the file (and with what) or if I wanted to save it.

    I went to the server and checked vhost_ispconfig.conf and the change from AddType to AddHandler for
    Code:
    AddHandler application/x-httpd-php .php .php3 .php4 .php5
    had somehow gone back to AddType.

    No reboots, no restarts... what would cause this? Perhaps logging into ISPConfig? which I did do this morning to reset a password.
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Hmm, thats strange. The config.inc.php file is only read by ISPCONfig, not written. Only the setup script is writing to this file while ISPConfig is installed or updated.
     
  16. latcarf

    latcarf New Member

    I am not sure I understand the response... I have not opened or edited the config.inc.php file(?).

    The only file I have edited is the /etc/apache2/vhost/vhost_ispconfig.conf file. First 2 make my PHP content work per the previous link you gave me, then again when my PHP content stop working.

    As a test I just checked the PHP contend and all was fine. Then I logged into ISPConfig, reset a password for one of the site users, logged out of ISPConfig. Checked PHP contend and again and sure enough... "Open with, or save file".

    Went over to the server opened /etc/apache2/vhost/vhost_ispconfig.conf and sure enough AddHandler for the PHP lines had been reverted back to AddType!
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    Then your problem is clear. Never edit the file /etc/apache2/vhost/vhost_ispconfig.conf manually as it will get overwritten! You will have to enable the Addhandler directive in config.inc.php as PHP default handler. Its described there in the comments. But you must have upgraded to 2.2.10.
     
  18. latcarf

    latcarf New Member

    Got it... I think!! I am downloading 2.2.10 now and will get back to you...

    thanks!
     
  19. latcarf

    latcarf New Member

    Okay, I ran the update. The config.inc.php file only had about 78 lines so I backtracked the previous link you gave me (http://www.howtoforge.com/forums/showthread.php?t=10443&highlight=10.2+php) and it states to change config.lib.conf around line 1390.

    This is what I had
    Code:
        if($web["web_php"]){
          if($apache_version == 1){
            $php = "AddType application/x-httpd-php .php .php3 .php4 .php5";
          }
          if($apache_version == 2){
                      $php = '';
                    if($go_info["server"]["apache2_php"] == 'addtype' or $go_info["server"]["apache2_php"] == 'both' or $go_info["server"]["apache2_php"] == 'suphp') {
                            $php .= "AddType application/x-httpd-php .php .php3 .php4 .php5\n";
                    }
    				if ($go_info["server"]["apache2_php"] == 'addhandler') {
                            $php .= "AddHandler application/x-httpd-php .php .php3 .php4 .php5\n";
                    }
                    if($go_info["server"]["apache2_php"] == 'filter' or $go_info["server"]["apache2_php"] == 'both') {
                $php .= "<Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    and this is what I changed it to
    Code:
        if($web["web_php"]){
          if($apache_version == 1){
            $php = "AddHandler application/x-httpd-php .php .php3 .php4 .php5";
          }
          if($apache_version == 2){
                      $php = '';
                    if($go_info["server"]["apache2_php"] == 'addtype' or $go_info["server"]["apache2_php"] == 'both' or $go_info["server"]["apache2_php"] == 'suphp') {
                            $php .= "AddHandler application/x-httpd-php .php .php3 .php4 .php5\n";
                    }
    				if ($go_info["server"]["apache2_php"] == 'addhandler') {
                            $php .= "AddHandler application/x-httpd-php .php .php3 .php4 .php5\n";
                    }
                    if($go_info["server"]["apache2_php"] == 'filter' or $go_info["server"]["apache2_php"] == 'both') {
                $php .= "<Files *.php>
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    I changed lines 1387 to AddHandler and 1392 to AddHandler. Hopefully everything will return to normal now...
     
  20. till

    till Super Moderator Staff Member ISPConfig Developer

    Please undo the changes you made. The link you followed is for ISPConfig 2.2.9 and not 2.2.10.

    Please edit /home/admispconfig/ispconfig/lib/config.inc.php as I requested above and set:

    $go_info["server"]["apache2_php"] = 'addhandler'; // one string of one or more comma seperated options: 'filter' = set PHP filters, 'addtype' = Set PHP addtype, 'both' = Set Filter + Addtype, 'engine' = Use "php_admin_flag engine on/off", suphp = SuPHP wrapper enabled, 'addhandler' = Set PHP AddHandler (nescessary for SuSE 10.2)
     

Share This Page