Archive

Archive for the ‘wordpress’ Category

How I got back up and running

August 14, 2007 Leave a comment

The reason for this site’s extended absence from cyberspace was due mainly to a hardware changeover. The site is run as a secondary functionality off the back of my home media server, which recently underwent a major upgrade. I got sick of watching videos where the video would get out of sync with the audio, after this happened 1 of 2 things would happen: 1) a comical fast-forward effect would bring them back into sync 2) they would stay that way until a fast forward/rewind event brought about sync. Needless to say this was kind of annoying.

The cause however was simple to diagnose, it was the Celeron 500MHz CPU that was doing the decoding. The fix was also (in essence) simple – upgrade the CPU, however given my constraints (mainly of the monetary variety) this was a bit harder to accomplish. What I ended up deciding to do was to beg some decommissioned equipment from work which would do a better job and then to buy a solid 320Gb HD to store all my digital media on.

I decided that if I was doing a full hardware upgrade I might as well go the whole hog and scrap my previous Gentoo distribution in favour of something a bit more media centric. Enter Mythdora! Mythdora is a specialized Linux distribution based on Fedora Core 6 and MythTV 0.20-1 (thanks wikipedia), what that basically means is that it wraps up the mythtv package (very hard to install) with a nice fedora core 6 system install (very easy to install – if you have a blank harddrive to install to). I’ve been using fedora quite a bit as it is the distro of choice for our work computers so it wasn’t hard for me to transition – plus being able to install new applications without having to fiddle with USE flags and such was such a relief.

The unfortunate part of all this is that with wordpress being stored mainly in a MYSQL database it took me a while to transition the site over from the old Gentoo install to the new Mythdora. The default installation comes with the LAMP (linux, apache, mysql and PHP) stack already enabled so there wasn’t a whole lot to do in the setup department, there were however a couple of gotchas. Firstly is the movement of the mysql database from the old machine to the new. The easiest way to do this was to reboot the machine into Gentoo (thank god I didn’t wipe that)


mysqldump -h localhost -u root -p wpress_db > wpress_db.sql

then reboot to mythdora


mysql -h localhost -u root -p wpress_db < wpress_db.sql

After this I had to create a wordpress user for mysql and grant privileges to the newly created database. Things now worked well except that my settings weren’t as I’d like them (don’t know why my theme had reverted to default) but that was fairly easy to fix. The thing that took the longest was the lack of pages (ie. http://jamie.homelinux.org/publications/), I eventually tracked this down to the mod_rewrite apache module being incorrectly configured, well it was correctly configured for a default system but needed the following change to allow on the fly re-writes of urls for my blog.



  Options Indexes FollowSymLinks
  #AllowOverride None     # Comment out this line
  AllowOverride All       # And add this line instead
  ...


Sweet! Now things were back up and running just the way I like them.

MySQL Hassles

January 18, 2007 Leave a comment

After recompiling my version of php5 to support the new wordpress widgets I started getting these messages from mysql (/var/log/mysql/mysqld.err)


060810 12:01:52 [Warning] ‘./mysql/host’ had no or invalid character set, and default character set is multi-byte, so character column sizes may have changed
060810 12:01:52 [Warning] ‘./mysql/user’ had no or invalid character set, and default character set is multi-byte, so character column sizes may have changed
060810 12:01:52 [Warning] ‘./mysql/db’ had no or invalid character set, and default character set is multi-byte, so character column sizes may have changed
060810 12:01:52 [ERROR] Fatal error: mysql.user table is damaged or in unsupported 3.20 format.

Thankfully I found the following series of instructions,

mysqld_safe -–skip-grant-tables -–user=root &
mysql_fix_privilege_tables
pkill mysqld
/etc/init.d/mysqld restart

This simply starts mysql as user root ignoring the now defunct table structure in the users file. This fixed my immediate problem, but I then found that my passwords had been corrupted aswell… sigh!

1. Stop mysqld and restart it with the –skip-grant-tables –user=root options (Windows users omit the –user=root portion).
2. Connect to the mysqld server with this command:
shell> mysql -u root
3. Issue the following statements in the mysql client:
mysql> UPDATE mysql.user SET Password=PASSWORD(‘newpwd’)
-> WHERE User=’root’;
mysql> FLUSH PRIVILEGES;
Replace “newpwd” with the actual root password that you want to use.
4. You should be able to connect using the new password.

Then I had to repeat step 3 of the above procedure for all the other users in the mysql.user table as their passwords had been corrupted aswell.

Removing “Permanent Link to” from post titles

July 17, 2006 Leave a comment

I’ve just managed to get my automatic pinging of sites such as technorati working withm my new permanent link structure and I noticed that when my posts were showing up in technorati they would be called something like “Permanent Link to Gentoo emerge”. Obviously not a huge problem as they are actually showing up (step in the right directionTM) but it doesn’t look very professional.

I think I’ve fixed this up by editting my current theme to remove all instances of “Permanent Link to” in the titles. This post is mainly to check if it has worked or not.

Update: That seems to have done the trick.

Categories: blog, internet, wordpress

Moving my blog from Bloglines to WordPress

July 14, 2006 Leave a comment

A long time ago I was headed overseas for the better part of a year and I decided that it would be a good idea to set up a blog to allow me to post my incoherent ramblings while travelling. I decided that it would be a good idea to set up a blog using the same service I use to read all my various feeds, unfortunately bloglines is much better suited to displaying blogs than it is to creating them. Unfortunately I didn’t realise this until I had a fair number of posts in my archives there, then when I started shopping around for a new service I realised that there was no easy way to export my archives to a new service.

I set up my wordpress blog on my home server with the dread thought in the back of my head that I would have to write a html scraping script to run over my old blog before importing into wordpress. Thankfully it didn’t come (quite) to that and I thought I’d share with you my solution for the ugly bloglines lock-in problem.

  1. Get this bash script which will rip down and dump the bloglines xml-feed into a single file
  2. Put the script somewhere you can execute it. If you don’t have cygwin or linux installed you can probably execute it from your hosting company server (if they give you shell access)
  3. Run the script by giving it your user name and the range of months you were active on bloglines for: ie ./genBloglines.sh -u yourUserName -sm 1 -sy 2005 – this will get everything from Jan/2005 to the present month
  4. From the wordpress admin panel choose the Import option and choose import from RSS feed
  5. Select the file generated by my script (default is bloglines.xml) – you might have to download it to the local machine if you’ve run the script on your hosting server.
  6. Voila – you are done

NAT Translation for wordpress

July 6, 2006 Leave a comment

After installing wordpress on my home server I had trouble getting access from both normal internet and within my home network, the trouble being with the Network Address Translation on my router. This article gives a good fix using the hosts file (which I didn’t even realise existed on windows).

Add the following line to your hosts file
linux – /etc/hosts
windows – C:\windows\system32\drivers\etc\hosts

# if you are on the machine running the webserver
127.0.0.1 localhost www.example.com
# if you are on another machine in the local network
192.168.0.100 www.example.com

Categories: browser, NAT, wordpress
Follow

Get every new post delivered to your Inbox.