how to create a VirtualHost to serve only static content

后端 未结 1 1589
Happy的楠姐
Happy的楠姐 2021-02-15 17:12

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 \"proce

1条回答
  •  北海茫月
    2021-02-15 18:05

    Create a VirtualHost entry as follows:

    
        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
    
        
        Order deny,allow
        Allow from all
        SetHandler default-handler
        
    
    
    

    0 讨论(0)
提交回复
热议问题