2016-11-10 49 views
0

我正在嘗試將虛擬主機配置到/ opt/lampp/htdocs的子目錄中。這是在httpd-vhost.conf文件:在lampp中配置localhost和virtalhost在儀表板中的重定向

NameVirtualHost *:80 
<VirtualHost localhost:80> 
ServerAdmin localhost 
DocumentRoot /opt/lampp/htdocs 
ServerName localhost 
<Directory /opt/lampp/htdocs>  
    Options All 
    AllowOverride All 
    Allow from all 
</Directory> 
</VirtualHost> 


<VirtualHost *:80> 
# This first-listed virtual host is also the default for *:80 
ServerName www.localhostwmf.com 
ServerAlias localhostwmf.com 
DocumentRoot /opt/lampp/htdocs/wmf 
DirectoryIndex index.php 
<Directory /opt/lampp/htdocs/wmf> 

    Options All 
    AllowOverride All 
    Allow from all 
</Directory> 
</VirtualHost> 

我註釋掉這一行的httpd.conf:

Include etc/extra/httpd-vhosts.conf 

而且我加入etc/hosts文件以下行:

127.0.0.1 www.localhostwmf.com 

但它總是在xampp的儀表板頁面中重定向我!預先感謝您的答案!

回答

0

我今天早上這個問題解決了,我希望這個解決方案將是有益的另一個問題:

我修改我的httpd-vhosts.conf文件,如下所示:

NameVirtualHost *:80 

<VirtualHost localhost:80> 
ServerAdmin localhost 
DocumentRoot /opt/lampp/htdocs/wmf 
ServerName localhost 
<Directory /opt/lampp/htdocs>  
    Options All 
    AllowOverride All 
    Allow from all 
</Directory> 
</VirtualHost> 


<VirtualHost *:80> 
# This first-listed virtual host is also the default for *:80 
ServerName www.localhostwmf.com 
ServerAlias localhostwmf.com 
DocumentRoot /opt/lampp/htdocs/wmf 
DirectoryIndex index.php 
<Directory /opt/lampp/htdocs/wmf> 

    Options All 
    AllowOverride All 
    Allow from all 
</Directory> 
</VirtualHost> 

(我加WMF文件夾在localhost文件根目錄下)

相關問題