虚拟主机上的XAMPP [英] VirtualHost on XAMPP
问题描述
我使用的Windows 7精简版的XAMPP,但不是的http://本地主机
我想有的http:// mycustomname
映射到根目录/ htdocs下一个目录 MyFolder中
。
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.
我应该怎么改在httpd.conf?
What should I change in httpd.conf?
非常感谢!
推荐答案
添加到您的XAMPP \\ apache的\\的conf \\额外\\的httpd-vhosts.conf文件:
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>
现在编辑C:\\ WINDOWS \\ SYSTEM32 \\ DRIVERS \\等\\主机和添加新行:
Now edit c:\windows\system32\drivers\etc\hosts and add a new line:
127.0.0.1 mycustomname
这将导致Windows解决您的自定义名称为127.0.0.1。重新启动Apache和您可以访问你的网站。
Which will cause Windows to resolve your custom name to 127.0.0.1. Restart Apache and you can access your site.
这篇关于虚拟主机上的XAMPP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!