-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I am looking to set up a CentOS server for hosting a high traffic PHP site (specifically Drupal 6).
I am trying to figure out what's the best way of setting up PHP. The standard mod_php seems to not be a good solution, as it requires apache to be in the prefork configuration, due to PHP not being thread safe.
Something like mod_fcgi seems to be the way to go, but I can't seem to find a good guide on setting it up.
I installed Zend Server, but seems like they are only supporting FastCGI for Apache on Windows, and only mod_php on Linux.
Their admin control panel is using lighttpd and mod_fcgi on Linux. I getting it to work with Apache, but am having issues with the missing mysqli libraries.
Is it recommended to use mod_fcgi on CentOS? Is there a way to get it to work with Zend Server?
If not, should I try to get things working with lighttpd? I'm not sure how easy it would be to set up a config to work with Drupal.
Russ
On Fri, 17 Dec 2010 19:09:44 -0500 Ruslan Sivak russ@vshift.com wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I am looking to set up a CentOS server for hosting a high traffic PHP site (specifically Drupal 6).
I am trying to figure out what's the best way of setting up PHP. The standard mod_php seems to not be a good solution, as it requires apache to be in the prefork configuration, due to PHP not being thread safe.
Something like mod_fcgi seems to be the way to go, but I can't seem to find a good guide on setting it up.
I installed Zend Server, but seems like they are only supporting FastCGI for Apache on Windows, and only mod_php on Linux.
Their admin control panel is using lighttpd and mod_fcgi on Linux. I getting it to work with Apache, but am having issues with the missing mysqli libraries.
Is it recommended to use mod_fcgi on CentOS? Is there a way to get it to work with Zend Server?
If not, should I try to get things working with lighttpd? I'm not sure how easy it would be to set up a config to work with Drupal.
I have a Drupal website, and I originally set up my site running on localhost on my laptop using lighttpd, it worked fine for a localhost. At the time my 'live' site was hosted by an outfit that was using IIS, I'm now with a host that uses RHEL 5 and Apache. And I currently use Apache as my localhost server also; since I decided to set up a few virtual hosts for testing and they were much easier to figure out how to make it work on Apache than lighttpd. (Maybe because there were more examples online. )
This is the tutorial I used for my first setup with lighttpd, and though it's a bit dated it's still workable. It came up as the third result when I just searched install lighttpd and php: http://www.howtoforge.com/lighttpd_php5_mysql_fedora7
I've never actually configured php, I just install the files (including php-mbstring), and create a user for mysql and extract the Drupal files to the docroot and I'm good to go. If it's a high-traffic site others may have more specifics about php to add... for me the defaults have worked fine. HTH.
On 12/17/10 9:30 AM, Cia Watson wrote:
I've never actually configured php, I just install the files (including php-mbstring), and create a user for mysql and extract the Drupal files to the docroot and I'm good to go. If it's a high-traffic site others may have more specifics about php to add... for me the defaults have worked fine. HTH.
drupal really hammers on your database too. you need a well tuned and optimized mysql or postgres configuration to run it, and you likely want to use some form of SQL cache (memcached etc), since drupal will make the same queries over and over and over again.
On Fri, 17 Dec 2010, John R Pierce wrote:
To: CentOS mailing list centos@centos.org From: John R Pierce pierce@hogranch.com Subject: Re: [CentOS] Best way to set up for PHP websites
On 12/17/10 9:30 AM, Cia Watson wrote:
I've never actually configured php, I just install the files (including php-mbstring), and create a user for mysql and extract the Drupal files to the docroot and I'm good to go. If it's a high-traffic site others may have more specifics about php to add... for me the defaults have worked fine. HTH.
drupal really hammers on your database too. you need a well tuned and optimized mysql or postgres configuration to run it, and you likely want to use some form of SQL cache (memcached etc), since drupal will make the same queries over and over and over again.
This is not FOSS stuff, but something like ioncube might help you speed things up.
http://www.ioncube.com/comments.php
HTH
Keith Roberts
This is not FOSS stuff, but something like ioncube might help you speed things up.
http://www.ioncube.com/comments.php
HTH
You can also use xCache, we've had dramatsic performance improvement with it. From .12 s page load tome to 0.007 for some case. It was not druppal, but our own code tough.
Am 18.12.2010 um 01:09 schrieb Ruslan Sivak:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I am looking to set up a CentOS server for hosting a high traffic PHP site (specifically Drupal 6).
AFAIK, the optimal solution is to run the latest php5.3-series as php- fpm with NGINX. It offers the best performance for the dynamic part.
If you got it working, research about using varnish http cache in front of Drupal.
High-traffic sites with Drupal require significant effort and a deep understanding of the inner workings of Drupal and the modules and extensions you use.
And unless there's repository out there that has all this for CentOS, it may not be the right platform.
Rainer
Is there a how-to somewhere on getting php running with nginx? I would love to get that working.
I am already planning on using nginx as a front end to varnish for compression, and varnish for caching and load balancing. I just really want to get good performance out of the dynamic php part and mod_php isn't it. I considered using quercus for a while, but it doesn't seem to work properly with drupal.
Russ On Dec 17, 2010 7:43 PM, "Rainer Duffner" rainer@ultra-secure.de wrote:
Am 18.12.2010 um 01:09 schrieb Ruslan Sivak:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
I am looking to set up a CentOS server for hosting a high traffic PHP site (specifically Drupal 6).
AFAIK, the optimal solution is to run the latest php5.3-series as php- fpm with NGINX. It offers the best performance for the dynamic part.
If you got it working, research about using varnish http cache in front of Drupal.
High-traffic sites with Drupal require significant effort and a deep understanding of the inner workings of Drupal and the modules and extensions you use.
And unless there's repository out there that has all this for CentOS, it may not be the right platform.
Rainer _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Is there a how-to somewhere on getting php running with nginx? I would love to get that working.
http://wiki.nginx.org/PHPFcgiExample
We have around a dozen systems running in this configuration and it works well. They are among our lowest maintenance and highest performing sites that we have. Note that there is an fcgi package available (in EPEL, possibly also in rpmforge) which takes care of most of the configuration for you. You primarily need to pay attention to the nginx config and then make sure the fcgi service is running.
Good luck.
Am 18.12.2010 um 02:12 schrieb Ruslan Sivak:
Is there a how-to somewhere on getting php running with nginx? I would love to get that working.
You need to compile php with fpm support. Then, in nginx, you basically say:
server { listen *:80; server_name www.domain.com;
location / { root /home/domain/FTPROOT/htdocs; index index.php index.htm index.html;
# if file exists return it right away if (-f $request_filename) { break; }
if ($request_uri ~ '^/(typo3(/|conf|temp)| fileadmin|uploads|t3lib|clear.gif|index.php|favicon.ico)') { break; } # otherwise rewrite it; if (!-e $request_filename) { rewrite ^(.+)$ /index.php last; # rewrite .* /index.php last; break; }
}
# if the request starts with our frontcontroller, pass it on to fastcgi location ~ .php$ { fastcgi_pass unix:/var/run/php-fpm-domain.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /htdocs $fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include /usr/local/etc/nginx/fastcgi_params; fastcgi_param DOCUMENT_ROOT /htdocs/ ; } }
The php-fpm mailinglist is a good start for question regarding this topic. I don't know about memcache, but it's surely a good idea.
With varnish, you have to be very careful because it doesn't cache sites with cookies. Different drupal-modules and extensions will create their own cookies and so almost nothing will cache.
Probably, the people at http://groups.drupal.org/nginx
know more about this than me anyway.
Rainer