?
Solved

apche_downloadfFile

Posted on 2011-10-11
9
Medium Priority
?
201 Views
Last Modified: 2012-05-12
We have an apached web server and we normally download files using

https://wwws.ccc.org/myapp

I found this to map to a unix directory

/myapp/prd/htmldocs/

Now I created a unix directory for another application so users can download ZIP files
/myapp/invoices/ myfile.zip

By apache does not see this. What do we need to do on apache so this directory becomes visible and files can be downloaded?

In apache, do you have to define every physical directory on the server and map it to a URL?
0
Comment
Question by:sam15
  • 4
  • 3
  • 2
9 Comments
 
LVL 4

Expert Comment

by:vvk
ID: 36950442
usually nothing is required to recognize additional directories, can you check for Rewrite rules or any.htaccess files in /myapp directory
0
 
LVL 19

Expert Comment

by:xterm
ID: 36950444
You can use a symlink:

Your web tree is probably in something like /var/www/html - you can create a symlink to the new directory with files in it, but then you will need to add the option FollowSymLinks to the Options directive in httpd.conf for the server's root directory.  Then you can simply do something like:

cd /var/www/html (or whatever your web root is)
ln -s /path/to/folder/containing/my/files downloads

Then you can go to http://wwws.ccc.org/downloads/ and you will see the files in /path/to/folder/containing/my/files
0
 
LVL 4

Expert Comment

by:vvk
ID: 36950455
one thing forgot to mention, directory permissions shall allow user which run httpd to at least read content
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:sam15
ID: 36950649
I do not have access to teh wbe server config files.

But, are you saying that whenver I add any new subdirectory under /myapp in UNIX i hould be able to see it in the web server? Do not you have to do special mapping in apache to the filessystem?

They might have configure something I guess it by default i should see it.
0
 
LVL 19

Expert Comment

by:xterm
ID: 36950703
Yes, any subdirectory under /myapp will be accessible unless there is a .htaccess file or the main server config prohibits it, but I don't see why that would be the case.

As long as /myapp is within what Apache knows as the DocumentRoot, the webserver will be able to see everything in it and below it.
0
 

Author Comment

by:sam15
ID: 36950805
I am sure there is .htacces file. So does that block accessing any directory under myapp?

How do you normally configure apache so that when someone types this URL

https://wwws.abc.com/myapp

it will look for files under

/myapp/prd/download/
0
 

Author Comment

by:sam15
ID: 36951156
according to this everything under the DocumentTree directive should be accessible.

http://httpd.apache.org/docs/2.0/urlmapping.html

I think the document tree they defined has subdirectories /myapp/subdir/..
0
 
LVL 19

Accepted Solution

by:
xterm earned 2000 total points
ID: 36951228
> How do you normally configure apache so that when someone types this URL
> https://wwws.abc.com/myapp
> it will look for files under
> /myapp/prd/download/

Just like I told you - make a symlink:
cd <webroot>
ln -s /myapp/prd/download myapp

The only thing that you need to be sure of is that the administrator has enabled the FollowSymLinks directive otherwise Apache runs in a "jailed" environment.   There is one way to do this without messing with Apache, but you will need to be root.

cd <webroot>
mkdir myapp
mount --bind /myapp/prd/download/myapp myapp

This will "bind" the directory in the apache tree to your files directory, and then you won't need FollowSymLinks enabled in Apache.

Keep in mind, that this will not survive a reboot, so you will need to have the administrator to configure this bind to occur at every system startup.
0
 
LVL 19

Expert Comment

by:xterm
ID: 36951265
> I am sure there is .htacces file. So does that block accessing any directory under myapp?

Not necessarily - it may just be to limit which IPs can view that directory and/or to provide username/password authentication to that page is the most likely purpose.  However, the .htaccess file CAN also be used to limit depth of visibility should the administrator choose to do so.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question