logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Allowing download of a file.
Author
bugz



Joined: 06 May 2008
Posts: 10
Location: Worcester, MA, USA

PostPosted: Mon 25 Aug '08 19:39    Post subject: Allowing download of a file. Reply with quote

Hi there,
I have apache installed and running on my system. I have configured it to run cgi and perl scripts.
I would like to let people download a file available on my server.
I provide link for the same using

<p align='Center'><b></u>Menu File</u></b><br>
<a href= '/Menu.pl' align="Center">Click Here to Download</a><br>
(right-click and select 'save as')<br></p>

when i click on it or choose save as it provides me the following error
"
403 Forbidden

Forbidden

You don't have permission to access /Menu.pl on this server.
"
I checked the conf file and this is what access prevention has
<FilesMatch "^\.ht">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
as you can see, it's not have anything about .pl files.

In addition, I have no .htaccess file in my folder(htdocs) where the file Menu.pl is located thus I am unsure why the access is forbidden.

Could someone guide me with what am i doing wrong? or what am i not doing right?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 25 Aug '08 20:05    Post subject: Reply with quote

move a copy to a directory that is not executable download from there, or zip up a copy for download.

You have .pl set to execute, as far as I know, even though you are right-clicking and choosing save as, the server knows only that it is executable so it is going to execute.

I'm surprised you just didn't get a menu.pl file with the html output in it.
Back to top
bugz



Joined: 06 May 2008
Posts: 10
Location: Worcester, MA, USA

PostPosted: Mon 25 Aug '08 20:18    Post subject: Reply with quote

I acutally did get it when i right click and save as. Confused
Zipping makes it inconvenient and not exactly what I am looking for.
could you explain the other approach? i did not understand what you meant by "move a copy to a directory that is not executable download from there"
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Mon 25 Aug '08 20:53    Post subject: Reply with quote

Folder/Directory same thing.

You must have Options ExecCGI for the file to work normal, by the /menu.pl I must assume this file is the document root and not in cgi-bin. You need another folder/directory that has

example:
c:/www
c:/www/mysite <- document root
c:/www/mysite/downloads <- some other directory,
configure with "Options -ExecCGI" either in httpd.conf <Directory> container or via .htaccess file in the downloads directory. .htaccess only works however if the site is configured with "AllowOverride Options" for this circumstance.

<Directory c:/www/mysite>
Options ExecCGI whatever whatever
..
..
</Directory>

<Directory c:/www/mysite/downloads>
Options -ExecCGI # Turns Execution off for this folder/directory
</Directory>


If it IS in cgi-bin and you just didn't include that little tidbit in your post, then place a copy in the document root and download from there.
Back to top
bugz



Joined: 06 May 2008
Posts: 10
Location: Worcester, MA, USA

PostPosted: Tue 26 Aug '08 18:14    Post subject: Reply with quote

Thanks that helped.

But the new server i setup on a different machine is giving me problems with cgi execution.
i posted the problem over here:
http://www.apachelounge.com/viewtopic.php?t=2453&highlight=
I have provided all the information I can.
Thanks
Back to top


Reply to topic   Topic: Allowing download of a file. View previous topic :: View next topic
Post new topic   Forum Index -> Apache