User Tools

Site Tools


Steps to build a Wordpress server

  • Install Apache, PHP, and MySQL:
apt-get update
apt-get install apache2 libapache2-mod-php5 php5-gd php5-mysqlnd mysql-server

Enter MySQL root password twice

Run the MySQL secure installation script:


NOTE: Apache is configured to run as www-data in /etc/apache2/envvars:

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
  • Create empty MySQL database for Wordpress:
mysql -p
create database wordpress character set utf8;
create user 'wordpress'@'localhost' identified by 'secret';
grant all privileges on wordpress.* to 'wordpress'@'localhost';
  • Download and Extract Wordpress:
cd /var/www
tar xf latest.tar.gz
chown -R www-data:www-data wordpress
cd wordpress
  • Configure Apache:

If you want Wordpress to be your default site for the configured interface simply modify /etc/apache2/sites-enabled/000-default:

cp -p /etc/apache2/sites-available/default /etc/apache2/sites-available/default.orig
vi /etc/apache2/sites-enabled/000-default

If you already have a default site simply create a new vhost config file under /etc/apache2/sites-available/wordpress and run:

cp -p /etc/apache2/sites-available/default /etc/apache2/sites-available/wordpress
a2ensite wordpress
vi /etc/apache2/sites-enabled/wordpress
  • Change DocumentRoot and both <Directory> directives to use wordpress web-root
  • Add ServerName hostname.domain line
  • Remove cgi-bin ScriptAlias and <Directory /usr/lib/cgi-bin> directives
  • Change AllowOverride from None to all in <Directory /var/www/wordpress> directive

Enable Apache rewrite rules:

a2enmod rewrite
/etc/init.d/apache2 restart
  • Complete the installation:
  • Browse to the URL of the site
  • Click 'Create configuration file' → Click 'Let's Go'
  • Complete installation form and click 'Submit'
  • Click 'Run the install'
  • Give the site a name
  • Enter admin username and email address
  • Login
wiki/qclug_presentations/wordpress_install_guide.txt · Last modified: 2014/04/13 04:33 by root