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.
Reply
 
Thread Tools Display Modes
  #11  
Old 22nd June 2007, 13:44
pjdevries pjdevries is offline
HowtoForge Supporter
 
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts
Default

This is the contents of my package control file:
Package: obix-ispconfig-libapache2-mod-suphp
Version: 0.6.2-1
Section: web
Priority: optional
Architecture: i386
Depends: libc6 (>= 2.3.6-6), suphp-common (= 0.6.2-1), apache2.2-common, apache2
-prefork-dev
Conflicts: libapache2-mod-suphp
Installed-Size: 120
Maintainer: Pieter-Jan de Vries (pieter@obix-hosting.nl)
Source: suphp
Description: Apache2 module to run php scripts with the owner permissions
With the use of the suphp setuid root binary (from suphp-common package),
this Apache2 module change the uid of the process executing the PHP
interpreter to the owner of the php script.
This package is a modified version of the the stable Debian package with
the same version number, to make it work effortless with ISPConfig
(see usr/share/doc/libapache2-mod-suphp/README.obix).
Do you think there is anything missing or badly configured?
Reply With Quote
Sponsored Links
  #12  
Old 23rd June 2007, 20:49
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
Default

The problem is that your package depends on suphp-common, but both suphp-common and your package come with the file /etc/suphp/suphp.conf...
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #13  
Old 24th June 2007, 11:42
pjdevries pjdevries is offline
HowtoForge Supporter
 
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts
Default

Thanks Falko. I guessed that much but I don't know the proper way to solve it. Because my custom package is nothing more than a customised Debian libapache2-mod-suphp package, it needs to depend on exactly the same packages as the original Debian package. suphp-common is one of them.

I assume there is a standard way to handel such a situation, but thusfar I haven't been able to figure out what it is. Obviously I could just make a custom package of suphp-common with a modified /etc/suphp/suphp.conf, but I think there must be a cleaner way to handle these kind of situations.

Suggestions are quite welcome.
Reply With Quote
  #14  
Old 24th June 2007, 13:02
pjdevries pjdevries is offline
HowtoForge Supporter
 
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts
Default

After a bit of extra digging, I found a way to resolve this issue. Adding the "Replaces: suphp-common" directive to the package control file, makes dpkg overwrite the existing /etc/suphp/suphp.conf file without complaining.

So here it is, a customized libapache2-mod-suphp package (see attachment), modified to work with ISPConfig. You apply it as follows:
  • backup /etc/apache2/vhosts/Vhosts_ispconfig.conf
  • if you don't need the regular php5 module anymore:
    • a2dismod php5
    • remove all php_admin entries from /etc/apache2/vhosts/Vhosts_ispconfig.conf
  • apt-get install suphp-common apache2-prefork-dev
  • dpkg -i obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386.deb
  • edit /home/admispconfig/ispconfig/lib/config.inc.php and change $go_info["server"]["apache2_php"] = 'both'; into $go_info["server"]["apache2_php"] = 'suphp';
  • /etc/init.d/ispconfig_server restart
  • make a small modification to one of your websites to force ISPConfig to write a new /etc/apache2/vhosts/Vhosts_ispconfig.conf file
This package has been tested on a server running Debian Etch, ISPConfig 2.2.14, PHP 5.2.0-8 and Apache 2.2.3. I assume if you edit /etc/suphp/suphp.php and change x-httpd-php=php:/usr/bin/php5-cgi into x-httpd-php=php:/usr/bin/php-cgi it will work with either php4 or php5 but I haven't tested that myself.

Beware!!! I'm not an experienced Debian developer and and this is my first package which hasn't been extensively tested yet, nor has the resulting suphp installation. Usage is at your own risk but any feed back and suggestions for improvements are very much appreciated.
Attached Files
File Type: gz obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386.deb.gz (18.2 KB, 234 views)
Reply With Quote
The Following 5 Users Say Thank You to pjdevries For This Useful Post:
Chrispix (15th July 2007), falko (25th June 2007), mbria (3rd December 2007), Ohem (4th July 2007), till (12th July 2007)
  #15  
Old 4th July 2007, 02:22
Ohem Ohem is offline
Junior Member
 
Join Date: May 2007
Posts: 15
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Thank you for this package, works perfect in Ubuntu (7.04). I strongly suggest the package place in the Download section (together with these instructions).

Last edited by Ohem; 4th July 2007 at 04:33.
Reply With Quote
  #16  
Old 15th July 2007, 11:37
Chrispix Chrispix is offline
Junior Member
 
Join Date: Jul 2007
Posts: 6
Thanks: 2
Thanked 1 Time in 1 Post
Default

Thanks for the package and the installation instructions, pjdevries!

I am considering installing suPHP on my Debian server, but since I had some issues before when I had suPHP installed on an OpenSuse system, I am a little reluctant to do so (especially since I am by no means an expert on administration yet).

So my question is: supposed I encounter problems when suPHP is running, how easy is it to remove it and restore the previous configuration alltogether? If you have the time, I would really appreaciate if you could explain how a deinstallation of your package could be performed.
__________________
Regards, Chrispix
Reply With Quote
  #17  
Old 15th July 2007, 13:05
pjdevries pjdevries is offline
HowtoForge Supporter
 
Join Date: Sep 2006
Posts: 130
Thanks: 7
Thanked 12 Times in 5 Posts
Default

Thanks for the kind words Chrispix

As I explained, I'm not an experienced Debian developer. I am also not an experienced administrator. I tried to keep the package as standard as possible though and by using the original Debian libapache2-mod-suphp package as a starting point, I think I may have succeeded. As a result, uninstalling should be as straigth forward as: dpkg --remove (or --purge) obix-ispconfig-libapache2-mod-suphp_0.6.2-1_i386. The command dpkg --help will give you more information.

Good luck.
Reply With Quote
  #18  
Old 17th July 2007, 10:47
Chrispix Chrispix is offline
Junior Member
 
Join Date: Jul 2007
Posts: 6
Thanks: 2
Thanked 1 Time in 1 Post
Default

Oh no, it is not as easy as I expected (or hoped), since my system architecture (amd64) does not match the package's architecture (i368).
__________________
Regards, Chrispix
Reply With Quote
  #19  
Old 17th July 2007, 17:53
Chrispix Chrispix is offline
Junior Member
 
Join Date: Jul 2007
Posts: 6
Thanks: 2
Thanked 1 Time in 1 Post
Default

Ok, I made my own Debian package by using your package as a basis and replacing the mod_suphp - file with one I compiled on my system.

Then I followed the steps mentioned in one of your previous posts. The installation of my package seemed to work flawless, however, suPHP wasn't running obviously... whenever I tried to access a PHP-page, it was simply offered as a download by the server.

Also, the Vhosts_ispconfig.conf file did not show any new entries mentioning suPHP.

I am a little lost now, since I followed every single step of the instruction... Any idea what might be wrong?

Update: Tried it yet again. The Vhosts_ispconfig.conf now features the suPHP-Entries. However, when I know try to open a PHP website, I get an Internal Server Error (500).
__________________
Regards, Chrispix

Last edited by Chrispix; 17th July 2007 at 20:48.
Reply With Quote
  #20  
Old 18th July 2007, 18:26
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,711
Thanks: 1,899
Thanked 2,702 Times in 2,545 Posts
 
Default

Quote:
Originally Posted by Chrispix
Update: Tried it yet again. The Vhosts_ispconfig.conf now features the suPHP-Entries. However, when I know try to open a PHP website, I get an Internal Server Error (500).
Are there any errors in Apache's error log?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

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 02:43
Bind Failed christoph2k HOWTO-Related Questions 4 28th April 2007 00:57
Help....package missing sbovisjb1 Installation/Configuration 3 31st March 2006 11:14
suse 9.3 install: E: Couldn't find package ncftp aallen Installation/Configuration 4 26th January 2006 20:02
e-mail problem!!! Debian 3.1 maroonworks Installation/Configuration 18 6th December 2005 14:42


All times are GMT +2. The time now is 02:42.


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