Working With Apache’s Alias DirectiveJuly 7th, 2008 · No Comments
While it may not be necessary for you to read all the previous posts, they may provide you with a better understanding of Apache’s HTTPD Server. An Introduction To Apache’s Alias DirectiveFrom Apache’s HTTPD Server perspective, a directory alias allows documents to be stored in the local filesystem other than under the DocumentRoot. This is set using the Alias directive. So for example, you could have the following directory structure:
In this case, the content of c:\www\mywebsite will automatically be published on the web as it is your website’s root folder by default (ie.: http://mywebsite/). On the other hand, c:\downloads will not be available as it sits outside of c:\www\mywebsite. Let’s see how we can make the content of the c:\downloads available publicly as if it was a subdirectory of c:\www\mywebsite. And not only do we want it to be available publicly, we want to access it as if it were named files and not downloads. So after we’re done, we should be able to access the content of c:\downloads through this URL:
You following me? Great. For this tutorial, I am using a WAMP setup which means Windows-Apache-MySQL-PHP. Apache’s configuration files are located in C:\Apache2\conf. My website VirtualHost entry in c:\Apache2\conf\httpd.conf actually looks like this:
First we’re going to add an Alias directive to our VirtualHost entry:
Then we need to specify the permissions for this directory. We’re going to add a Directory entry right after the VirtualHost one: <Directory "C:/downloads"> Options +Indexes AllowOverride None Order allow,deny Allow from all </Directory> Now put some files into c:\downloads and restart the Apache service. Open your web browser to http://mywebsite/files and you should now see the content of the directory:
Of course, this is not an in-depth tutorial on Apache’s Alias directive so here are a few useful links: Feel free to ask any questions through the comments! Related Posts |
Popular PostsLatest PostsLatest Deals & Coupons
Recent Comments
Hosting ReviewsRecent WebmastersTag Cloud
1and1
apache
bluehost
centos
cheap web hosting
control panel
coupon code
coupons
cpanel
dreamhost
godaddy
godaddy vs 1and1
green web hosting
hostdime
hostgator
hostpapa
iis
inmotion hosting
knownhost
linux
lunarpages
mysql
openx
php
reseller hosting
security
shared hosting
system administration
vps
web hosting
web hosting comparison
Web Hosting Comparisons
whm
windows
windows 2008
|
|||||||||
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment