2013-04-17 26 views
0

我似乎無法讓我的虛擬主機工作......認爲我對我所做的事毫無頭緒。VirtualHosts不能正常工作?

的httpd.conf

NameVirtualHost * 

<VirtualHost *> 
    ServerName localhost 
    DocumentRoot "/Applications/MAMP/bin/mamp" 
    <Directory "/Applications/MAMP/bin/mamp"> 
     Options Indexes FollowSymLinks Includes execCGI 
     AllowOverride None 
     Order Allow,Deny 
     Allow From All 
    </Directory> 
</VirtualHost> 

# rev.dev 
<VirtualHost *> 
    ServerName revcms.dev 
    DocumentRoot "/Users/manuel/Sites/Rev" 
    <Directory "/Users/manuel/Sites/Rev"> 
     Options Indexes FollowSymLinks Includes execCGI 
     AllowOverride None 
     Order Allow,Deny 
     Allow From All 
    </Directory> 
</VirtualHost> 

etc/hosts中

## 
# Host Database 
# 
# localhost is used to configure the loopback interface 
# when the system is booting. Do not change this entry. 
## 


255.255.255.255 broadcasthost 
::1    localhost 
fe80::1%lo0 localhost 

127.0.0.1 rev.dev 

我絕對不知道我在做什麼錯,http://rev.dev的作用一樣127.0.0.1 任何幫助嗎?

回答

0

想通了。我注意到我的@終端命令不工作,所以刪除.bashrc,.bash_profile等,它的工作。

謝謝反正! @Ryan

0

從命令行運行httpd -S(注意大寫S)並從那裏調試。

對於初學者,您的/etc/hosts文件表示服務器名稱爲rev.dev,但您的虛擬主機表示服務器爲revcms.dev

將您的虛擬主機文件更改爲rev.dev並重新啓動apache。