xampp:托管多个站点 [英] xampp: hosting multiple sites

查看:93
本文介绍了xampp:托管多个站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行xampp的Web服务器.我有两个域名,可以将它们称为www.domain1.com和www.domain2.com.我已经更新了domain1的dns设置,使其指向可以正常工作的服务器,(例如,domain1的文件位于htdocs文件夹中,当我在浏览器中访问www.domain1.com时,我会获得这些文件的索引文件.)我想做的是在htdocs文件夹中有两个文件夹(一个用于domain1,一个用于domain2).如果我将domain1和domain2的dns设置都更改为都指向我的服务器ip,那么我可以配置xampp或apache来根据请求的URL加载正确的站点吗?

谢谢

解决方案

是的,这很容易做到.您只需要在apache中创建1或2个虚拟主机.这是通过在xampp安装中编辑/apache/conf/extra/httpd-vhosts.conf文件来完成的.该文件应包含所需的详细信息.必须重新启动Apache才能进行更改.

I have a web server running xampp. I have two domain names lets call them www.domain1.com and www.domain2.com. I have updated the dns settings of domain1 to point to my server which is working fine, (i.e the files for domain1 are in the htdocs folder and when i go to www.domain1.com in a browser i get the index file of these files.) What I would like to do though is have two folders in the htdocs folder (one for domain1 and one for domain2). If i change the dns settings of domain1 and domain2 to both point to my servers ip, can i then configure xampp or apache to load the right site depending on what url has been requested?

Thanks

解决方案

Yes this is easy to do. You simply need to create 1 or 2 virtual hosts in apache. This is done by editing the /apache/conf/extra/httpd-vhosts.conf file in your xampp installation. The file should have the details in it that you need. Apache will need to be restarted for the changes to happen.

这篇关于xampp:托管多个站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆