Section Apache

Apache: Setting Up a Dedicated PHP Configuration per Vhost

Written by on 02/12/2015
Category:   Apache
Tags:   php.ini, php, bash, Apache, ubuntu, linux
This installation was tested on Ubuntu 15.01 but could be used for a debian production server. SuPhp has not been maintained for a few years now, so it is no longer in the repositories of recent distributions, and it has become difficult to compile it on a 4.x kernel (which is my case, since my transition to Ubuntu 15.10). Note: the package is still available on Ubuntu 14.01LTS. 1 – Installation of base packages. sudo apt-get install build-essential fakeroot dh-make debconf e...

Apache: PHP Directives in the .htaccess File

Written by on 15/05/2014
Category:   Apache
Tags:   .htaccess, Apache
Here is a non-exhaustive list of PHP directives that can be added to the .htaccess file: php_flag display_errors Off error_log = /path/filename php_value date.timezone 'Region/Zone' php_value max_execution_time 30 php_flag register_globals Off php_flag magic_quotes_gpc Off php_value upload_max_filesize 200M php_value post_max_size 200M php_value memory_limit 20M php_value max_input_vars 100

Apache: Enable Compression

Written by on 15/05/2014
Category:   Apache
Tags:   .htaccess, Apache
To enable compression in Apache, you have two options; The first is to insert the directives into the .htaccess file, and the second is to place these directives directly in the declaration of your vhost. <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^i...