apache icon
26th
May 09

Mapping Linux (ext3) File System for use in Apache under Windows

I’ve been using Windows Vista for the past day or so in an attempt to get some .NET languages under my belt. I have Linux and Windows on different hard drives and as I have a lot of work on Linux it would be a hassle having to keep booting up different hard drives.

After setting the Windows hard drive as the primary boot device I set out to not only read the Linux filesystem (ext3) with all my work but to also continue it in Apache under Windows which, to my surprise, was actually very easy. By the end of this reference you should be able to use your Linux filesystem within Windows and use Apache to read and use the website related content off your Linux filesystem.

  1. Reading the Ext File System
  2. Mapping URLs in Apache

Reading the Ext File System

Vista natively (or “out of the box”) only support the NTFS file system and in order to use ext2/3 will require a third-party driver. Out of all the ones I’ve tested I found ext2fsd to be the only truly successful driver.

Visit the ext2fsd project page (http://ext2fsd.sourceforge.net/projects/projects.htm), download the latest executable, install it, select a drive letter(s) and then reboot Vista. You should now be able to read and write to your Linux hard drive within Windows as if it was a NTFS.

ext3 Linux Filesystem in Windows Vista

ext3 Linux Filesystem in Windows Vista

Mapping URLs in Apache

Now that we can read and write to the ext file system it’s not much use if we can’t access or use it for (web design/development work in Apache). In Apache you can map URLs to filesystem locations which is exactly what we’ll do.

You’ll need to edit Apache’s httpd.conf file (in a text editor) which is usually located in /conf. In my case, as I run XAMPP on Windows, it was located at C:\xampp\apache\conf.

In httpd.conf search for “DocumentRoot” and you should end up at an area similar to:

#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/xampp/htdocs"

Under DocumentRoot we will create an Alias that will point a URL to where we want on the filesystem. Example:

Alias /linux/ L:/opt/lampp/htdocs/

The line above will point http://localhost/linux/ to L:\opt\lampp\htdocs on the filesystem. If you visit the URL you’ve just defined it will most likely return access errors which leads us to the final part, creating the Directory rules.

<Directory "L:/opt/lampp/htdocs/">
		Options Indexes FollowSymLinks +ExecCGI MultiViews
                Order allow,deny
		Allow from all
</Directory>

There are a lot of options for directories so I won’t explain that here (google) but the configuration above should be generic enough to understand.

You may also want to transfer your MySQL databases for testing purposes. On Linux MySQL databases/tables are generally a directory like /var/mysql/database_table/. Copying the databases directly over to the Windows MySQL directory is the quickest hassle free way if you haven’t already converted them on Linux.

SociBook del.icio.us Digg Facebook Google Yahoo Buzz StumbleUpon

Related posts:

  1. A Basic Introduction to chmod for Linux


1 Comment

  1. [...] a Windows NTFS XAMPP / Apache Install on a Linux Apache Server About a year ago I write about how to “map” the Linux EXT3 FS in Windows so you could use it with Apache on a Windows installation. Now I’ll be explaining how to use a [...]

TrackBack URL

Leave a comment