Ubuntu articles

LAMP config settings

These are my development LAMP (Linux/Apache/MySQL/Php) settings. They are not meant for production. These settings are for really sub-optimal code which takes ages to parse and execute and accepts crazily insane amounts of input and POST data. You probably don't want to expose a server like this to the jungle which is the Internet :P

So as they commonly say, YMMV (Your Mileage May Vary). Yeah, I was looking forward to end up a sentence with it. I'm just going to do it again: YMMV.

Packages to install


  • apache2
  • libapache2-mod-php5
  • php-pear
  • php5-cli
  • php5-gd
  • php5-mysql
  • phpmyadmin

Apache

/etc/apache2/sites-available/default

should have AllowOverride All in Directory /var/www Diff: 1d0 < NameVirtualHost * 12c11 < AllowOverride All --- > AllowOverride None

Enable mod_rewrite

sudo a2enmod rewrite

php

php.ini settings

/etc/php5/apache2/php.ini diff:


267,268c267,268
< max_execution_time = 300     ; Maximum execution time of each script, in seconds
< max_input_time = 300 ; Maximum amount of time each script may spend parsing request data
---
> max_execution_time = 30     ; Maximum execution time of each script, in seconds
> max_input_time = 60 ; Maximum amount of time each script may spend parsing request data
270c270
< memory_limit = 128M      ; Maximum amount of memory a script may consume (16MB)
---
> memory_limit = 16M      ; Maximum amount of memory a script may consume (16MB)
451c451
< post_max_size = 128M
---
> post_max_size = 8M
565c565
< upload_max_filesize = 128M
---
> upload_max_filesize = 2M