Tag Archive for 'howto'

Convert your Linux filesystem safely and easily (even on a VPS)

I was shocked to discover that converting one’s filesystem is simple as pie and totally safe. The process goes like this:

  1. Remove cruft from your system (optional)
  2. Reboot into a LiveCD environment (optional if the partition you want to convert can be mounted read-only without rebooting)
  3. Mount the partition you want to convert in read-only mode
  4. Copy the contents of the partition somewhere temporarily (ex. another partition, external drive, DVD, etc.)
  5. Unmount the copied partition
  6. Format the partition with your desired filesystem
  7. Mount the formatted partition and copy all the files back
  8. Edit /etc/fstab to reflect the new filesystem
  9. Reboot and profit

Thanks to Slicehost’s wonderful Rescue Mode with a 2GB Rescue Slice, I was able to use this method to convert my Gentoo VPS from ext3 to XFS. Here’s a step-by-step account. These steps were performed on a 256MB VPS at Slicehost. YMMV.
Continue reading ‘Convert your Linux filesystem safely and easily (even on a VPS)’

If you liked this post, please subscribe to my feed. Thanks for visiting!

Preparing Gentoo Linux for a minimalist web server

This is a first stab at a guide to preparing a minimalist web server running on Gentoo Linux, ideal for a small VPS. Don’t follow these instructions unless you know what you’re doing, ’cause I’m not sure I do. :P (Apologies for the lack of updates; I’ve been busy playing with this Gentoo web server amongst other things.)

This is a draft. Comments, suggestions, corrections, improvements are very much welcome!

Continue reading ‘Preparing Gentoo Linux for a minimalist web server’

Tutorials: Make your PHP pages cacheable

The following tutorials taught me how to make PHP pages cacheable. If you do not manually set your PHP page’s HTTP headers, that page is generally uncacheable by browsers, reverse proxies, HTTP accelerators, etc. That might make sense for highly dynamic pages or personal/sensitive information, but there are plenty of situations where PHP generated content can and should be cached.

There is a typo in Ned Martin’s guide: “Last-Modified” is hyphenated! (Took me forever to figure out why I couldn’t set that header.)

Use the Cacheability Engine and the Live HTTP Headers extension for Firefox to debug as you go. Remember that shift-clicking reload/refresh forces the browser to fetch a fresh copy of the page.

Apologies for the short and sporadic posting. I’m busy hacking Zenphoto for another project. :)

P.S. Another plug for my host NearlyFreeSpeech.NET; Squid HTTP acceleration on shared hosting for mere pennies rocks! The availability of Squid made me look into HTTP caching for PHP pages.