apache

Server Optimization I - The Setup

The last weeks I investigated server side optimization (not application optimization) issues further because our Joomla based web portal scales quite poorly. The server is still sufficient for our current load but I want to have some more resources for usage peaks and future development. I thought it would be nice to share my thoughts and experiences as appropriate tutorials are scattered all over the web. I will describe the main steps in brief and will link to further documentation at the web if possible and needed.

So far so good. Currently our application uses the following server software:

  • Joomla 1.5 as web application
  • PHP 5.2 with ZendOptimizer 3.3 as our only must have PHP extension
  • Apache httpd 2.2 as web server
  • Varnish 2 as reverse caching proxy for Java and PHP apps.
  • MySQL 5.0 as database management system
  • Gentoo Linux as server OS

Our website makes intensive use of Joomla extensions. Some of them were developed by our own IT department. The start page is news oriented and contains several extensions and also many images. Apart from that we have quite a few registered users which use interactive parts of the site like forums or lotteries. Additionally some content of the site is only available to privileged users.

With this information you should have a rough overview of our web site and the application comprehending my optimization efforts. The next part of the series will contain information about bringing MySQL to speed.

Comments are as always welcome
Phillip

Apache document root RewriteRule error

While customizing this homepage I came across the following problem: I wanted to rewrite every request which accesses the root of this page to access the subfolder "drupal". This way t is possible to use "www.phillme.de" to see the blog and additionally allow subfolders on the same level as the "drupal" directory.

My first guess was to use the following in a .htaccess-file in the document root:

RewriteEngine on
RewriteRule	^/$	/drupal/

Sadly enough it did not work although the url rewriting guide of apache at http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html exactly mentions the same solution for a moved document root.

The solution described there is the following, which is very similar to my initial yet not working attempt:

RewriteEngine on
RewriteRule   ^/$  /about/  [R]

Of course I also tried the "[R]" for redirect with the same problem. The redirect was not triggered. Fortunately I found another site with "very common mistakes" about rewrite rules (http://rewriterule.alantait.com/4/). It mentions that the RewriteRule does NOT have the beginning "/" which transforms my initial solution to

RewriteEngine on
RewriteRule	^$	/drupal/

without the root slash and... finally it works.

I am wondering if this is an error in the apache documentation or if I just got something wrong. Maybe someone can brighten the for me. All others may consider the solution above ;-).

Syndicate content