Accessing outside DocumentRoot files in Apache HTTP server

I don’t know a bit about Apache HTTP server but faced one issue in office…so thought about writing it here 😉

We are having a 3 tier setup where Oracle Application Server 10g was there on AIX 5.3. It runs Apache HTTP server and we needed to access the files outside DocumentRoot. A bit of googling revealed that we could use Alias for that. Basically we need to add the following small piece of text to httpd.conf file:

Alias /test1/ "/home/sidhu/test1/"
<Directory "/home/sidhu/test1">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

Now we should be able to access the files in /home/sidhu/test1 by hitting the following URL

http://server:port/test1/filename.html

PS: I couldn’t find the reason but it didn’t allow me to use word “reports” in the directory name.

Leave a Reply

Your email address will not be published. Required fields are marked *