File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Tomcat and the fly likes Configuring Apache Webserver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Configuring Apache Webserver" Watch "Configuring Apache Webserver" New topic
Author

Configuring Apache Webserver

Naseem Khan
Ranch Hand

Joined: Apr 25, 2005
Posts: 809
Hi Ranchers,

I am trying to configure Apache Webserver 2.2.6 on Windows XP machine.
I have a situation where my application lets my users to upload images into non-webroot folder (that is folder other than my apache webroot). So lets say my Apache Webroot is E:\Softwares\Apache2.2.6\htdocs and my upload directory is E:\uploads. For every user, my application (on the runtime) creates a folder (folder name will be same as that of user's profile id) inside E:\uploads\<new_folder>.

So lets say a user's profile id is : tom, then his images will be uploaded to the following directory

E:\uploads\tom\image1.jpg
E:\uploads\tom\image2.jpg
E:\uploads\tom\image3.jpg
E:\uploads\tom\image4.jpg
E:\uploads\tom\image5.jpg
E:\uploads\tom\image6.jpg

Question : How do I access these images using the http protocol?

I have done following R&D :

In the apache's httpd.conf file, I have done the following settings :

<Directory "E:/uploads">
AllowOverride All
Options Indexes
Order Allow,Deny
Allow from all
</Directory>


and under <IfModule alias_module> tag :

ScriptAlias /profile_images/ "E:/uploads/"

Restarted my apache, and I am tried to access the image as follows from the web browser :

http://localhost/profile_images/tom/image1.jpg

I am getting 403 Forbidden error :
You don't have permission to access /profile_images/tom/image1.jpg on this server.


Appreciate if anyone can please shed some lights onto this.

Thanks a lot in advance.
Naseem Khan


Asking Smart Questions FAQ - How To Put Your Code In Code Tags
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuring Apache Webserver