Rough Book

random musings of just another computer nerd

Tag: webserver

Apache2 and .htaccess with mod_rewrite on Ubuntu 8.04 (Hardy Heron)

Apparently the default settings for .htaccess files and URL rewrites in Ubuntu (8.04 anyway) is kinda jacked. Apache wasn’t seeing my .htaccess files, and even after setting up the configuration correctly, I was getting Internal Server (500) errors from .htaccess files.

The default setting for Apache2 on Ubuntu for .htaccess is “ignore it”. You need to enable it by going to /etc/apache2/sites-available/default and changing the AllowOverride directive, which you can find inside the <Directory> … </Directory> tags:

AllowOverride ALL

If you want to enable URL rewrites, you need to enable the mod_rewrite module as it is not enabled by default:

[11:31:14] [email protected] ~/Projects/www/skyblue
$ sudo a2enmod rewrite
Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.

[11:31:20] [email protected] ~/Projects/www/skyblue
$ sudo /etc/init.d/apache2 force-reload
 * Reloading web server config apache2     

New DSL modem, a possiblity of Employment and not going to California

Qwest is sending me a Cisco 678. The 675 doesn’t work with our current line. Also, using the Intel Pro/DSL 3200 USB modem is a pain. It royally sucks. Plus, my FreeBSD machine doesn’t recognize it. If I get the 678, I can just hook it up to the uplink port of the hub and then plug all the other computers in. Also, I’m buying ip’s, so I can set up the XP and FreeBSD boxes as servers. I’ll be transferring all my stuff from Marc’s server to mine then. I’ll finally have my own webserver.

My professor just informed me that I apparently I am a selection at Motorola. However, the decision hasn’t been finalized yet, so it’s still in the air. It’s good to know though… I was beginning to wonder if I had made it.

I’m cancelling my trip to California for thanksgiving. Lab 9 is going to be hard, and I need to spend all my time on it. It sucks… but oh well. Michael and I are planning to have a little thanksgiving dinner at our place. It should be fun.

Horrible

How hard can installing a new OS get? Pretty damn hard. It took three hard disks and two other OS’es to get it right. Huh what? Yeah you heard me… I wanted switch from Windows XP Home to Windows XP Professional. So I pull out a pre-activated copy (muhaha) that my buddy gave me a year ago and start installing it. I selected the “Update” option. Call it intuition. But after using computers for more than 12 years, I have an idea when things are about to go wrong. Sure enough, it did. I can probably illustrate this better in a more logical format:

Problem

XP installation starts, runs for a while and then crashes with a blue screen. I rebooted and tried to install again. Same problem. Did this three times. No difference.

Solution

Forget about installing XP professional. See if you can use the Alienware recovery CD and get XP Home back.

New Problem

CD won’t boot for some bizarre reason. Later I found out that the machine had a problem recognizing signals from the USB Keyboard. The strange thing was that it would recognize the F2 keystroke for the BIOS setup, but wouldn’t recognize anything after that. It would say “Press any key to boot from CD…”, I’d press any key and nothing would happen. XP Installer would boot up (and crash).

Solution

Remove hard drives from the boot sequence. I’ll see if I can force it to boot from the CD.

Bigger Problems

Boot failure. Also, after restoring the boot sequence, it says the OS is corrupted. I still can’t boot from the Alienware Master CD.

Solution

Try to boot up with FreeBSD CD. It worked! I installed FreeBSD on the 20Gb hard drive. Tried to boot up, but kept locating the 75Gb hard drive. Switched boot sequences. It worked! Mounted the 75 Gb as an nfs mount using mount_ntfs. Tried to move everything to /. Said it ran out of space. That didn’t make sense! I knew there was a whole lot of space left on the 20 Gb. Then I realized that / was on a different partition and that I should install it on /usr. Did that. Pulled out hard drive, put it into my FreeBSD machine (I could have left it in there and just transfered it using another mount_ntfs after I wiped out the 75 Gb and installed XP Professional… but it was 3 am and this didn’t occur to me). XP Installs fine. So now I set up the network and set up a shared dir on the XP box. I try to mount it from the FreeBSD box using sharity light. It dies. Then I figured out I had changed the machine name. Tried it again with the new machine name – it worked! Then I mount the 20 Gb. I go to /usr on the 20 Gb to get my files…

Really Big Problem

I can’t find my files!! ls on /usr gives absolutely nothing!

Solution

Then suddenly I had an epiphany… I was mounting /dev/ad1s1. This means drive 1, slice 1 as FreeBSD organizes the drive into partitions, and different dirs are mapped to different partitions. I try to mount /dev/ad1 directly and it gives me a superblock error. So then I try /dev/ad1s2 – same problem. So I goto /dev and list all ad1 devices. I see a bunch of /dev/ad1s1a, /dev/ad1s1b and so on… So I tried mounting those and eventually found all the rescued files. Then I transferred everything over the home network to my XP shared dir. Problem solved! I have XP Professional and everything works fine… well almost. The BIOS and XP can see my 20 Gb hard drive, but it doesn’t assign it a drive letter… I formatted it (using FreeBSD so that might be a problem… except I don’t think so, because I just zapped all the partitions), but it still doesn’t see it… I’ll have to figure out how to fix it. Also, Qwest is sending me a Cisco 678. Then I can buy some static IP’s and set up my webserver… finally! Ahhh… This was a very trying experience, but I learnt a lot…

All original content on these pages is fingerprinted and certified by Digiprove
%d bloggers like this: