开发者

how to create a VirtualHost to serve only static content

开发者 https://www.devze.com 2023-01-04 20:34 出处:网络
I want to create a virtual host in apache such that it serves only stati开发者_如何学运维c content like stylesheets, videos, images, javascripts, text files, etc. I am not looking at any \"processing\

I want to create a virtual host in apache such that it serves only stati开发者_如何学运维c content like stylesheets, videos, images, javascripts, text files, etc. I am not looking at any "processing" capabilities from this virtual host.


Create a VirtualHost entry as follows:

<VirtualHost *:80>
    ServerAdmin admin@domain.tld
    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>
0

精彩评论

暂无评论...
验证码 换一张
取 消