Friday, July 6, 2012

Link Outside Directories In Apache

I recently setup an interactive file server to store various content and make the files accessible to everyone on my network. I used Apache and MySQL to build the site so it would function like a website. After getting everything setup, I realized that a lot of the content I wanted to make available was on different drives and locations on this server. I'm a big believer in separating data from the OS, so I have videos on one drive, music on another, and all sorts of documents on another. By doing this I don't have to worry about losing my data if or when my OS gets corrupted and needs re-installation. So I start begin the process of setting up links and realize all of these files are are on different drives. Not only are they on different drives, they are outside of my web server. Luckily I knew enough about Apache to know that the httpd.conf file could help me out. The solution was to add a directory alias in the conf file like this:

After saving the httpd.conf file, I rebooted my machine. I typed "http://myfileserver/tunage" in my browser and the directory was visible. I repeated this for each directory and I was able to access all of my files without issue.

No comments:

Post a Comment