Minimal How to Setup LAMP Web Server


Apache 2.0

Install Apache from Debian stable:

apt-get install apache2

Apache is ready and running. Test that it is workin by pointing browser to Read Apache’s security tips.

Apache’s files and directories are:

  • /etc/apache2/sites-available/ Your virtual domain configuration.
  • /etc/apache2/sites-enabled/ Symlink to you configuration, when site is enabled with a2ensite command.
  • /var/log/apache2/: Logs.
  • /var/www/ Your site.

Install Cronolog:

apt-get install cronolog

Make your sites configuration file in /etc/apache2/sites-available/

  ServerAdmin [email protected]
  DocumentRoot /var/www/
  ErrorLog "|/usr/bin/cronolog /var/log/apache2/%Y/"
  CustomLog "|/usr/bin/cronolog /var/log/apache2/%Y/%Y-%m-mysite-com-access.log" combined

Make /var/www/ directory for your sites files. Enable your sites configuration file:


Reload Apache:

/etc/init.d/apache2 reload

If you for some reason want to remove the site from Apache configuration:


More about installing Apache.


PHP 5.1

In order to use apt-get to install PHP 5, you need to add one of the mirrors to /etc/apt/sources.list, like:

deb stable all

And istall PHP:

apt-get update
apt-get install libapache2-mod-php5

Php.ini is in /etc/php5/apache2/php.ini and recommended .ini is in /usr/share/doc/php5-common/examples/php.ini-recommended.

More about installing PHP.


MySQL 5.0

Install MySQL also from as PHP:

apt-get install mysql-server
apt-get install php5-mysql

More about installing MySQL.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top