2017-07-15 82 views
0

我希望配置我的XAMPP有2个不同的localhosts和站点,2个不同的根目录2个站点不同XAMPP根目录

让我们命名他们:1和Site2

但是当我尝试接取的SITE1的URL(例如:111.111.111.111:8090)他把我的文件夹选择

我解决了问题,把httpd.conf文件根目录放在我的SITE1目录根目录“C:/ xampp/htdocs/SITE1“),但现在是问题所在,有什么方法可以解决SITE2的问题?

我想访问SITE2的URL,例如:111.111.111.111:8091(因为我想指向某个域的DNS)并直接转到目录“C:/ xampp/htdocs/SITE2”而不是文件夹选择

+0

如果你认为你已经找到你要找的答案,请在下面标记为接受的答案(S) 。参考:https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – eeya

回答

0

打开与记事本++:C:\ XAMPP \阿帕奇\ CONF \的httpd.conf

添加此线下听80

Listen 8090 
Listen 8091 

打开与记事本++:C:\ XAMPP \ apache的\ conf \ extra \ httpd -vhosts.conf

追加新章节

<VirtualHost *:8090> 
    ServerAdmin [email protected] 
    DocumentRoot "/xampp/htdocs/site1" 
    ServerName site1.example.com 
    ErrorLog "logs/site1-error.log" 
    CustomLog "logs/site1-access.log" common 
</VirtualHost> 

<VirtualHost *:8091> 
    ServerAdmin [email protected] 
    DocumentRoot "/xampp/htdocs/site2" 
    ServerName site2.example.com 
    ErrorLog "logs/site2-error.log" 
    CustomLog "logs/site2-access.log" common 
</VirtualHost> 

重启Apache

打开http://localhost:8090/http://localhost:8091/

相关问题