fd Blog

Daniel Hilgarth on software development

Prepare Ubuntu for Wordpress Installation

These instructions detail how to prepare a new Ubuntu 14.04 LTS server for a Wordpress installation.

Install Apache

sudo apt-get install apach2

Install PHP

sudo apt-get install libapache2-mod-php5

Install MySQL

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

Configure Apache

## Enable PHP

sudo a2enmod php5

Improve security

Disable sending Apache and Ubuntu version

sudo nano /etc/apache2/conf-enabled/security.conf

Change ServerSignature and ServerTokens to these values:

ServerSignature Off
ServerTokens Prod

Disable directory listing

sudo nano /etc/apache2/apache2.conf

Find the entry Options Indexes FollowSymLinks directly beneath <Directory /var/www/>. Change it to:

Options -Indexes +FollowSymLinks

Restrict access to directories

sudo nano /etc/apache2/conf-enabled/security.conf

Activate these lines by uncommenting them:

<Directory />
   AllowOverride None
   Order Deny,Allow
   Deny from all

Disable unnecessary modules

sudo a2dismod autoindex
sudo a2dismod status
sudo a2dismod include

Disable default sites

sudo a2dissite 000-default
sudo a2dissite default-ssl

Restart Apache

sudo service apache2 restart


  • http://www.tecmint.com/apache-security-tips/