SuperMike
November 22nd, 2009, 08:58 PM
You may want to have an Apache configuration for your website where there is a difference between development and production. I mean, think of it -- one code base, but then it acts differently on URL and database connections depending on whether it is production or development. The trick can be to delineate this in your .htaccess file. You can do this with the IfDefine directive, like so:
<IfDefine dev>
# code goes here
</IfDefine>
<IfDefine !dev>
# code goes here
</IfDefine>
Trouble is, there's no clear documentation where to stick this variable assignment.
Well, I have just solved this problem. You need to edit this file:
/etc/apache2/envars
At the bottom of it, add:
export APACHE_ARGUMENTS="-D dev"
Now bounce your Apache server like so:
sudo /etc/init.d/apache2 stop
...wait 5 seconds
sudo /etc/init.d/apache2 start
<IfDefine dev>
# code goes here
</IfDefine>
<IfDefine !dev>
# code goes here
</IfDefine>
Trouble is, there's no clear documentation where to stick this variable assignment.
Well, I have just solved this problem. You need to edit this file:
/etc/apache2/envars
At the bottom of it, add:
export APACHE_ARGUMENTS="-D dev"
Now bounce your Apache server like so:
sudo /etc/init.d/apache2 stop
...wait 5 seconds
sudo /etc/init.d/apache2 start