View Full Version : suPHP / PHP5 / ISP Config
Dy0nisus
10th January 2007, 13:31
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 :)
mphayesuk
10th January 2007, 14:00
What changes did you make to ISPConfig, did you make any changes after adding websites.
Dy0nisus
10th January 2007, 14:27
No Webs were added yet.
I followd this instructions:
http://www.howtoforge.com/forums/showthread.php?t=8791
3. I edited the form 'ISP Web' and added a checkbox called php_5 to the Options tab.
4. I edited the file /root/ispconfig/scripts/lib/config.lib.php
and changed the original code to
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";
}
}
Then i added the first Web ... Didn't work properly.
mphayesuk
10th January 2007, 14:43
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.
Dy0nisus
10th January 2007, 15:08
I use 2.2.9 ...
Hm thats right. Maybe a developer looks at this thread and posts a comment :)
mphayesuk
10th January 2007, 16:13
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.
till
10th January 2007, 18:50
Do you get any errors when you run:
rm -f /root/ispconfig/.ispconfig_lock
/root/ispconfig/php/php -q /root/ispconfig/scripts/writeconf.php
Dy0nisus
11th January 2007, 15:50
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.
rm -f /root/ispconfig/.ispconfig_lock
/root/ispconfig/php/php -q /root/ispconfig/scripts/writeconf.php
result:
start
ende
any idears?
falko
11th January 2007, 20:06
Please add another web site. What's the output of 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.
Dy0nisus
11th January 2007, 23:10
output of
ls -la /root/ispconfig
after adding the web test.de
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
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";
}
}
Dy0nisus
12th January 2007, 00:28
hmmm ... I restored the original
/root/ispconfig/scripts/lib/config.lib.php
no change ...
Dy0nisus
12th January 2007, 07:04
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
till
12th January 2007, 10:45
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!
Dy0nisus
12th January 2007, 14:45
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
You will also have to enable it in /home/admispconfig/ispconfig/lib/config.inc.php
till
12th January 2007, 14:52
Open the file in a text editor and enable SuPHP in it. The file is commented.
Dy0nisus
12th January 2007, 15:53
i found the value and changed it to
$go_info["server"]["apache2_php"] = 'suphp';
what effect will this have on existing vhosts?
till
12th January 2007, 16:04
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.
Dy0nisus
12th January 2007, 16:11
ahh okay ... suPHP is running, BUT:
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?
till
12th January 2007, 16:20
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.
Dy0nisus
12th January 2007, 16:36
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?
till
12th January 2007, 16:43
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?
No. Normally it sould work when it is enabled in the php.ini file:confused:
Dy0nisus
12th January 2007, 16:55
first of all i like to thank u for the fast replys!!
i found something, but i dont know, why it's that way (out of phpinfo()):
'../configure' '--prefix=/usr' '--enable-discard-path' '--enable-fastcgi' '--with-config-file-path=/etc/php4/cgi' '--enable-memory-limit' '--disable-debug' '--with-regex=php' '--disable-rpath' '--disable-static' '--with-pic' '--with-layout=GNU' '--with-pear=/usr/share/php' '--enable-calendar' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-bcmath' '--with-bz2' '--enable-ctype' '--with-db4' '--with-iconv' '--enable-exif' '--enable-filepro' '--enable-ftp' '--with-gettext' '--enable-mbstring' '--with-pcre-regex=/usr' '--enable-shmop' '--enable-sockets' '--enable-wddx' '--disable-xml' '--with-expat-dir=/usr' '--with-xmlrpc' '--enable-yp' '--with-zlib' '--without-pgsql' '--with-kerberos=/usr' '--with-openssl=/usr' '--with-zip=/usr' '--enable-dbx' '--with-mime-magic=/usr/share/misc/file/magic.mime' '--with-exec-dir=/usr/lib/php4/libexec' '--without-mm' '--without-mysql' '--without-sybase-ct'
--without-mysql
i guess thats the problem?
EDIT: phpinfo() also shows
Configuration File (php.ini) Path: /etc/php4/cgi
but enabled as mod:
Configuration File (php.ini) Path: /etc/php4/apache2/php.ini
is that a problem too?
till
12th January 2007, 17:09
--without-mysql
i guess thats the problem?
Thats no problem. It yout means that mysql is not compiled in which is always the case for modular php installations. mysql must be lodaed as module in the php.ini file.
Is there a php.ini file in the directory /etc/php4/cgi/ and is php enabled in tis php.ini file?
Dy0nisus
12th January 2007, 17:20
ok ...
yes there is! to mysql it says:
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On
; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1
; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1
; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port =
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host =
; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =
; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =
; Maximum time (in seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60
; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
; SQL-Errors will be displayed.
mysql.trace_mode = Off
BUT:
;extension=mysql.so
maybe i shuld enable this extention?!
till
12th January 2007, 17:27
Yes, you must thenable the extension by removing the ; iin front of the line:
;extension=mysql.so
Dy0nisus
12th January 2007, 17:43
ahh ok ...
strange thing:
i enabled and restarted apache ... ok.
then i could not connect to any web ... then i disabled ist again and restartet
apache2 ... now it works with mysql and no errors yet ...
big thank you :D
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.