HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Tips/Tricks/Mods (http://www.howtoforge.com/forums/forumdisplay.php?f=19)
-   -   suPHP in custom Debian package (http://www.howtoforge.com/forums/showthread.php?t=13544)

pjdevries 20th June 2007 15:26

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.

pjdevries 20th June 2007 22:24

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.

till 21st June 2007 12:55

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.

pjdevries 21st June 2007 16:22

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?

Hans 21st June 2007 16:25

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

pjdevries 21st June 2007 21:23

The package works!
 
Thanks Hans (and Till). Inspecting the log file did the trick (I didn't know it existed until now :o) 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.

till 22nd June 2007 00:22

Sorry, but without a exact error message I do not know what the problem is.

pjdevries 22nd June 2007 09:13

I can imagine. I'll try to reproduce the error and get back to you later.

pjdevries 22nd June 2007 13:52

This is what i get when running the command 'dpkg -i obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386.deb':
Selecting previously deselected package obix-ispconfig-libapache2-mod-suphp.
(Reading database ... 25665 files and directories currently installed.)
Unpacking obix-ispconfig-libapache2-mod-suphp (from obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386.deb) ...
dpkg: error processing obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386.deb (--install):
trying to overwrite `/etc/suphp/suphp.conf', which is also in package suphp-common
Errors were encountered while processing:
obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386.deb
Does this help? Can you give me a clue how to overwrite '/etc/suphp/suphp.conf' in a proper manner?

falko 22nd June 2007 14:19

Quote:

Originally Posted by pjdevries
dpkg: error processing obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386.deb (--install):
trying to overwrite `/etc/suphp/suphp.conf', which is also in package suphp-common

Did you set the correct dependencies in the .deb file?


All times are GMT +2. The time now is 13:12.

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