简体   繁体   English

在xampp中设置vhost

[英]setting up vhost in xampp

I am facing a minor problem while setting up vhost in xampp os - windows. 我在xampp os - windows中设置vhost时遇到了一个小问题。 here is the httpd-vhosts.conf in C:\\xampp\\apache\\conf\\extra\\httpd-vhosts.conf 这里是httpd-vhosts.confC:\\xampp\\apache\\conf\\extra\\httpd-vhosts.conf

<VirtualHost *:80>
  DocumentRoot "C:/xampp/htdocs/yiisite/basic/web/"
  ServerName yiisite

and in hosts file located C:\\Windows\\System32\\drivers\\etc\\hosts hosts文件位于C:\\Windows\\System32\\drivers\\etc\\hosts

    127.0.0.1 yiisite

so when i hit i get http://yiisite i get what i want, but all other folders inside htdocs that i use to open in localhost/abc is all going to yiisite template 404 not found . 所以,当我点击我得到http://yiisite我得到我想要的,但我用于在localhost/abc打开的htdocs内的所有其他文件夹都将找到yiisite模板404。 cannot access other projects inside htdocs with localhost . 无法使用localhost访问htdocs中的其他项目。 if i change the port in vhosts.conf i can access localhost/abc but not yiisite 如果我在vhosts.conf中更改端口,我可以访问localhost / abc但不能访问yiisite

changing the httpd-vhosts.conf to httpd-vhosts.conf

<VirtualHost 127.0.0.1:80>
 DocumentRoot "C:/xampp/htdocs/yiisite/basic/web/"
 ServerName yiisite
</VirtualHost>

solved the issue of conflicting with other projects inside htdocs and can access with localhost/otherproject 解决了与htdocs内部其他项目冲突的问题,可以使用localhost/otherproject访问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM