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

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 1st September 2009, 23:05
voidzero voidzero is offline
HowtoForge Supporter
 
Join Date: Mar 2009
Posts: 63
Thanks: 11
Thanked 3 Times in 3 Posts
Lightbulb Wordpress, permissions, mod-php, suphp

Hello,

On one of my sites I'm running Wordpress. It is also configured with an FTP user.
Wordpress has the ability to update files from its admin panel. But here's the problem: suPHP is much slower than Mod_PHP. Mod_PHP is much faster, but it runs everything as user www-data! So when using mod-php I have to chmod the dir to www-data:www-data and everything runs fast BUT I can't update the software and I can't login with FTP, but with Suphp the site is so slow that it actually locks down....

Guys, I need your advice on this! What should I do?

Thanks!
Mark

Last edited by voidzero; 10th December 2009 at 15:24.
Reply With Quote
Sponsored Links
  #2  
Old 3rd September 2009, 10:49
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,504
Thanks: 813
Thanked 5,266 Times in 4,129 Posts
Default

Use php-fcgi + suexec.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 3rd September 2009, 13:01
voidzero voidzero is offline
HowtoForge Supporter
 
Join Date: Mar 2009
Posts: 63
Thanks: 11
Thanked 3 Times in 3 Posts
Default

Well that's still using php-cgi and it's still too slow!

But I have solved it in a different way: by using ACL.
The webroots of these sites are set to user:group www-data:www-data with an ACL entry u:web29:rwX,g:client5:rX and it includes a default.

What I did was, I created a script to do all of this for me hourly through a cronjob. Here it is, I hope it will benefit others with the same problem:

Code:
#!/bin/bash
# Fix permissions for webroots that are using mod-php and wordpress.

chown -R www-data:www-data /var/www/site.org/web
setfacl -bR /var/www/site.org/web
setfacl -Rm u:web29:rwX,g:client5:rX,d:u:web29:rwX,d:g:client5:rX /var/www/site.org/web

# Repeat this for all the sites that need it. Crontab it for your own convenience.
# New files will automagically inherit these permissions.
Reply With Quote
  #4  
Old 3rd September 2009, 13:05
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,504
Thanks: 813
Thanked 5,266 Times in 4,129 Posts
Default

Quote:
Well that's still using php-cgi and it's still too slow!
No, it is not using php as cgi if you selected fcgi. How do you know that its using php-cgi, as phpinfo is always showing identical results for cgi and fcgi. if you want to test it, you will have to check it with ps aux. fcgi is as fast as mod_php, you can test it with apache bench. Also be aware that you have to wait a minute until you test again.

So the solution is still to use php-fcgi, you hack is not nescessary and its highly recommended to not use it!

To further speed up php scripts, intall eaccelerator or xcache.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 5th September 2009, 14:40
voidzero voidzero is offline
HowtoForge Supporter
 
Join Date: Mar 2009
Posts: 63
Thanks: 11
Thanked 3 Times in 3 Posts
Cool

Quote:
Originally Posted by till View Post
No, it is not using php as cgi if you selected fcgi. How do you know that its using php-cgi, as phpinfo is always showing identical results for cgi and fcgi. if you want to test it, you will have to check it with ps aux. fcgi is as fast as mod_php, you can test it with apache bench. Also be aware that you have to wait a minute until you test again.
Just to be sure.. we are talking about Fast-CGI here?

Quote:
Originally Posted by till View Post
So the solution is still to use php-fcgi, you hack is not nescessary and its highly recommended to not use it!

To further speed up php scripts, intall eaccelerator or xcache.
I will try that out. I was using memcache/memcached, which one would you recommend out of the two you mentioned? Thanks for the help - to me this part of ispconfig is still a bit new.
Reply With Quote
  #6  
Old 6th September 2009, 10:13
Reginald Reginald is offline
Junior Member
 
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try to install apache2-mpm-itk +mod_php and configure the creation of new sites.
see http://www.howtoforge.com/forums/showthread.php?t=25918 for more details
Reply With Quote
  #7  
Old 6th September 2009, 19:14
voidzero voidzero is offline
HowtoForge Supporter
 
Join Date: Mar 2009
Posts: 63
Thanks: 11
Thanked 3 Times in 3 Posts
Default

Quote:
Originally Posted by till View Post
No, it is not using php as cgi if you selected fcgi. How do you know that its using php-cgi, as phpinfo is always showing identical results for cgi and fcgi.
From top:
14023 web28 20 0 123m 53m 26m S 6.7 2.6 0:03.26 /usr/bin/php-cgi

This is what I meant with 'still using cgi' - I selected FastCGI so that's why I wanted to make sure that we are talking about the same thing.. are we?
Reply With Quote
  #8  
Old 7th September 2009, 08:56
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 35,504
Thanks: 813
Thanked 5,266 Times in 4,129 Posts
Default

Quote:
Just to be sure.. we are talking about Fast-CGI here?
Yes.

Quote:
From top:
14023 web28 20 0 123m 53m 26m S 6.7 2.6 0:03.26 /usr/bin/php-cgi

This is what I meant with 'still using cgi' - I selected FastCGI so that's why I wanted to make sure that we are talking about the same thing.. are we?
Thats the binary which is used by fastcgi and cgi, ss the above line does NOT maen that it is running as cgi!

Ify ou want to know if it is running as cgi or fastcgi, just look in the vhost configuration file.

Quote:
I will try that out. I was using memcache/memcached, which one would you recommend out of the two you mentioned? Thanks for the help - to me this part of ispconfig is still a bit new.
memcache is someting different, it is a fast object cache and does not speed up the processing of php code.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Tags
mod-php, permissions, suphp, wordpress

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
ffmpeg Video support for ubuntu 7.10 [suphp-ispconfig] amaurib Installation/Configuration 13 16th February 2010 17:26
Unable to install ISPConfig bdonecker Installation/Configuration 21 26th May 2009 08:20
ISP Config hesitation when opening web pages frankb Installation/Configuration 7 15th December 2008 13:06
ispconfig php 5 errors itamarjp Installation/Configuration 8 25th April 2008 10:20
Apache2 Freezes celtic Server Operation 31 28th May 2007 17:18


All times are GMT +2. The time now is 14:36.


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