[[email protected] extra]# cat httpd-vhosts.conf--- NameVirtualHost *:80 NameVirtualHost *:8091 NameVirtualHost *:8092 #<VirtualHost *:80> #DocumentRoot "/var/html/tmp" #</VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "/var/html/blog" ServerName blog.etiantian.org ServerAlias etiantian.org ErrorLog "/app/logs/blog-error_log" #CustomLog "/app/logs/blog-access_log" common CustomLog "|/usr/local/sbin/cronolog /app/logs/access_blog_%w.log" combined ExpiresActive on ExpiresDefault "access plus 12 month" ExpiresByType text/html "access plus 12 months" ExpiresByType text/css "access plus 12 months" ExpiresByType image/gif "access plus 12 months" ExpiresByType image/jpeg "access plus12 12 months" ExpiresByType image/jpg "access plus 12 months" ExpiresByType image/png "access plus 12 months" EXpiresByType application/x-shockwave-flash "access plus 12 months" EXpiresByType application/x-javascript "access plus 12 months" ExpiresByType video/x-flv "access plus 12 months" #這一串代碼可以加在httpd.conf檔案的最後,也可以加在httpd-vhost.conf檔案中虛擬機器主機配置的後面 <ifmodule mod_deflate.c> DeflateCompressionLevel 9 SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/plain text/xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE text/css </ifmodule> </VirtualHost> <VirtualHost *:8091> ServerAdmin [email protected] DocumentRoot "/var/html/bbs" ServerName bbs.etiantian.org ServerAlias etiantian.org ErrorLog "/app/logs/bbs-error_log" # CustomLog "/app/logs/bbs-access_log" common CustomLog "|/usr/local/sbin/cronolog /app/logs/access_bbs_%w.log" combined </VirtualHost> |