Sunday, May 12, 2013

Installing WordPress on Ubuntu (with MySQL and PHP)


This is a list of commands to install WordPress on Ubuntu.

Install PHP5 and MySQL server:
 $ sudo apt-get install php5-cli

 $ sudo apt-get install mysql-server
 $ sudo apt-get install mysql-client-core-5.5

 $ sudo apt-get install apache2
 $ sudo apt-get install libapache2-mod-php5
 $ sudo apt-get install php5-mysql

 $ sudo /etc/init.d/apache2 restart


Download the latest WordPress package:

 $ wget http://wordpress.org/latest.tar.gz
 $ tar xvfz latest.tar.gz
 $ ls wordpress

Edit wp-config.php to set the database name, database user name, database password, database host:

Create a database, for example, using the mysql command line interface:

 $ mysql -u adminusername -p
 Enter password: your-admin-user-password
 mysql > create database databasename;
 mysql > grant all privileges on databasename.* to "wordpressusername"@"hostname" identified by "password"
 mysql > flush privileges;
 mysql > exit

Copy the wordpress package to the web site:

 $ mkdir /var/www/blog
 $ cp -Rf wordpress /var/www/blog/

Use any browser to browse http://localhost/blog/:


I'll update this page soon.