Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuring Apache Webserver

 
Naseem Khan
Ranch Hand
Posts: 809
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic