Ubuntu Linux 6.10 WordPress Installation Walkthrough
Hey everyone. I just got WordPress up and running on my Ubuntu Linux system, and so I thought my first blog post might as well be a walkthrough on how I got it working. I’m writing this because I couldn’t find a similar walkthrough anywhere else online. Let’s begin!
[Update 2007-08-21: This works under Ubuntu 7.04 Feisty Fawn as well.]
You should already have Apache, MySQL, and PHP installed (a typical LAMP setup). If you don’t have those installed yet, there are plenty of tutorials out there that will help you install them. Note that this walkthrough will probably also work for recent versions of Debian Linux (the distro that Ubuntu is based on).
The first thing to do is to install the wordpress package using apt-get.
apt-get install wordpress
If you get an error message that the package wordpress cannot be found, it is most likely because you do not have multiverse servers enabled for apt-get. Here’s how to add them. First, edit /etc/apt/sources.list
sudo nano /etc/apt/sources.list
Add the following two lines (it doesn’t particularly matter where you add them, or even if you have duplicate lines).
deb http://us.archive.ubuntu.com/ubuntu/ edgy main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ edgy main restricted universe multiverse
Now tell apt-get to update its package list and you should be able to find wordpress.
sudo apt-get update
Okay, WordPress is now installed. Next we have to configure Apache to tell it about WordPress.
sudo nano /etc/apache2/apache2.conf
At the bottom of the file add the following lines:
Alias /blog /usr/share/wordpress
<Directory /usr/share/wordpress>
Options FollowSymLinks
AllowOverride Limit Options FileInfo
DirectoryIndex index.php
</Directory>
This will install WordPress to http://yourdomain.com/blog/. If you want it to go somewhere else, just adjust the path accordingly.
Now we have to tell Apache to reload its configuration files.
sudo /etc/init.d/apache2 reload
Next, we are going to create a database in MySQL for WordPress to use. First, login to MySQL.
mysql -u root -p
If you have never used MySQL before, the default root password is blank. Now would be a good time to set one.
Next we are going to create a database for WordPress to use. I’m going to be very imaginative and name the database “wordpress”.
mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0.00 sec)
Now we have to create a database user for wordpress. This part is important; you could just use the same user for all of your applications, but if something went wrong, you could lose all of your data. By creating a separate MySQL user for each application, you are limiting your damage. I’m going to be imaginative again and choose the name “wordpress_user” for the WordPress database user account. You might want to pick a better password than fluffy; that’s simply what I’m using for this demonstration.
mysql> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress_user'@'localhost' IDENTIFIED BY 'fluffy' WITH GRANT OPTION;
Query OK, 0 rows affected (0.00 sec)
Now let’s make sure that these changes took:
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
We are done with MySQL now, so let’s quit.
mysql> quit;
Bye
Next we are going to modify WordPress’s configuration file to tell it about the database and user we just created for it. But first, we have to deal with a little idiosyncrasy. The Ubuntu WordPress package creates a symbolic link to /etc/wordpress/ for its configuration file, but we aren’t going to be using anything in /etc/ for our installation. So first, get rid of the symbolic link. Don’t worry, this is just deleting a link, it’s not actually deleting any files. The default wp-config.php will remain in /etc/wordpress/ if you really want it.
sudo rm /usr/share/wordpress/wp-config.php
Now copy the sample configuration over to the main configuration location.
sudo cp /usr/share/wordpress/wp-config-sample.php /usr/share/wordpress/wp-config.php
Now let’s edit the configuration.
sudo nano /usr/share/wordpress/wp-config.php
Remember the database name, user account, and password that we just set in MySQL? We are going to input these into the configuration file and save it.
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'wordpress_user'); // Your MySQL username
define('DB_PASSWORD', 'fluffy'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
We’re almost done. Now we just use WordPress’s built-in installation script. Go to http://yourdomain.com/blog/wp-admin/install.php and follow the directions. Write down the auto-generated password it gives you.
Now we’re going to login to WordPress. Go to http://yourdomain.com/blog/wp-login.php and login with the account ‘admin’ and the password you just wrote down. Now everything is working! The first thing you should do is change the password to the admin account. This option can be accessed from the “Users” tab along the top of the screen.
We have one more thing to do. We’re going to install a plugin for WordPress called “Spam Karma”. This plugin will defend your site from comment spam, which is a much bigger problem than you’d realize, especially if your site starts getting really popular. Luckily, it’s very easy to install the plugin. Go to the plugins directory, download the plugin using wget, and unzip it.
cd /usr/share/wordpress/wp-content/plugins/
sudo wget http://wp-plugins.net/sk2/sk2_final.zip
sudo unzip sk2_final.zip
Now, go back into the admin console of your blog, go to the Plugins tab, and click on the Activate button next to Spam Karma.
That’s it; you’re done! Try writing your first post on WordPress, or configure your site’s look and feel.
December 15th, 2006 at 22:43
If there’s anything wrong with the walkthrough, please tell me and I will fix it.
March 10th, 2007 at 06:16
Thanks for this short tutorial. It helped me with installation on ubuntu 6.10. :D
Regards.
March 10th, 2007 at 17:15
Pierwszy post…
Jako że dopiero co postawiłem WordPressa na moim serwerku czas nadszedł na pierwszy wpis na nowym blogu. Przy okazji testuję szablony… i chyba właśnie wybrałem szablon Glossy 1.3 ze stajni N Design Studio.
Okazuje się, że postawienie Wo…
March 21st, 2007 at 22:52
Thanks much for the walkthrough – very clear and easy to follow and nice you caught the little config file issue. Helped me alot.
April 10th, 2007 at 02:20
No problems here as well. Thanks for writing this up!
April 10th, 2007 at 11:10
Nice. Thank you very much.
June 22nd, 2007 at 06:52
Your tutorial was really helpful. It is written in a very simple and informative way.
Thanks again.
July 9th, 2007 at 14:29
Thanks for the tutorial. Very usefull!
P.S.
It works also on Ubuntu 7.04 Feisty
August 21st, 2007 at 00:40
handy info – thanks
February 25th, 2008 at 09:45
Wow great site! Some really helpful information there.
I’m sorry for little off-topic, but I want to ask you about design of this site.
Did you make this template yourself or got from any templates website?
Looks pretty cool for me. Wonderful well this reading.
February 25th, 2008 at 10:14
Thanks for the compliments John Svid. This post contains more information on this theme. Long story short, it’s not officially available anywhere, it’s just been passed down from one person to the next, with modifications each generation. We probably should all get together and release if officially.
February 28th, 2008 at 08:27
[...] up about 6 am. Worked on getting WordPress easy photos to work. I seen that you can do a apt-get install wordpress I did that. Made the file it said in /etc/apache2/apache2.conf. Copyed wp_config.php to the new [...]
February 28th, 2008 at 17:09
[...] up about 6 am. Worked on getting WordPress easy photos to work. I seen that you can do a apt-get install wordpress I did that. Made the file it said in /etc/apache2/apache2.conf. Copyed wp_config.php to the new [...]
February 28th, 2008 at 17:52
They don’t keep it up to date good. I moved my WordPress from /var/www to /usr/share and installed this with apt-get install wordpress but it installed a 2.2.2 one and they have 2.2.3 out now. It says to update it right on the main log in page.
I could not get it working with my Data base so I used svn command to get it:
mkdir /usr/share/wordpress
cd /usr/share/wordpress
svn co http://svn.automattic.com/wordpress/trunk/ .
It installed a bata one. But it’s working real good for now. It had to update my data base then all worked right. I had to edit the data base before I did the upgrade link to cheange links in wp2_options in database WordPress.
This looks like a better way to keep it up to day then the apt-get install wordpress
But because of that I found were it should be installed in /usr/share/wordpress
-Raymond Day
February 28th, 2008 at 18:12
Instead of checking out from SVN (which may not always yield a stable version, or one that is compatible with all plugins), I would just download the latest version directly from wordpress.org. Most of the tutorial in my post still applies; simply swap out the apt-get step with downloading and unpacking this archive.
March 5th, 2008 at 02:41
Concise writeup! Worked beautifully.
Thanks!
March 7th, 2008 at 18:15
[...] cat did the other day is a lot less interesting and useful than a comprehensive tutorial on, say, installing WordPress on Ubuntu Linux. Put yourself in your readers’ shoes and honestly ask yourself if anyone would be interested [...]
May 3rd, 2008 at 06:27
Great tutorial! blogging away in minutes, thanks.
May 3rd, 2008 at 21:39
Thanks Zak, glad to hear that the tutorial is still accurate.
July 7th, 2008 at 06:57
Using linux ubuntu installation from Webfusion host
Installing wordpress and have used the following webpage tutorial
http://www.cydeweys.com/blog/2006/12/15/ubuntu-linux-610-wordpress-installation-walkthrough/
All seems to work fine however when access the install.php file via the web browser I get the following error
UID of script “/usr/share/wordpress/wp-admin/install.php” is smaller than min_uid
July 17th, 2008 at 14:42
Just wanted to say thanks for this awesome tutorial. It really helped me out, considering I had NO idea how to even start making a mysql database, and then didn’t understand what that symbolic link nonsense was all about. So, thanks!
September 25th, 2008 at 10:48
[...] się, że postawienie WordPressa to dziecinnie prosta sprawa. Skorzystałem z tutoriala zamieszczonego na blogu Cyde Weys Musings (po [...]
November 18th, 2009 at 13:48
Thanks! It works!
http://ec2-174-129-53-160.compute-1.amazonaws.com/blog/