[Gllug] apache question

Alain Williams addw at phcomp.co.uk
Sat Apr 15 22:00:52 UTC 2006

On Sat, Apr 15, 2006 at 01:59:52PM +0100, Alain Williams wrote:
> I moaned to people to NOT put large attachments in email, but to put up links instead.
> OK they said, but we don't have access to a web server where we can put things.
> I have written a simple email handling script that saves files on a web server and
> returns them a URL that they can put into email to others on the mail list.
> It works well. It then occurred to me what happens if they put up a file: delete_everything.php ?
> Question: how to I get Apache to serve up all files in a particular directory as straight
> files, no trying to run as a CGI or whatever ?
> I want to allow that to still work in other directories.

In reply to my own question ....

In the virtual host definition in the apache config file I added:

	AddType text/plain .php .pl .cgi
	Options -ExecCGI -IncludesNOEXEC

The AddType line is the important one.

Although I think that Richard Jones's suggestion about putting the files out
of the ServerRoot and using mod_rewrite to invoke a script with the file as
an argument is a much better (== safer) suggestion. Something for next week.

Alain Williams
Parliament Hill Computers Ltd.
Linux Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256  http://www.phcomp.co.uk/

#include <std_disclaimer.h>
Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list