httpd.conf的配置文件下加上下面,最简单的配置方法
打开\AppServ\Apache2.2\conf下的httpd.conf的配置文件,
上面的任何配置都不要动,直接在最下面加上下面这段话
NameVirtualHost 192.168.1.104
<VirtualHost 192.168.1.104>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot d:/AppServ/www/docs/
ServerName test.abcd.com
ErrorLog logs/test.abcd.com-error_log
CustomLog logs/test.abcd.com-access_log commom
</virtualHost>
<VirtualHost 192.168.1.104>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot d:/AppServ/www/docs2/
ServerName abc.fsdfsdf.com
ErrorLog logs/abc.fsdfsdf.com-error_log
CustomLog logs/abc.fsdfsdf.com_log commom
</virtualHost>
其中192.168.1.104是IP,如果是公网IP,那就直接写你的公网IP
打开\AppServ\Apache2.2\conf下的httpd.conf的配置文件,
上面的任何配置都不要动,直接在最下面加上下面这段话
NameVirtualHost 192.168.1.104
<VirtualHost 192.168.1.104>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot d:/AppServ/www/docs/
ServerName test.abcd.com
ErrorLog logs/test.abcd.com-error_log
CustomLog logs/test.abcd.com-access_log commom
</virtualHost>
<VirtualHost 192.168.1.104>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot d:/AppServ/www/docs2/
ServerName abc.fsdfsdf.com
ErrorLog logs/abc.fsdfsdf.com-error_log
CustomLog logs/abc.fsdfsdf.com_log commom
</virtualHost>
其中192.168.1.104是IP,如果是公网IP,那就直接写你的公网IP