Archive for the ‘Uncategorized’ Category

Install WordPress on Ubuntu/Debian (or where’s my WordPress install and why isn’t it working)

Wednesday, January 5th, 2011

I recently wanted to play with a local instance of WordPress (I am running Ubuntu 10.04 i386, but this should apply to all Debian based distros). I already had apache2, mysql and php up and running so decided to just try:

sudo apt-get install wordpress

WordPress installed and everything looked promising. But I could not find a URL that worked, or any configuration files in the /etc/apache2/conf.d directory (where most web applications usually put them).

It turns out there are a few more manual steps required. Hopefully this will be automated on later packages, but it doesn’t hurt to understand what’s going on under the hood sometimes. There are two main steps that need to be done:

Create apache configuration

Following the examples of other web applications, we can create a file in /etc/apache2/conf.d called wordpress.conf. This file should have the following (or similar) content:

Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
</Directory>

You can change /blog to whatever you want your WordPress install to be served under. As it is, you will find it at http://localhost/blog. Following this, restart apache to load the new configuration.

sudo /etc/init.d/apache2 restart

Run the mysql setup script

Next we need to run the setup-mysql script to create the right database users, tables etc. To do this, change directory to the /usr/share/doc/wordpress/examples folder where you will find the setup-mysql script. If you run:

sudo bash setup-mysql

you will get a simple explanation of how to use the script, as shown below:

setup-mysql [-n NAME] [-h | -d | -b] FQDN

Creates by default a WordPress mysql configuration depending on required fully
qualified domain name(FQDN).

Options:
-n name for the mysql user and database
-h help
-d destroy and purge
-b backup

Example: You want your blog to be served from http://blog.example.com
for user ‘wordpress’.

Then run:
sudo bash setup-mysql -n wordpress blog.example.com

Following this lead, you can just run:

sudo bash setup-mysql -n wordpress localhost

Assuming everything works without issues, navigate to http://localhost/blog and step through the 1 step process of the WordPress web based setup.

Fix for Marvell SATA/IDE controller on Debian

Thursday, October 23rd, 2008

I recently purchased an ASUS P5Q-PRO motherboard to use as a basis for an upgrade to my home server.  Unfortunately I had not done my research and ran into some issues with installing and running Linux.  Most of these issues revolved around the fact that ASUS had implemented IDE using the Marvell 88SE6111 controller.

Installation issues

Initially, booting up off the Debian netinst CD, everything seemed fine, but once I got to the CD drive detection stage the installer threw an error: “No common CD-ROM drive was detected“.  I tried manually with the CD drivers on offer from the installer but had no luck.

Whilst I was a little concerned for the future of this motherboard, I thought that once it was up a running there would probably be a fix available somewhere for this problem.  So to get to that point I decided to install Debian from a flash disk – this worked fine (there are plenty of guides available to show you how to do this, or you can check out my previous post Installing Debian from a USB Flash Disk).

Still no IDE

I now had a new Debian Lenny system up and running, but unfortunately my only optical drive (being IDE) was not working at all.  I was aware that the module I needed for this controller was pata_marvell and performing the following command confirmed it was already loaded.

lsmod | grep marvell

Solution

In the end the solution to this issue was quite simple.  Whilst I had the right module installed and loaded, the order in which it was loading was the issue.  The fix was to have the pata_marvell module load up before the ahci module.  To do this we need to perform two small tasks (as root).

First we need to edit:

/etc/initramfstools.d/modules

To the bottom of this file add the following lines:

pata_marvell
ahci

With this file updated, we need to update our initramfs, this can be done with the following command:

update-initramfs -k all -u

This will update all the kernel options you currently have on your system.  With that done, reboot and check if you have your IDE devices available.  My DVD drive showed up as /dev/scd0.

Whilst I couldn’t find this complete solution in one place, the combination of the following websites allowed me to piece it together:

http://fixunix.com/debian/542307-bug-493657-workaround-2-6-25-2-6-26-marvell-88se6121-88se6145-pata_marvell-ahci-regression.html
http://www.gossamer-threads.com/lists/linux/kernel/968813
http://www.linuxquestions.org/questions/linux-general-1/module-load-order.-648599/