本来以为上一次的配置就搞定了,结果本地测试好好的,到了服务器上调试就完蛋了,本地只测试了一个asp站和一个jsp站,而实际情况是多个asp站和jsp站,又试了两次还是不行,终于在第三次尝试后搞定了,写下来做个纪念。
第一次尝试使用:
<VirtualHost *:80>
ServerAdmin feifei0658@sina.com
ServerName www.5hope.com
DcumentRoot "G:\5hope
DirectoryIndex index.html index.htm index.asp
第一次尝试使用:
<VirtualHost *:80>
ServerAdmin feifei0658@sina.com
ServerName www.5hope.com
DcumentRoot "G:\5hope
DirectoryIndex index.html index.htm index.asp
Tags: Apache
从httpd.conf中 打开虚拟机
>apachectl restart
Syntax error on line 33 of /usr/local/etc/apache22/extra/httpd-vhosts.conf:
CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional "env=" clause (see docs)
如果在httpd-vhosts.conf中注释掉下面这句启动就不会有问题。
>apachectl restart
Syntax error on line 33 of /usr/local/etc/apache22/extra/httpd-vhosts.conf:
CustomLog takes two or three arguments, a file name, a custom log format string or format name, and an optional "env=" clause (see docs)
如果在httpd-vhosts.conf中注释掉下面这句启动就不会有问题。
windows下 C:\WINDOWS\system32\drivers\etc 文件夹内 hosts 里加上
127.0.0.1 www.domain.com
127.0.0.1 bbs.domain.com
127.0.0.1 www.domain.com
127.0.0.1 bbs.domain.com
127.0.0.1 www.domain.com
127.0.0.1 bbs.domain.com 其中 www.domain.com 与 bbs.domain.com 共享同一个网站,目录为 D:\web\bbs\webapps\ROOT
在Apache 的 conf\httpd.conf 里修改
<VirtualHost *:80>
127.0.0.1 www.domain.com
127.0.0.1 bbs.domain.com
127.0.0.1 www.domain.com
127.0.0.1 bbs.domain.com
127.0.0.1 www.domain.com
127.0.0.1 bbs.domain.com 其中 www.domain.com 与 bbs.domain.com 共享同一个网站,目录为 D:\web\bbs\webapps\ROOT
在Apache 的 conf\httpd.conf 里修改
<VirtualHost *:80>