Whatever you do, don’t panic!
Posts tagged apache
Installing php5-cgi on Debian
Jan 26th
For a long time I wanted to be able to run both PHP 4 and PHP 5 on the same server. Now I finally managed to come up with a solution that is easy to install and easy to use.
- Add the Debian Backports repository to your /etc/apt/sources.list
deb http://www.backports.org/debian/ sarge-backports main contrib non-free(on one line) - Issue a package update: aptitude update
- Install PHP 5 as CGI module: aptitude install php5-cgi
- Configure Apache by adding the following lines to your main config file. In my case this was /etc/apache2/apache2.conf
ScriptAlias /php5-cgi /usr/lib/cgi-bin/php5
Action php5-cgi /php5-cgi - Now find the Virtual Host you want to run on PHP 5 and simply put the following line into the <Directory> directive.
AddHandler php5-cgi .php
This overrides the default handler for files ending in .php which would be the normal PHP 4 module. Whit this directive it is now parsed and executed by the PHP 5 CGI binary. - Reload your webserver config with
/etc/init.d/apache2 reload
made my day
Mar 9th
i had a vision
someone should make an operating system with apache2 as the kernel and everything else implemented as mod_perl handlers.
Fixing non working Permalinks on WordPress
Jan 7th
After struggling almost one week to find the cause for my not entirely working Permalinks on this WordPress installation, I finally found the cure on the WordPress Codex. I already read this page about five times and I just can’t tell how this one paragraph could always slip away… anyway the solution is rather simple.
As I’m a decently paranoid Server Admin I once changed the way Apache reports it’s server software. This poses some troubles with WordPress which checks to see if the host is running Apache or IIS to determine wether to write a .htaccess file with some mod_rewrite rules or not. As WordPress can’t find out on it’s own on my host I just had to help it a little
In wp-includes/vars.php on line 40 is the check for the hosting webserver, I changed the entire line to read
$is_apache = 1;
After this small modification Worpress happily updatet the .htaccess file with the apropriate mod_rewrite rules (given the file permissions are correct on the server).
One small sidenote: If you are using FAlbum and have “friendly urls” enabled you have to make sure that the rewrite rules made by FAlbum are above the ones from WordPress.










