Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 20th June 2007, 15:26
pjdevries pjdevries is offline
HowtoForge Supporter
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts
Default suPHP in custom Debian package

As an answer to my own initial question (see http://www.howtoforge.com/forums/showthread.php?t=12705), I decided to try to create a custom suPHP package to ease the installation of suPHP for use with ISPConfig. This is what I did:
  • Compiled suPHP as described by Hans in his article How To Set Up suPHP On A Debian Etch Based ISPConfig Server.
  • Downloaded and unpacked the stable Debian libapache2-mod-suphp package.
  • Replaced the original mod_suphp.so in the package with the customized version.
  • Adjusted several directives in the package control file:
    • Changed package name
    • Added dependency apache2-prefork-dev
    • Added conflict libapache2-mod-suphp
    • Adjusted Installed-Size
  • Added an additional README.
  • Updated the md5 values.
  • Created the package.
I now have a package that installs with dpkg -i. Doing so with libapache2-mod-suphp already installed or without apache2-prefork-dev (or any of the other dependencies like suphp-common) available, aborts the installation with an appropriate message. In the latter case, apt-get -f install is enough to have the missing packages installed.

After installation, I made the appropriate modifications to /home/admispconfig/ispconfig/lib/config.inc.php and 'touched' a website to have my /etc/apache2/vhosts/Vhosts_ispconfig.conf updated (see How To Set Up suPHP On A Debian Etch Based ISPConfig Server).

On the surface everything seems o.k. The only problem is that my php websites don't work. They all show the familiar "500 error - Internal Server Error!". Adding the neccessary Apache Directives for a site, makes it appear again.

Can anyone assist me in troubleshooting this problem? I have far too little experience to do that all by myself. Ofcourse the package will be made available to the ISPConfig community as soon all the problems have been solved.

Last edited by pjdevries; 21st June 2007 at 14:42.
Reply With Quote
Sponsored Links
Old 20th June 2007, 22:24
pjdevries pjdevries is offline
HowtoForge Supporter
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts

At least one thing is quite strange: there is no suPHP log file. My /etc/suphp/suphp.conf reads: logfile=/var/log/suphp/suphp.log and loglevel=info. The /var/log/suphp directory is there, but it's empty. So it appears that the mod_suphp module is never activated.
Reply With Quote
Old 21st June 2007, 12:55
till till is offline
Super Moderator
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,986
Thanks: 840
Thanked 5,647 Times in 4,457 Posts

When you install suphp, you should disable mod_php first. Then make sure that you enabled mod_suphp with the "a2enmod" command. When you get a 500 error, look in the error log of the website where you got the error and post the error message.
Till Brehm
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Old 21st June 2007, 16:22
pjdevries pjdevries is offline
HowtoForge Supporter
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts

Hi Till. Thanks once again for your reply.

Because Hans' howto first disables mod_php but in the end of the article enables it again to support suPHP incompatible applications (which is what I need too), I thought it wouldn't be neccessary to disable it in the first place, so I didn't. Also I expected the Debian package to enable mod_suphp automagically when installing the package, so I didn't do that either.

I did a fresh installation and this time I first disabled mod_php. After installing the package, I explicitly tried to enable mod_suphp, but got the message: 'This module is already enabled!'. So once again all looks well. Unfortunately it still doesn't work. A simple phpinfo script results in the 500 error (the file permissions of the script are 644).

I can't find any related error messages in the apache the log files. I also still don't have a suphp log file. When you say 'the error log of the website', which log file do you mean exactly?
Reply With Quote
Old 21st June 2007, 16:25
Hans Hans is offline
Join Date: Dec 2005
Location: Montfoort, The Netherlands
Posts: 2,263
Thanks: 216
Thanked 649 Times in 295 Posts
Default log file

Till means the log file within your /var/www/webX/log/

MrHostman | Managed Hosting
Reply With Quote
Old 21st June 2007, 21:23
pjdevries pjdevries is offline
HowtoForge Supporter
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts
Thumbs up The package works!

Thanks Hans (and Till). Inspecting the log file did the trick (I didn't know it existed until now ) because it showed that mod_suphp was looking in the wrong place for the suphp executable. By default mod_suphp looks in /usr/sbin. However, on Debian suphp is installed in directory /usr/lib/suphp by default. Adding the extra option '--sbindir=/usr/lib/suphp' to the configure command of Hans' howto, solved that problem.

So it finally appears to work. I didn't do any intensive testing yet, but my phpinfo script and Roundcube site show regular web pages instead of an annoying 500 error.

There are still some minor issues to deal with though. An important one is the /etc/suphp/suphp.conf file. This file is part of the Debian suphp-common packge, but it differs from the one Hans uses in his howto and that's the one that appears to work fine with ISPConfig, so I would like to include it in the custom mod_suphp package. However, when I do that, I get an error message and installation of my package aborts. Unfortunately I didn't write down the exact message, but it had something to do with the fact that you can not just overwrite a configuration file that originally came with another package. I don't know how to solve that, so I hope someone can give me a few pointers how it should be done in a proper manner. Can you be of any assistance there as well Till?

Once I solved the last few issues, I'll post my custom package in the forum and maybe even write a small howto on how to use it. It will probably be sort of a short version of Hans' howto

At this moment I can't spare the time to set up my own package repository, but if anyone already has one and would like to offer this package from that repository, I would like that very much. Installing the package with aptitude from a repository is much more user friendly than using dpkg because it takes care of all the dependencies.
Reply With Quote


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
Please help me whit bind9 astra2000 Server Operation 12 10th October 2007 03:43
Bind Failed christoph2k HOWTO-Related Questions 4 28th April 2007 01:57
Help....package missing sbovisjb1 Installation/Configuration 3 31st March 2006 12:14
suse 9.3 install: E: Couldn't find package ncftp aallen Installation/Configuration 4 26th January 2006 21:02
e-mail problem!!! Debian 3.1 maroonworks Installation/Configuration 18 6th December 2005 15:42

All times are GMT +2. The time now is 03:20.

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