Custom php.ini and URL rewriting in Plesk 9 with fastcgi
Thursday, March 19th, 2009For a current hosting server I’m using the Plesk control panel 9.0.1 for Ubuntu 8.04. Since version 9 Plesk allows the usage of Postfix as an MTA and PHP via FastCGI. This is very nice and much more secure than the old model using mod_php.
The Problem
One problem with the current Plesk version (as with most Plesk versions :/) is that it has some nasty bugs. For example mod_rewrite doesn’t work with the FastCGI configuration. The problem is that the generated virtual host configuration has a small but important problem. The generated host looks something like this:
<VirtualHost 88.198.164.10:80>
ServerName playground.himberger.de:80
ServerAlias www.playground.himberger.de
<IfModule mod_fcgid.c>
<Files ~ (\.php)>
SetHandler fcgid-script
FCGIWrapper /usr/bin/php5-cgi .php
Options ExecCGI
allow from all
</Files>
</IfModule>
</VirtualHost>
The issue with this configuration is the line “Options ExecCGI“. This line enables the execution of CGI scripts for this particular directory but overrides all the Options set earlier. These are in parts needed for mod_rewrite. To fix this the line should be “Options +ExecCGI“. Sadly changing the configuration doesn’t help because at the next opportunity Plesk will regenerate the config file and your change is gone.
Luckily there is a way around this…

As you may remember from my last blogpost I’m currently setting up a new hosting Server. Since this server will also host some 