Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st October 2008, 21:33
DirtyMonkey DirtyMonkey is offline
Junior Member
 
Join Date: Oct 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question Problem installing and configuring suPHP on Debian 4.0 Etch

MY APOLOGIES, WRONG FORUM - MOD/ADMIN PLEASE DELETE
--
I have followed taken instruction from the following sources but still suPHP fails to work.
I believe it may be specific to Debian/Ubuntu but I'm not sure.
End result is that browser tries to download .php page instead of Apache processing it.

Do I actually need to re-compile suPHP?
Have I included a step which is not required?
Have I missed something specific to Debian?
What logs should I be checking for errors?

NB: I am using Plesk not ISPConfig (I don't think it makes a difference)

http://www.howtoforge.com/apache2_suphp_php4_php5
http://www.howtoforge.com/install-su...2.20-and-above
http://www.howtoforge.com/forums/arc...p/t-13544.html

1. Disabled the normal PHP5 module:

Quote:
a2dismod php5
/etc/init.d/apache2 restart
2. Installed the prerequisites needed to build mod_suphp:

Quote:
apt-get install php5-cgi apache2-prefork-dev
3. Downloaded and built suPHP, adding the extra option
Code:
'--sbindir=/usr/lib/suphp':
Quote:
cd /tmp
wget http://www.suphp.org/download/suphp-0.6.3.tar.gz
tar xvfz suphp-0.6.3.tar.gz
cd suphp-0.6.3
./configure --prefix=/usr --sysconfdir=/etc --with-apache-user=www-data --with-setid-mode=paranoid --with-

apxs=/usr/bin/apxs2 --sbindir=/usr/lib/suphp
make
make install
4. Added the suPHP module to Apache configuration:

Quote:
nano /etc/apache2/httpd.conf
Code:
LoadModule suphp_module       /usr/lib/apache2/modules/mod_suphp.so
5. Created the configuration file /etc/suphp.conf

Quote:
cp /tmp/suphp-0.6.3/doc/suphp.conf-example /etc/suphp.conf
Code:
[global]
;Path to logfile
logfile=/var/log/suphp.log

;Loglevel
loglevel=info

;User Apache is running as
webserver_user=www-data

;Path all scripts have to be in
docroot=/

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

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

;Check whether script is within DOCUMENT_ROOT
check_vhost_docroot=true

;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=0077

;Minimum UID
min_uid=100

;Minimum GID
min_gid=100


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

;Handler for CGI-scripts
x-suphp-cgi=execute:!self
6. Add the suPHP module to the Apache configuration.

Quote:
nano /etc/apache2/httpd.conf
Code:
LoadModule suphp_module       /usr/lib/apache2/modules/mod_suphp.so
7. Created hosts.conf file:

Code:
# PHP version detected 5
<IfModule mod_suphp.c>
<Directory "/var/www/vhosts/example.com/httpdocs/">
php_admin_flag engine on
suPHP_Engine On
suPHP_ConfigPath "/var/www/vhosts/example.com/httpdocs/"
AddHandler php5-script .php
AddHandler x-httpd-php .php5
suPHP_AddHandler php5-script .php
<Files php.ini>
order allow,deny
deny from all
</Files>
php_value open_basedir "/tmp/"
php_value upload_tmp_dir "/var/www/vhosts/example.com/httpdocs/tmp/"
</Directory>
</IfModule>
8. Restarted Apache:

Quote:
/etc/init.d/apache2 restart

Last edited by DirtyMonkey; 1st October 2008 at 21:44. Reason: Wrong forum
Reply With Quote
Sponsored Links
  #2  
Old 2nd October 2008, 11:59
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,263
Thanks: 216
Thanked 649 Times in 295 Posts
Default

I Think you forget to run ISPConfig in suPHP mode, because you can not use php_admin_flag directives like: php_admin_flag engine on

To run ISPConfig in suPHP mode:

Edit /home/admispconfig/ispconfig/lib/config.inc.php find the line:

$go_info["server"]["apache2_php"] = 'both';

and change to:

$go_info["server"]["apache2_php"] = 'suphp';

Restart ispConfig afterwards with:

/etc/init.d/ispconfig_server restart

Excuse me if i am wrong, but i think this is the reason.
__________________
Hans

MrHostman | Managed Hosting
Reply With Quote
  #3  
Old 2nd October 2008, 12:29
DirtyMonkey DirtyMonkey is offline
Junior Member
 
Join Date: Oct 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Hans, as previously mentioned I am not running ISPConfig. (although I am considering it)

DM.
Reply With Quote
  #4  
Old 2nd October 2008, 12:54
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,263
Thanks: 216
Thanked 649 Times in 295 Posts
Default

Ok, now i see. Sorry.
Did you remove all the php-admin flags from your vhost file as well?
__________________
Hans

MrHostman | Managed Hosting
Reply With Quote
  #5  
Old 2nd October 2008, 13:01
DirtyMonkey DirtyMonkey is offline
Junior Member
 
Join Date: Oct 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I haven't no, is it not required?

DM.
Reply With Quote
  #6  
Old 2nd October 2008, 13:18
Hans Hans is offline
Moderator
 
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,263
Thanks: 216
Thanked 649 Times in 295 Posts
 
Default

Yes it is required as php_admin flags are not understood by suPHP.
For information also have a look here. I've mentioned it there as well.
__________________
Hans

MrHostman | Managed Hosting
Reply With Quote
Reply

Bookmarks

Tags
apache2, debian, etch, suphp

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem installing ISPConfig on Suse10.1 nliebherr Installation/Configuration 18 14th September 2007 01:30
Problem installing Ubuntu 7.04 Server dickeytt Installation/Configuration 3 23rd May 2007 13:46
Problem installing ISPconfig - PHP Binary error Danielss89 Installation/Configuration 3 10th January 2007 16:10
Need help in configuring FC4 for installing Oracle DB 10g. victagious Installation/Configuration 11 16th November 2005 21:41


All times are GMT +2. The time now is 23:54.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.