The (relatively new) company I work for, is going to need a website. As the IT guy, it’s my job to set up and design this website. Pure HTML/CSS is kind of old school, and I don’t like utilities like iWeb. I guess I’ll always be a command-line guy, even if my primary computer is now a Mac. What I do like, however, is WordPress. After going to Wordcamp Montreal a few days ago, I’ve learned about a few new options for our little company, one of which is WordPress Multi User.
I decided to use WP-MU because I like the idea that each of the three people in our company (small indeed, and, in fact, a mother, father and son trio) can have blogs of their own, but at the same time we can have the Main company page/pages and blog. Furthermore, this is all managed through a simple interface.
So I’ll walk you through some of the troubles I ran into, knowing no SQL commands, or what packages to install. First, I’m serving the test site on an old computer running Ubuntu 9.04, and I’ve connected to it via ssh. Here are the packages you’ll need:
- vsftpd – for ftp connection, if you want to administrate remotely
- openssh-server – for the ssh connection
- apache2 – the web server. Files are stored in /var/www (on Ubuntu, at least)
If you want to work on the same machine that’s serving the content, that’s fine, and you won’t need vsftpd or openssh-server. sshd and vsftpd should start right after you install them (assuming you’re using apt-get). You have to edit vsftpd.conf and fiddle with the options. I disabled anonymous logins, enabled chrooting for local user logins, and set the no privilege user to ftpsecure. Then I did:
# useradd ftpsecure -d /var/www # passwd ftpsecure
Restart vsftpd and go!
MySQL is bizarrely satisfying. Do this:
# mysql -u root -p Enter password: <enter> (leave this blank, there is no password at first!) mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('my_password') Some message indicating success mysql> CREATE DATABASE wordpress
The part I most enjoyed was deleting a database in MySQL if you mess up:
# mysql -u root -p Enter password: ******** mysql> DROP DATABASE wordpress POOF! (OK, it doesn't actually say "POOF", but it says something satisfying)
You also have to enable mod_rewrite. This is super easy as well:
# sudo a2enmod rewrite
Finished. I also had to edit my /etc/apache2/apache2.conf, and add this at the end:
<VirtualHost 192.168.1.104> ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/ ServerName somethingawesome.com RewriteEngine On RewriteOptions Inherit </VirtualHost>
Obviously you should replace your ServerName, ServerAdmin, and the IP address at the top with your own information. The important thing is the “RewriteEngine On / RewriteOptions Inherit” part. If you don’t do this, whenever you click on a page in WP-MU you’ll get a 404 error. That’s because WP-MU uses mod_rewrite to turn somethingawesome.com/about.php into somethingawesome.com/about , and if you don’t have mod_rewrite enabled, the your pages will still link to about/ rather than about.php, but your server won’t be able to find it.
Now you copy or ftp the contents of your WordPress MU archive into /var/www, and navigate to the server. If you’re on the same machine that’s serving the page, just go to http://127.0.0.1 or http://localhost and follow the instructions. If not, navigate to wherever your server is located. Mind is on our local network, for example, so I navigated to http://192.168.1.104. That’s it. It’s set up. I accidentally installed regular WordPress first, and then didn’t delete the database before installing MU. Everything installed fine, except that the password WP-MU randomly generated for me didn’t work! I had to figure out how to delete a database in SQL, and then create it afresh. To be honest I already had an idea, because of the xkcd about Bobby Tables.
This was a really easy installation, and really worth it. In under an hour I already had a working, fully customized company blog, albeit incomplete, but fully functional. For me the installation itself, not including the 1 or 2 reinstalls because I first installed regular WordPress, took about 5 minutes.
I should mention that I first learned about how to install WP-MU from an excellent presentation given by CT Moore at Wordcamp Montreal.