Article | Talk | Edit | History  

Apache alias

From the World Wide Wiki

"This machine kills fascists."

Jump to: navigation, search

the Alias directive. for directories not under your doc root or server root, add something like this:

Alias /img/ "k:/mein/images/"
<Directory "k:/mein/images">
   Options Indexes MultiViews FollowSymLinks
   AllowOverride None
   Order allow,deny
   Allow from all

   #Begin authorization. Delete this block to let anyone visit this directory
   AuthType Basic 
   AuthName "This is a private area, pissoff" 
   AuthUserFile K:/Webserver/admin/bmearns_password
   AuthGroupFile /dev/null 

   <Limit GET POST PUT> 
       require valid-user 
   </Limit>
#End authorization. Stop deleting

</Directory> 

Now i could go to http://localhost/img/ enter my username and password, and view an index of my image folder. If you want to let anyone view this, delete where indicated

You'll need to obviously change the path that you want to use, and the path to your authorization file, and the alias you want to use. Other options, you'll have to look else where. Maybe on this wiki. Try the Category:Apache.