Skip to navigation | Skip to content



The Asus Eee PC, Ubuntu, LAMP & ColdFusion

asus-eeeI recently got an Asus Eee PC 1000H. For writing, travel, and learning Linux. I wanted to get Ubuntu working on it (a friend recommended it), the Apache/MySQL/PHP trinity (essential for work), and ColdFusion (not essential for work these days, but a few little apps I’ve written—for use locally—use CF).

There’s been a whole series of hoops to jump through. I’m no tech novice, but Windows and occasional Mac use has been my staple thus far. Of course you can’t do much in web development without knowing a bit of Linux at least; still, wrangling with various desktop issues can be a chore.

The web, or Google (if there’s a difference) is your friend. Finding a comprehensive tutorial that covers your precise situation is rare if not impossible; you need that familiar net skill of cobbling together varying perspectives and bits of advice into something that works for you. That said, I’ll point to this ACME Guide up-front as a fantastic source of information on getting web development stuff going.

I also picked up the O’Reilly Linux Pocket Guide. It’s a good little intro to the Linux environment as well as a useful reference point.

Anyway, here’s my summary of what I’ve learned. Hope it’s useful for you! (As ever, this information is used at your own risk. I can’t support you if stuff goes wrong—but do let me know if you know for sure I’ve, for example, mis-typed commands!)

Ubuntu Eee

ubuntu-eeeI got a 40GB Eee with Linux pre-installed. Knowing I was going to shift to Ubuntu anyway (the default version of Linux on the Eee is the clunky Xandros), I probably should have gone for the 80GB Windows version—it’s cheaper!

Anyway, in either case, the good news for people wanting Ubuntu is that there’s a special distribution of this system especially tailored for the Eee: Ubuntu Eee. Follow their instructions.

My only real sticking point here was that the UNetbootin-created USB installation drive didn’t boot. The Eee doesn’t have a CD/DVD drive, so this utility unpacks the disk image (ISO) of the Ubuntu system onto a USB stick, making it bootable. I only solved this by getting a new USB stick for this purpose. The first one was oldish, and only 1GB. This is theoretically enough, but they say a 2GB stick is recommended. Indeed.

The /home directory

The Ubuntu Eee install is pretty slick. The only thing I think I missed was relocating the /home directory. This is where most user files are kept in Linux. The Eee seems to come with its main hard disk (actually a solid-state disk) partitioned into two—mine had one with around 8GB, one with around 32GB. I wiped the Xandros installation off the smaller one and installed Ubuntu there. It was only after installation that I got round to thinking my /home should be on the big partition for all my data…

There are other options of course—search and you’ll find myriad opinions. If you end up in my position, here’s what to do. I waded through a number of ad-riddled blog posts and forum threads, but this one seemed to nail it in the end.

Be aware that some of this can go wrong. I managed to make some drastic mistakes here, but Linux is quite sturdy and I managed to recover OK. This definitely isn’t for total beginners.

  1. Close all applications. Print this out or write it down.
  2. Open a command line terminal.
  3. sudo su
    This shifts the session to “root” or “super-user” (after you enter the password for your own user account). You can prefix individual commands with sudo to temporarily shift from your own user account that was created with the Ubuntu installation to the root account, needed for many system operations. But it can get tedious. This trick keeps you operating as root until you type exit.
  4. cd /media/HOME
    This shifts you into the large partition, which, in the default Ubuntu-Eee install, is mounted with the label “HOME”. Linux devices (like disks and drives) are generally registered in the /dev directory. My boot partition is /dev/sda, and my O’Reilly guide says sda is usually the “First SCSI” device (whereas the master hard disk should be hda). I guess this is down to the Eee having solid-state disks instead of hard disks? A detail to watch for. Anyway, this large partition’s mount is here in the /media directory, usually for external devices—there’s a /mnt directory for usual hard disk partition mounts.
  5. Now, there’s probably some user directories in /media/HOME left over from Xandros. Obviously grab what you might need, but I felt like a clean slate. Beware, this next command will wipe that partition:
  6. rm -r *
    Remove (rm) recursively (-r)—that is, all sub-directories and contents—everything in the current directory (*).
  7. unmount /media/HOME
    Pretty self-explanatory. A useful command you can check this with is df—it’ll list all mounted filesystems.
  8. mv /home /home.bak
    mv “moves” (actually renames) a file or directory. Here, it basically backs up the home directory by renaming it.
  9. mkdir /home
    This creates a new /home directory.
  10. mount -t ext3 /dev/sdb1 /home
    Now this re-mounts the large partition, /dev/sdb1, under the new /home directory. So now /home points to the partition. Do double-check the partition’s reference first. Use fdisk -l, which will (for root) show all connected disks, mounted or not, with their details. /dev/sdb is the second (“b”) SCSI device, and /dev/sdb1 is its first partition. It’s usually easy to identify drives and partitions by their sizes. Note that ext3 is the filesystem format (like NTFS in Windows).
  11. cp -a /home.bak/* /home
    This copies the contents of the old /home into the new partition.
  12. You should be up and running now with /home located on the large partition. The only thing left to do is make sure this mount happens each time you boot up. This sort of stuff is managed by the /etc/fstab file. If you’re still root in the terminal, you can open it for editing by entering:
    gedit /etc/fstab
    This will open the file in the text editor, with root permissions (essential for saving it!). If you’re not root anymore, just prefix the above with sudo (you’ll get used to this).
  13. At the bottom, add the line:
    /dev/sdb1   /home   ext3   nodev,nosuid   0   2
    By now I imagine you’ll roughly see what’s going on in this.

Automounting the USB stick

That’s hopefully it for moving /home. But while we’re editing fstab, there’s another thing. I found after installing Ubuntu, the USB stick I’d successfully used was no longer “automounting” when I plugged it in. After a bit of searching, someone suggested commenting out the lines referring to /media/cdrom. Just put a # at the start of each line. Seems to be something to do with how the system has to recognize the stick as a boot device initially, which is no longer the case. Anyway, worked for me.

LAMP

After all that, LAMP (or AMP at least—Linux is done!) brings good news.

In Ubuntu, open up Synaptic Package Manager. This is basically a nice GUI for the “Advanced Packaging Tool”. You’ll see plenty of command line examples for installing software (“packages”) on Linux with the apt-get program—the part of the APT family that grabs software from remote repositories. Synaptic makes it all a breeze.

Select Edit > Mark Packages by Task, and from that list select LAMP Server. This will check all the components of the LAMP bundle of packages. You may as well also search (with the Synaptic search tool) for “phpMyAdmin” (the trusty web interface for MySQL) and/or “mysql-admin” (the MySQL desktop GUI), and check one or both of those. Just click the box at the left of the package listing and select Mark for Installation.

If you want to install ColdFusion, too, search for “sun-java6-bin”. CF’ll need it.

Any time you use Synaptic, once you’ve selected everything you want (a process that might also auto-select other packages that the ones you’ve chosen are dependent on), click Apply.

One of the nicest parts of getting all this going was, after installing LAMP, opening up a browser and going to http://localhost/. In big letters I found that “It works!”. Hope you do too.

For more details, do refer to that great ACME Guide (though you might need to ignore the stuff about 64-bit versions).

Keeping www somewhere else

As I’d decided to keep all my data on that other partition, I also wanted to keep my www directory, for all the local files of websites I’m developing, there too. I was kind of dreading some trawl through Apache configuration, but thankfully Linux offers a simple solution: a symbolic link.

Also known as a symlink or soft link, symbolic links are just small files that direct operations from one part of the filesystem to another.

  1. Create your web files directory in your user folder, e.g. /home/steve/www.
  2. Apache’s default web directory is /var/www. If there’s anything in there you want, copy it to the new one. Then delete the directory.
  3. In a terminal, as root (or using the sudo prefix), enter:
    ln -s /home/steve/www /var/www
    Obviously, change the steve bit! The -s specifies a symbolic link. The next bit is the target directory to point to, and the bit after that effectively recreates /var/www as a link to it.

Now you can keep your web files in /home/[wherever]/www, and anything referencing anything starting with /var/www will point there.

Oh, if you’ve wondered, in looking in the www folder, where the heck phpMyAdmin is—you’re not alone. Mine works fine at http://localhost/phpmyadmin/, but I’ve no idea how this is so, or where it points. Ah well.

ColdFusion

There’s not much I can add to the ACME Guide’s lowdown on this. It’s a good brief education in some basic Linux concepts, too. Thanks to Adrian J. Moreno.

Fonts

I’ve still got loads to learn, but one final tip that will hopefully help you enjoy Ubuntu more. This page pointed me to Microsoft’s core fonts for the web. They should make browsing a little more pleasant. You can install them from Synaptic (of course)—search for “msttcorefonts”.

That’s it for now. Have fun!

Comments on this post are closed.

Recent posts

Archives