Steve’s Ubuntu Weblog

Mainly (but not only) about Ubuntu

Setting up WordPress on a Ubuntu server

This is meant to give an easy to understand description of how I got WordPress working under Ubuntu Dapper Drake. It is not meant to be an in-depth explanation of how to set up WordPress, it is just how I got things running and I hope it will help others who have the same problems that I had.

First check that Apache and PHP5 are working by typing the following in a terminal

sudo sh -c "echo '<?php phpinfo(); ?>' > /var/www/info.php"

and then pointing your browser at http://localhost/info.php to see a page showing your installed PHP version.

If PHP is working then install WordPress with Synaptic, if it isn’t you need to set up your server correctly.

After installing WordPress make a backup of your Apache configuration file with

sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf.bak

Now you need to edit your Apache configuration file with

gksudo gedit /etc/apache2/apache2.conf

and paste the following block of code directly after where Alias/icons is defined.

Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>

Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
</Directory>

Restart Apache with -

sudo /etc/init.d/apache2 restart

Now you are ready to run the configuration script to make a database and set up connection with -

sudo sh /usr/share/doc/wordpress/examples/setup-mysql -n wordpress localhost

Where wordpress is the name of the user and the database. If your server has a virtual host name you should use that instead of localhost. In either case there will be an error message saying that a symbolic link could not be made because no such file or direcrory exists but this message can be ignored.

Now point your browser at http://localhost/blog and WordPress will walk you throgh the rest of the setup.

4 January, 2007 - Posted by steveyoung | Ubuntu | | No Comments Yet

No comments yet.

Leave a comment