开发者

VirtualHost on XAMPP

I'm using XAMPP lite on Windows 7, but instead of http://localhost I'd like to have http://mycustomname mapped to a directory myfolder in root/开发者_开发技巧htdocs.

What should I change in httpd.conf?

Many thanks!


Add to your xampp\apache\conf\extra\httpd-vhosts.conf file:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName mycustomname
    ServerAlias mycustomname
    DocumentRoot "c:\xampp\htdocs\myfolder"
</VirtualHost>

Now edit c:\windows\system32\drivers\etc\hosts and add a new line:

127.0.0.1        mycustomname

Which will cause Windows to resolve your custom name to 127.0.0.1. Restart Apache and you can access your site.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜