blog

Setting up Wordpress

Formatting and Structure

One interesting thing I just noticed. When you write a page, and presumably a post, and Wordpress creates a permalink for you, make sure you know what you want to call it, and don’t change it. It seems that wordpress uses the first title you choose as the permalink title. Even if you change the title later, it uses the original title as the permalink. Something to bear in mind when you get home late, drunk, and decide to write a rant about curbs and giving it a less than gregarious title…Ooh, I’ve just noticed you can edit it, in the permalink option beneath your page title..very cool.

Tags: , ,

Tuesday, November 11th, 2008 Set up a blog No Comments

Setting up Apache

mod_rewrite

After getting Apache up and running in Ubuntu, I needed to make sure it was all configured for Wordpress. Everything was ok, excpet for mod_rewrite, which I apparently needed to enable. After some googling googling, I realised I needed to do this:

First, I needed to add the rewrite.load to /etc/apache2/mods-enabled/
So, open a terminal window and type:
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/

Second, edit the apache configuration for my virtualhosting. For example, in my computer I only have one virtual hosting (/var/www) that is default from installation, so I make some adjustment for that (In my case I have to edit this file /etc/apache2/sites-enabled/000-default)
Again in terminal type (this loads a text editor with the correct permission allowing you to edit the file:
sudo vi /etc/apache2/sites-enabled/000-default
Change the Allowoverride value to all for the document root directory
For example, I made change to this part of the configuration:

/var/www/
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
# Commented out for Ubuntu
#RedirectMatch ^/$ /apache2-default/

Finnaly, just restart the apache, so, again in terminal type:
sudo /etc/init.d/apache2 restart

.htaccess

I wanted to get Wordpress to use nice page structures, rather than all that silly ?>443634 stuff. So, in settings in Wordpress, I chose the permalink option and decided on the day,date,name option. However, for this to work, as wordpress warned me, I needed to allow wordpress to write to my .htaccess file.

The .htaccess is a file that can be used to do a lot to change the way your site works, it can be used to add security to your site (all though this isn’t always the best way). It turns out that my site didn’t have a .htaccess file, so I had to create one, this was as simple as creating an empty file in the root of my websites directoy and calling it, yes, you guessed it: .htaccess.

I then had ensure wordpress can write to this file. I did this temporarly (by typing sudo nautilus into terminal, which opens a file explorer, but as the super user, so you can do what you want (carefull, you can kill your system if you delete a file that is needed) and navigating to the root of my website directory and right clicking on the .htaccess file I created and choosing the permissions tab and changing the option so everyone can read/write the file and click OK). I then chose the correct option in wordpress via the admin interface to make fancy URLs. Wordpress now no longer moans about not be able to write to the .htaccess file. Now, I go back to the .htaccess file in nautilus, right click it again and chase the permission for everyone back to read only. Ta da – fancy URLS and some security to boot.

Tags: , ,

Tuesday, November 11th, 2008 Set up a blog No Comments