CentOS 5.2+ISPc3+suPHP=no php, html only

Discussion in 'Installation/Configuration' started by DonAteloNow, Mar 21, 2009.

  1. DonAteloNow

    DonAteloNow New Member

    Hello, my friends,

    First of all what I have done already:

    1. I installed ISPconfig 3.0.0.9 on fresh CentOS 5.2 i386 server and used instructions on ispconfig.org documentation.

    2. After I noticed that apache didn't started when I chose SuPHP option for website. I simply haven't suphp module on my server.

    3. I installed suphp following falco's guide "SuPHP On Fedora 7 Or CentOS 5 With ISPConfig". It was weird to me, that installation created only module file, but not suphp.conf or suphp.log, so I maked those files manualy and renamed php.conf:

    /etc/httpd/conf.d/suphp.conf:
    LoadModule suphp_module modules/mod_suphp.so
    suPHP_Engine on
    AddHandler x-httpd-php .php
    AddHandler x-httpd-php .php .php4 .php3 .phtml
    suPHP_AddHandler x-httpd-php

    /etc/suphp.conf
    [global]
    ;Path to logfile
    logfile=/var/log/suphp.log

    ;Loglevel
    loglevel=info

    ;User Apache is running as
    webserver_user=apache

    ;Path all scripts have to be in
    docroot=/

    ;Path to chroot() to before executing script
    ;chroot=/mychroot

    ; Security options
    allow_file_group_writeable=true
    allow_file_others_writeable=true
    allow_directory_group_writeable=true
    allow_directory_others_writeable=true

    ;Check wheter script is within DOCUMENT_ROOT
    check_vhost_docroot=false

    ;Send minor error messages to browser
    errors_to_browser=false

    ;PATH environment variable
    env_path=/bin:/usr/bin

    ;Umask to set, specify in octal notation
    umask=0022

    ; Minimum UID
    min_uid=20

    ; Minimum GID
    min_gid=20


    [handlers]
    ;Handler for php-scripts
    x-httpd-php=php:/usr/bin/php-cgi

    ;Handler for CGI-scripts
    x-suphp-cgi=execute:!self

    My virtualhosts file:
    <VirtualHost *:80>
    DocumentRoot /var/clients/client1/web1/web

    ServerName domain.com
    ServerAlias www.domain.com
    ServerAdmin [email protected]

    ErrorLog /var/log/ispconfig/httpd/domain.com/error.log

    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 503 /error/503.html

    <Directory /var/www/domain.com/web>
    Options FollowSymLinks
    AllowOverride Indexes AuthConfig Limit FileInfo
    Order allow,deny
    Allow from all
    </Directory>

    # suphp enabled
    <Directory /var/clients/client1/web1/web>
    suPHP_Engine on
    # suPHP_UserGroup web1 client1
    AddHandler x-httpd-suphp .php .php3 .php4 .php5
    suPHP_AddHandler x-httpd-suphp
    </Directory>


    </VirtualHost>

    So, apache is starting normaly, but I cannot access ISP control panel (port 8080) - I'm being redirected to Apache 2 Test Page. When I trying to reach www.domain.com, I getting ISPconfig's green welcome page (html). www.domain.com/phpmyadmin gives me 500 Internal server error, and if I trying http://myipaddress I also getting ISPconfig's green welcome page (html).

    Now logs:
    /var/log/httpd/error_log:
    [Sat Mar 21 11:14:29 2009] [notice] caught SIGTERM, shutting down
    [Sat Mar 21 11:15:52 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
    [Sat Mar 21 11:15:52 2009] [notice] Digest: generating secret for digest authentication ...
    [Sat Mar 21 11:15:52 2009] [notice] Digest: done
    [Sat Mar 21 11:15:52 2009] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
    [Sat Mar 21 11:42:23 2009] [error] [client 88.119.xxx.xxx] Directory index forbidden by Options directive: /var/www/html/

    /var/log/ispconfig/httpd/domain.com:
    [Sat Mar 21 11:53:28 2009] [error] [client 82.135.xxx.xxx] No user or group set - set suPHP_UserGroup
    [Sat Mar 21 11:53:28 2009] [error] [client 82.135.xxx.xxx] File does not exist: /var/www/error/500.html

    I swear, I tried lots of things. I have another server with Ubuntu and there everything is going well. It's is a second day since I'm trying to sort this out :( Falco's tutorial is based on ISPconfig 2, but it must be compatible with ISPconfig 3 as well. I could not find line "$go_info["server"]["apache2_php"] = 'both';" in ISPc3 config.inc.php or elsewhere to change it to " $go_info["server"]["apache2_php"] = 'suphp';", but I believe it have nothing to do with whole http server, right? Also I tried to put line "suPHP_UserGroup apache apache" to /etc/httpd/conf.d/suphp.conf. Should I try to install mod_suphp from repos instead? I tried to install version 0.7.1 as well, but result was the same. Anyway, installations went without errors. I think... :eek:

    So, please, help me to sort this out.
     
  2. DonAteloNow

    DonAteloNow New Member

    Innane question again? :eek: :rolleyes: :D
     
  3. falko

    falko Super Moderator Howtoforge Staff

    Please install the latest ISPConfig 3 from SVN. In 3.0.0.9, CentOS support was experimantal, but now in SVN it should work.
     
  4. DonAteloNow

    DonAteloNow New Member

    Is there newer version from SVN? As I mentioned, I have 3.0.0.9 RC2 already.
     
  5. falko

    falko Super Moderator Howtoforge Staff

    Please run
    Code:
    ispconfig_update_from_svn.sh
     
  6. DonAteloNow

    DonAteloNow New Member

    Thank you, Falco. I did it. Anyway, as I mentioned in other post, I moved to FastCGi, so those errors can come because of that. I'm trying to login to CP, but IE8 gives me the error:
    Webpage error details

    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322; InfoPath.2)
    Timestamp: Sun, 22 Mar 2009 16:56:24 UTC


    Message: Unknown runtime error
    Line: 165
    Char: 5
    Code: 0
    URI: http://72.20.xxx.xxx:8080/js/scrigo.js.php

    I checked file /usr/local/ispconfig/interface/web/js/scrigo.js.php and compared with the same file from Ubuntu server and found no difference in lines mentioned above:
    function loadContent(pagename) {
    var pageContentCallback2 = {
    success: function(o) {
    if(o.responseText.indexOf('HEADER_REDIRECT:') > -1) {
    var parts = o.responseText.split(':');
    loadContent(parts[1]); } else if (o.responseText.indexOf('URL_REDIRECT:') > -1) {
    var newUrl= o.responseText.substr(o.responseText.indexOf('URL_REDIRECT:') + "URL_REDIRECT:".length);
    document.location.href = newUrl;
    } else {
    document.getElementById('pageContent').innerHTML = o.responseText;
    }
    },
    failure: function(o) {
    alert('Ajax Request was not successful.');
    }
    }

    In my setup both SuPHP and FastCGI modules are enabled. Sites now are usinf FastCGI. I'm gona to change parameters to use SuPHP and I'll post the result.
    I know that CentOS is experimental and I'm far away from Linux guru, but I believe I can sort this out with your help. Thanks again.

    Forgot to say, that after SVN upgrade I got new symlink /etc/httpd/conf/sites-enabled/000-ispconfig.conf :) O noticed before, that I don't have it, but I wasn't sure do I need it, since everything worked (except suPHP).
     
    Last edited: Mar 22, 2009
  7. DonAteloNow

    DonAteloNow New Member

    Still no luck :( I fixed following problems
    [Sat Mar 21 11:53:28 2009] [error] [client 82.135.xxx.xxx] No user or group set - set suPHP_UserGroup
    after I added line suPHP_UserGroup web1 client1 to vhost file and
    [Sat Mar 21 11:53:28 2009] [error] [client 82.135.xxx.xxx] File does not exist: /var/www/error/500.html
    by copying error files to /var/www directory.

    Anyway, I still cannot to login to CP, /phpmyadmin gives me source code in page and I'm getting errors
    [warn] mod_fcgid: stderr: PHP Notice: Undefined offset: 0 in /var/clients/client1/web1/web/en/bnr/start.php on line 14

    [Sun Mar 22 20:55:10 2009] [error] [client 82.135.xxx.xxx] SoftException in Application.cpp:199: Script "/var/clients/client1/web1/web/infophp.php" resolving to "/var/clients/client1/web1/web/infophp.php" not within configured docroot
    [Sun Mar 22 20:55:10 2009] [error] [client 82.135.xxx.xxx] Premature end of script headers: infophp.php
    [Sun Mar 22 21:04:15 2009] [error] [client 82.135.xxx.xxx] SecurityException in Application.cpp:437: Handler not found in configuration
    [Sun Mar 22 21:04:15 2009] [error] [client 82.135.xxx.xxx] Caused by KeyNotFoundException in Configuration.cpp:234: Handler "x-httpd-suphp" not found
    [Sun Mar 22 21:04:15 2009] [error] [client 82.135.xxx.xxx] Premature end of script headers: index.php

    Even more, I can enable/disable suphp.conf and php.conf - it makes no difference. I can access pages configured for FastCGI and that's it.
     
  8. till

    till Super Moderator Staff Member ISPConfig Developer

    Please install your server exactly as described in the installation instructions for centos that you find in the docs folder of the svn version.
     
  9. DonAteloNow

    DonAteloNow New Member

    Thanks, Till. The problem is that I'm managing this server remotely. I asked admin to install it with SSH only. He wasn't very happy :) So, after he did this, I followed last instructions for Centos 5.2. No less, no more. It's not the first time I'm installing ISPconfig. Even more, in one server I installed ISP3 after ISP2 removal, maked some changes and now it's working well :) Anyway, it is the first time I'm installing ISP3 on CentOS. ISP2 is working on CentOS very well. So, for now I'll try to find solutions for problems, because I don't want to ask owner of server to reinstall system again :) I believe it is misconfiguration somewhere. I don't know if anybody will find my posts useful, but I'll keep posting ;)
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    The problem is that the ispconfig version you installed fisrt did not fully support centos and so your installation has several wrong presets which can not be fixed by updating ispconfig. You should download the latest svn version, run the uninstall script to completely remove ispconfig and then reinstall ispconfig.
     
  11. DonAteloNow

    DonAteloNow New Member

    Just to make sure - I must use uninstall script, right? Because there is uninstall-fedora script as well, so, since Redhat, Fedora and CentOS are the members of the same family?.. :rolleyes:

    Sorry, I didn't checked inside scripts :) I must use uninstall-fedora.

    OK, progress - after ISPconfig removal phpmyadmin started to work.

    I repeated almost all steps and noticed that:
    No package php-magickwand available.
    No package php-magpierss available.
    No package php-mapserver available.
    No package php-shout available.
    Are these packages really necessary?

    The same result - cannot login to CP :( And file /var/www/php-fcgi-scripts/ispconfig/.php-fcgi-starter created by installation doesn't work as well - it gives me 500 internal server error. Only after I replaced line "exec /usr/lib/cgi-bin/php -d magic_quotes_gpc=off" with "exec /usr/bin/php-cgi -d magic_quotes_gpc=off", I was able to access CP page, but not to login.
    SuPHP module is turned off. Sites looks ok, only phpmyadmin shows me source code page (IE8) or suggests to download index.php file after login (IE7). Strange, Firefox opens login page inside login page:
    [​IMG]
     
    Last edited: Mar 23, 2009
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    No, at least not for ISPconfig.

    You have to install mod_php too as described in the installation instructions. mod_php is a requirement if you want to use phpmyadmin and webmail.
     
  13. DonAteloNow

    DonAteloNow New Member

    Requested dep: mod_php is provided by installed package
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    Ok. Just realized that you use a redhat based distribution. phpmyadmin will not work the way it is installed by fedora or centos as they use a alias which is incompatible with the use of fcgi as the phpmyadmin source gets installed into a directory outside the apache document root. if you want to use phpmyadmin and webmail, there are two options:

    1) Create a wbsite and install your own copy of phpmyadmin into it.
    2) Cretae a symlink /usr/local/ispconfig/interface/web/phpmyadmin which points to the phpmyadmin sources and then make sure that you run the ispconfig interface with mod_php and not fcgi and you will be able to access phpmyadmin with the url yourserver.com:8080/phpmyadmin
     

Share This Page