I want to create a virtual host in apache such that it serves only static content like stylesheets, videos, images, javascripts, text files, etc. I am not looking at any "processing" capabilities from this virtual host.
+1
A:
Create a VirtualHost
entry as follows:
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName media.domain.tld
DocumentRoot "/Library/WebServer/Documents/media"
ErrorLog "/private/var/log/apache2/media-error_log"
CustomLog "/private/var/log/apache2/media-access_log" common
<Directory /Library/WebServer/Documents/media>
Order deny,allow
Allow from all
SetHandler default-handler
</Directory>
</VirtualHost>
Török Gábor
2010-07-07 11:27:20
I removed the `ServerAdmin`, `ServerName` and all those lines pertaining to logs and then restarted apache. I observe it is serving php files
deostroll
2010-07-09 10:45:32
@deostroll: I updatd my answer to fit your needs.
Török Gábor
2010-07-09 11:55:38
it didn't work as expected. Do we still need the `Location` tag?
deostroll
2010-07-12 06:26:48
@deostroll: you can remove `Location`, `SetHandler` can be placed inside the `Directory` tag, too. Change its value to `default-handler`.
Török Gábor
2010-07-12 07:18:44