+ -
当前位置:首页 → 问答吧 → 绑定域名后,本机测试其他网站问题。

绑定域名后,本机测试其他网站问题。

时间:2010-08-09

来源:互联网

我用一台计算机绑定一个域名后(将www.aaa.com的A记录指向xxx.xxx.xxx.xxx)

apache上这样设置的(windows的装的apache,版本2.2.8):

http.conf

# Virtual hosts
Include conf/extra/httpd-vhosts.conf


httd-vhosts.conf

NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#

<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot "X:/xxx/www/aaa.com"
  ServerName www.aaa.com
  ErrorLog "logs/dummy-host2.localhost-error.log"
  CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>


这样设置后可以访问www.aaa.com,但在本机上用http://localhost/yyy(yyy为apache网站更目录的其他网站程序的目录)访问提示:
The requested URL /yyy/ was not found on this server.

我该怎么设置来使本机也可以用类似http://localhost/yyy来测试一些程序呢?不知道说明白没有。

作者: hekeyphp   发布时间: 2010-08-09

再增加一个即可
<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot "X:/xxx/www/aaa.com"
  ServerName localhost
  ErrorLog "logs/dummy-host2.localhost-error.log"
  CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>

或者
ServerName www.aaa.com
ServerAlias localhost

作者: icy_csdn   发布时间: 2010-08-10

热门下载

更多