httpd.conf and aliases

3mors

HampCake Studios
I'd like to let friends download files from my webserver.
The problem is that these files are outside root folder (DocumentRoot) of Apache, so I have to use aliases.
Code:
AliasMatch /firewire/ "/Volumes/firewire/"
	
<Directory "/Volumes/firewire/">
    Options FollowSymLinks Indexes
</Directory>
In this case I share files in firewire and on http://localhost/firewire/ i see the list of files.
But if I click on one of them (aaa.sit, for example), the download doesn't start and the browser go to http://localhost/firewire/aaa.sit/ and I see the same list of /firewire/.

How to tell apache to let download these files?

:confused:
 
I'm not that great an apache expert, but maybe it's syntax?

Alias /Firewire/ "/Volumes/firewire/"

Apparently aliasmatch is used when an alias is a regular expression:

Did you chack your mime-types?
/private/etc/httpd/mime.types
declares th mime types, in it should be:

application/x-stuffit sit

HIH
 
MMM
Do I have to do it for every file type I want to share?

If I have a sit, a zip, an mpeg, a pdf and other stuff, I'd like that they could be all downloadable, without changing httpd.conf everytime I put a new type file.
 
I don't understand your last question (WHAT do you have to do for every file?)

I have some aliases, and they are just Alias (not aliasmatch) and it works fine, i can access files in these aliased directories with no trouble.

Mime-types are declared for filetypes (extensions like .sit)
 
Only a last question:

if I share a folder, I can see Desktop DB and Desktop DF files via http.
How to hide them?
 
Originally posted by 3mors
Only a last question:

if I share a folder, I can see Desktop DB and Desktop DF files via http.
How to hide them?

As I figured out on http://www.apache.org/, AliasMatch is a way of making aliases to folders with names that fit in a regular expression.
So, For* would alias Formerly but also Fork.

You can hide files from view, using IndexIgnore.
Somewhere in your httpd.conf there's something like:
Code:
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

Add names or expressions that you don't want to show up.
For instance *.html will hide any file that ends in .html
So your line could be something like
Code:
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t Desktop*

I think they will still be accessible if you ask for them directly. You could also restrict access using <files>.


Edit: Maybe it's better to make a folder on your disk, and make an alias to that: /Volumes/FireWire/SomeFolder
That way the Desktop DB etc. are under the aliased file and won't be seen or accessed anyway


:)
 
Back
Top