Archive for the 'Linux' Category

Oct 25 2008

Moving a WordPress blog to another folder

Published by Eric under Linux, Web 2.0

Changing the location of a WordPress installation isn’t as harrowing as it may sound. Although no tools exist to do it automatically, some knowledge of the Linux command line and MySQL makes it do-able. This post is a summary of the steps I performed to relocate my blog folder; this assumes you are hosting under Linux, MySQL, and cPanel. Take a gander at the official Moving WordPress documentation before you begin.

Make a Backup

Be sure to make a backup of your installation.

Change the Current Blog Folder

Rename your existing WordPress folder (i.e.: /journal) to the new name. FTP or ssh (i.e.: mv journal blog) can be used for this.

Update the blog path settings within the admin panel.

Updating Paths in the Database

If your blog posts contain images or links using the old folder they must be changed. There is a simple SQL command which performs a search and replace. I suggest using phpMyAdmin instead of MySQL’s command line.

Take a look at your wp_options table in phpMyAdmin. You may find that plug-ins are using your old path in their settings which may be not accessible through the admin interface.

Don’t Break Trackbacks

If anyone is linking to your blog they’ll be using the old folder name. To ensure those links don’t break with your folder we can use a symbolic link and a 301 redirect.

Login to your Linux hosting account using ssh and navigate to the root folder of your web site such as public_html. Enter the following command:

ln -s /path/to/new /path/to/old

Replace /path/to/new and /path/to/old with the absolute folder names. For example:

ln -s /home/your-domain/www/blog /home/your-domain/www/journal

You may be tempted to add a redirect using cPanel but don’t - the symlink above is doing this for you.

Unfortunately, permalinks still won’t work. For example, a permalink of http://your-blog/journal/2008/06/my-post will generate a 404 Not Found instead of redirecting to http://your-blog/blog/2008/06/my-post. Don’t bother with the Redirection plug-in because it doesn’t build a library of prior permalinks.

Instead, use Alexandra’s technique to modify your .htaccess file and all of your old permalinks will 301 properly.

3 responses so far

Sep 13 2007

PHPlist, Drupal, and magic_quotes

Published by Eric under Blogs, Linux, Web 2.0

If you’re attempting to run an installation of PHPlist alongside Drupal you’ll find PHPlist complains about settings for magic quotes. I can’t vouch for the completeness of this fix but it gets rid of the errors without breaking anything else.

Assuming you installed the lists folder in the root of your Drupal site, you’ll find that an htaccess file in your Drupal install is changing the magic quotes values which are impacting PHPlist. You can override this for PHPlist using another htaccess file. Navigate into the lists folder for PHPlist and create an .htaccess file with the contents:

# Changes for PHPlists running on a Drupal installation

php_value magic_quotes_gpc        1
php_value magic_quotes_runtime    0

Word of warning: don’t modify your host’s PHP.INI for these settings as it will likely break something else if you host multiple domains. In my case it broke WordPress so stick with the htaccess method.

3 responses so far

May 07 2006

Quickly delete your exim queue of unwanted messages

Published by Eric under Linux

On Friday I was greeted with a nice note from my hosting provider that “my CPU utilization had exceed 80% for six hours (a two days).” That was a head-scratcher since nothing is (normally) running on the server to drive up the CPU. After some quick digging what I discovered was akin to a cholesterol-clogged artery of spam.

Continue Reading »

No responses yet

Dec 01 2005

Gartner Group sees IT specialists turning into Maytag repairman

Published by Eric under Linux, Macintosh, Windows

CNET posts an article about today’s IT staff becoming the obsolete Maytag washer repairman of tomorrow.

Yes and no. It all depends if the tech industry (well, Microsoft) will start building solid systems. More of my opinion after the jump.

Continue Reading »

No responses yet

Nov 30 2005

Playboy supports Open Source

Published by Eric under Linux

blog/pb_logo.pngYes, the title is correct. I was beta testing a piece of Java software tonight and found a Java development system called Eclipse. Anyway, as I was downloading the software I was asked to choose a local mirror.

Nestled under “North America” was “Playboy Enterprises Inc.” No way. Couldn’t be.

Well, it is. The programmers over at PB donate server space and bandwidth for the Open Source community.

Alas, no free model pics.

No responses yet