我有一个冗长而复杂的
我的
另外,我不能使用.htaccess文件.
你不能使用include指令来包含通用规则.这里
文章
例如.:
... include conf/common_rule.conf ... include conf/common_rule.conf ... #SSL rules include conf/common_rule.conf
您可以在单个Virtualhost指令中使用任何#个主机和端口.
...
在我的情况下,我用过.
ServerName loop.lk .... SSLEngine on SSLCertificateFile /etc/apache2/ssl/local.crt
很抱歉打破这样的老帖子,但是为了帮助其他Google员工,我想分享我处理它的方式:
我有一对夫妇在我的本地虚拟主机的,说:localhost
,foo.com
,bar.com
这是我的笔记本电脑上的本地主机站点(macosx)我可以使用自签名证书,因此所有虚拟机的ssl-part都是相同的...
我做的是这样的:
我创建了目录/etc/apache2/extra/vhosts/
.
我创建了一个/etc/apache2/extra/vhosts/localhost.conf
:
ServerName localhost DocumentRoot "/www/localhost"Require all granted ErrorLog "/var/log/apache2/localhost.error_log" CustomLog "/var/log/apache2/localhost.access_log" common
答/etc/apache2/extra/vhosts/foo.conf
:
ServerName foo.com DocumentRoot "/www/foo.com"Require all granted ErrorLog "/var/log/apache2/foo.com.error_log" CustomLog "/var/log/apache2/foo.com.access_log" common
答/etc/apache2/extra/vhosts/bar.conf
:
ServerName bar.com DocumentRoot "/www/bar.com"Require all granted ErrorLog "/var/log/apache2/bar.com.error_log" CustomLog "/var/log/apache2/bar.com.access_log" common
最后一个/etc/apache2/extra/vhosts/ssl.conf
:
SSLEngine on SSLCertificateFile "/etc/apache2/ssl/server.crt" SSLCertificateKeyFile "/etc/apache2/ssl/server.key"
在我的/etc/apache2/extra/httpd-vhosts.conf
:
Include /etc/apache2/extra/vhosts/localhost.conf Include /etc/apache2/extra/vhosts/localhost.conf Include /etc/apache2/extra/vhosts/ssl.conf Include /etc/apache2/extra/vhosts/foo.conf Include /etc/apache2/extra/vhosts/foo.conf Include /etc/apache2/extra/vhosts/ssl.conf Include /etc/apache2/extra/vhosts/bar.conf Include /etc/apache2/extra/vhosts/bar.conf Include /etc/apache2/extra/vhosts/ssl.conf