7 November 2016

Wordpress on Ubuntu user edition

(Updated for Ubuntu 13.10)

Install LAMP

  1. sudo apt-get install tasksel
  2. sudo tasksel install lamp-server
  3. You may also want to install phpmyadmin, and I needed php-curl too
  4. Edit apache.conf to get rid of startup message, i.e.
    • Add ServerName localhost to apache.conf
(Along the way you'll need to add a root password for MySQL, and check that /etc/hosts has a good entry for your IP address so that Apache will run.)

Enable user directories in Apache

I set up my beta website in a home directory as it avoid lots of permissions issues. To turn on user directories:
  1. sudo a2enmod userdir
  2. Enable php in user directories: edit /etc/apache2/mods-enabled/php5.conf
  3. enable rewrite commands in .htaccess for nice permalinks: sudo a2enmod rewrite
  4. sudo service apache2 restart

Using a non-standard port

My ISP does not allow servers on port 80 but does permit them on other ports. Based on these instructions I

edit /etc/apache2/ports.conf to read:

Listen 80 
Listen 6111

create a new file in /etc/apache2/sites-available with the following content
<VirtualHost *:6111>
ServerAdmin webmaster@localhost
DocumentRoot /home/[name]/public_html
<Directory /home/[name]/public_html>
Options Indexes FollowSymLinks MultiViews
        AllowOverride All
         Order allow,deny
         allow from all
 Require all granted
</Directory>
</VirtualHost>
Listen 6111
  • And link this file to the sites-enabled directory
    • sudo ln -n sites-available/61112.conf sites-enabled/
(Tweak firewall if necessary, and recreate mysql user names with 'localhost' privileges.)

Additional steps


  1. Configure MySQL: (Re-)Create the database user, import the MySQL backup, and reattach privileges.
  2. Install Ruby via Software Centre
  3. Install compass (which installs Sass)
  4. Install sublime sass highlighting package controller

No comments: