增加虚拟主机配置:
一、开启apache虚拟主机配置
0 1 |
# Virtual hosts Include conf/extra/httpd-vhosts.conf #去掉#,开启httpd.conf调用extra目录下的虚拟主机文件,名称可以随便修改 |
二、编辑虚拟主机配置
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
<Directory "/var/www/docs"> AllowOverride None Options None Require all granted </Directory> <VirtualHost *:80> ServerAdmin Webmaster@t4x.org DocumentRoot "/var/www/docs/t4x.org" ServerName hk.t4x.org ServerAlias hk.t4x.org ErrorLog "logs/dummy-hk.t4x.org-error_log" CustomLog "logs/dummy-hk.t4x.org-access_log" common ExpiresActive on ExpiresDefault "access plus 12 month" ExpiresByType text/html "access plus 12 month" ExpiresByType image/gif "access plus 24 month" <ifmodule mod_deflate.c> DeflateCompressionLevel 9 SetOutputFilter DEFLATE AddOutputFilterByType DEFLATE text/html text/plain text/xml AddOutputFilterByType DEFLATE application/javascript AddOutputFilterByType DEFLATE text/css SetEnvIfNoCase Request_URI \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary </ifmodule> </VirtualHost> |
申明:本文由BYRD原创(基于Centos6.4 X64、APACHE2.4.9),未经许可禁止转载!
参考:http://note.t4x.org/system/apache-mod-deflate/
参考:http://note.t4x.org/system/apache-mod-expires/ SourceByrd's Weblog-https://note.t4x.org/basic/httpd-vhosts-configure/
申明:除非注明Byrd's Blog内容均为原创,未经许可禁止转载!详情请阅读版权申明!