开发者

VirtualHost on XAMPP

开发者 https://www.devze.com 2023-01-20 14:01 出处:网络
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.

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

精彩评论

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