httpd.conf文件年夜概470行左右(不合机械可能稍有不合)找到以下位置:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
去失落"# Include conf/extra/httpd-vhosts.conf"前面的"#"如下:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
(4)修改Apache配置文件httpd-vhosts.conf
httpd-vhosts.conf文件位置:C:Program FilesApache Software FoundationApache2.2confextra
在httpd-vhosts.conf文件中追加以下信息:
<VirtualHost *:80> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/from" ServerName from ErrorLog "logs/from-error.log" CustomLog "logs/from-access.log" common
</VirtualHost>
<VirtualHost *:80> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/to" ServerName to ErrorLog "logs/to-error.log" CustomLog "logs/to-access.log" common
</VirtualHost>
<VirtualHost *:80> DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/yourdomain" ServerName yourdomain ErrorLog "logs/yourdomain-error.log" CustomLog "logs/yourdomain-access.log" common
</VirtualHost>
(5)重新启动Apache
点击任务栏"Apache Service Monitor"图标(如果没有可以在"起头→所有法度→Apache HTTP Server 2.2"中找到):
呈现以下界面:
点击"Restart"按钮重新启动Apache。
步调四:拜候测试网页,进入谷歌 Analytics确认跨域跟踪数据
(1)拜候yourdomain
(2)点击链接:Multi-domain test
(3)点击链接:Link To Site to
(4)点击链接:Link To Site from
(5)此时可以在谷歌 Analytics的实时拜候述说中发现数据已经发送成功:
文章来历:数码林网站阐发博客,欢迎转载,但转载请注明出处。