suPHP / PHP5 / ISP Config

Discussion in 'Installation/Configuration' started by Dy0nisus, Jan 10, 2007.

  1. Dy0nisus

    Dy0nisus New Member

    Hi guys!

    ISP was working ... but this only was a tryout, because we are testing
    the migration of our Webserver to ISPConfig.

    Yesterday we started a new test:

    1. perfect debian 3.1 installation
    2. suPHP with PHP5 / PHP4
    http://www.howtoforge.com/apache2_suphp_php4_php5
    3. install ISPConfig
    4. changing ISPConfig
    http://www.howtoforge.com/forums/showthread.php?t=8791
    5. adding Web'S

    Then we got the Problem, that ISP wasn't able do create VHosts. And
    everytime we want to look at the new webs, Apache default page was
    shown.

    Now my Quastion. Is the order of step 1 - 5 correct or should we change it?

    thanks for reply :)
     
  2. mphayesuk

    mphayesuk Member

    What changes did you make to ISPConfig, did you make any changes after adding websites.
     
  3. Dy0nisus

    Dy0nisus New Member

    No Webs were added yet.

    I followd this instructions:
    http://www.howtoforge.com/forums/showthread.php?t=8791

    Then i added the first Web ... Didn't work properly.
     
  4. mphayesuk

    mphayesuk Member

    What version of ispconfig are you using. If you have the latest version installed 2.2.9 then you might want to double check your manual edits with one of the developers, the thread you followed would have been for older versions so not sure if the same fix will work in the new one. Thats the only thing I can think of.
     
  5. Dy0nisus

    Dy0nisus New Member

    I use 2.2.9 ...

    Hm thats right. Maybe a developer looks at this thread and posts a comment :)
     
  6. mphayesuk

    mphayesuk Member

    To see if your changes are affecting ispc you could install the 2.2.9 version again which will overide your changes and then see if you can add a web site, if you can you need to revisit how to make the changes you want.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you get any errors when you run:

    rm -f /root/ispconfig/.ispconfig_lock
    /root/ispconfig/php/php -q /root/ispconfig/scripts/writeconf.php
     
  8. Dy0nisus

    Dy0nisus New Member

    hi til!

    i tried some things:

    complete new install an ispconfig is working. then i deleted the
    web i tested with.

    Then installed suPHP with php5 and php4 working as cgi. It workes
    when i manually create vhosts. (thanks to falko!)

    Next i changed the ISConfig code, to use a checkbox php_5.

    Now i added the web i deleted (as well in the trash folder) again. No
    vhost again. only apache default webpage.

    Code:
    rm -f /root/ispconfig/.ispconfig_lock
    /root/ispconfig/php/php -q /root/ispconfig/scripts/writeconf.php
    result:

    Code:
    start
    ende
    any idears?
     
  9. falko

    falko Super Moderator ISPConfig Developer

    Please add another web site. What's the output of
    Code:
    ls -la /root/ispconfig
    then? Are there any errors in /home/admispconfig/ispconfig/ispconfig.log?
    Please make sure there's no syntax error in /root/ispconfig/scripts/lib/config.lib.php.
     
  10. Dy0nisus

    Dy0nisus New Member

    output of

    Code:
    ls -la /root/ispconfig
    after adding the web test.de

    Code:
    insgesamt 124
    drwxr-xr-x   9 root root  4096 2007-01-11 22:06 .
    drwxr-xr-x   5 root root  4096 2007-01-11 14:44 ..
    -rwxr-xr-x   1 root root 54012 2007-01-10 17:14 cronolog
    -rwxr-xr-x   1 root root  9673 2007-01-10 17:14 cronosplit
    drwxr-xr-x  12 root root  4096 2007-01-10 17:02 httpd
    drwxr-xr-x  12 root root  4096 2007-01-10 17:14 isp
    -rw-r--r--   1 root root     8 2007-01-11 22:06 .old_path_httpd_root
    drwxr-xr-x   6 root root  4096 2007-01-10 16:57 openssl
    drwxr-xr-x   6 root root  4096 2007-01-10 17:09 php
    drwxr-xr-x   4 root root  4096 2007-01-10 17:14 scripts
    drwxr-xr-x   4 root root  4096 2007-01-10 17:14 standard_cgis
    drwxr-xr-x   2 root root  4096 2007-01-10 17:14 sv
    -rwx------   1 root root  9389 2007-01-10 17:14 uninstall
    
    there are two WARN in the log

    Code:
    11.01.2007 - 22:06:30 => WARN - /root/ispconfig/scripts/lib/config.lib.php, Line                                                                              2422: WARNING: could not httpd -t  &> /dev/null
    11.01.2007 - 22:06:30 => WARN - /root/ispconfig/scripts/lib/config.lib.php, Line                                                                              2433: httpd syntax seems to contain errors, reloading with old configuration
    
    but its not at the position the code was changed.

    here is my codechange:

    if($go_info["server"]["apache2_php"] == 'suphp'){
    if($web["php_5"]){
    $php .= "suPHP_Engine on\n";
    $php .= "suPHP_UserGroup ".$webadmin." web".$web["doc_id"]."\n";
    $php .= "AddHandler x-httpd-php5 .php .php3 .php4 .php5\n";
    $php .= "suPHP_AddHandler x-httpd-php5\n";
    }
    else {
    $php .= "suPHP_Engine on\n";
    $php .= "suPHP_UserGroup ".$webadmin." web".$web["doc_id"]."\n";
    $php .= "AddHandler x-httpd-php .php .php3 .php4 .php5\n";
    $php .= "suPHP_AddHandler x-httpd-php\n";
    }
    }
     
  11. Dy0nisus

    Dy0nisus New Member

    hmmm ... I restored the original

    /root/ispconfig/scripts/lib/config.lib.php

    no change ...
     
  12. Dy0nisus

    Dy0nisus New Member

    ahhh suPHP fucked me up !!!

    i guess its the same issue ... ISPConfig and 3 web's worked perfect.

    for the 4th web we need suPHP ... so i followed again falko's HowTo ...

    then i added the needed suPHP lines to the existing vhosts manualy ...

    result: php-mysql didn't work.

    Hat ISPConfig Probleme mit suPHP ??? oder bin ich enfach zu doof :)

    sorry for german, but i m tireeeeed :D
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig works fine with SuPHP. But you can not use SuPHP and mod_php on the same server, thats described on the suphp homepage :)

    You will have to runn all your websites with suphp. You will also have to enable it in /home/admispconfig/ispconfig/lib/config.inc.php

    By the way, never add anything to the vosts in Vhost_ispconfig.conf manually, it will get overwritten!
     
  14. Dy0nisus

    Dy0nisus New Member

    I know that its not possible to run php4 as madule and as cgi with php ... i didn't do that !!!

    That it would be overwritte with restarting the server was not the matter, because i just wanna to test if it's working. it worked exept msql qry's from php.

    As i disabled suphp and enabled mod php everthing worls fine, except suPHP obviously.

    But we do need suPHP for one site ... i m stuck with it.

    what do u mean exactly with

     
    Last edited: Jan 12, 2007
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Open the file in a text editor and enable SuPHP in it. The file is commented.
     
  16. Dy0nisus

    Dy0nisus New Member

    i found the value and changed it to

    Code:
    $go_info["server"]["apache2_php"] = 'suphp';
    what effect will this have on existing vhosts?
     
  17. till

    till Super Moderator Staff Member ISPConfig Developer

    It will change the configuration for all vhsosts to suphp mode, this means that PHP is run trough suphp. To start the new configuration, you must edit one website and save it, so the Vhost_ispconfig.conf file is rewritten.
     
  18. Dy0nisus

    Dy0nisus New Member

    ahh okay ... suPHP is running, BUT:

    Code:
    Fatal error: Call to undefined function: mysql_connect() in /var/www/web1/web/clarion/db.inc on line 2
    mysql problem ... do i have to install additional msql mods?
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check with a php file like:

    <?php
    phpinfo();
    ?>

    which php.ini file is read from your php interpreter that suphp uses and make sure that mysql is enabled there.
     
  20. Dy0nisus

    Dy0nisus New Member

    hmm ... php-mysql is not loaded due suPHP ...

    php.ini is from /etc/php4/cgi/php.ini

    i copied the php.ini used bye php4 mod. nothing changed ... do have
    to make custon changes to php.ini if it runs as cgi through suPHP?
     

Share This Page