2014-01-26 1 views
0

xampp을 저의 mavericks에 설치 했으므로 가상 호스트를 구성 할 때도 혼자서 할 수 있다고 생각했지만 여전히 작동하지 않습니다. 나는 어디서나 문제를 발견 할 수 없다. 나는 그 파일과 관련이있을 수있는 모든 파일을 보았고, /etc/hosts 파일을 ../xamppfiles/etc/extra/httpd-vhosts.conf../xamppfiles/etc/httpd.conf으로 재 작성했다. 그러나 브라우저로 가서 지정한 가상 호스트 주소를 입력하면, 그것은 나에게 Google 검색을 던졌습니다. 나는 또 다른 가상 호스트를 추가하려고 시도했지만 동일하게 발생합니다.xampp은 가상 서버에서 가상 호스트를 설정합니다

내 가상 호스트 파일은 다음과 같다 : 하여 NameVirtualHost * : 80 나는 또한 호스트의 바닥에이 줄을 추가 한

# localhost 
<VirtualHost *:80> 
ServerName "localhost" 
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/xampp" 
<Directory "/Applications/XAMPP/xamppfiles/htdocs/xampp"> 
    Options Indexes FollowSymLinks Includes execCGI 
    AllowOverride All 
    Allow From All 
    Order Allow,Deny 
</Directory> 
</VirtualHost> 


# My custom host 
<VirtualHost *:80> 
ServerName "site1.local" 
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/site1" 
<Directory "/Applications/XAMPP/xamppfiles/htdocs/site1"> 
    Options Indexes FollowSymLinks Includes ExecCGI 
    Order allow,deny 
    Allow from all 
    AllowOverride All 
    Require all granted 
</Directory> 
ErrorLog "Applications/XAMPP/xamppfiles/htdocs/site1/site1.local-error_log" 
</VirtualHost> 

가 파일 :

# XAMPP VirtualHost mappings 
127.0.0.1 site1.local 

을 그리고있는 라인을 주석 처리 아파치 .conf

Include etc/extra/httpd-vhosts.conf 

나는 .htaccess 파일을 htaccess로 이름을 바꾸고 모든 내용을 주석 처리합니다./

I는 각각 아파치 서버를 다시 시작하는 것을 잊지 didnt가 - :

나는 정말로 그것은 여전히 ​​나던 작업하는 그 밖의 무엇을 잘 모릅니다.

답변

1

vhost 파일에 백 슬래시가 없습니다.

# localhost 
<VirtualHost *:80> 
ServerName "localhost" 
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/xampp" 
<Directory "/Applications/XAMPP/xamppfiles/htdocs/xampp/"> 
    Options Indexes FollowSymLinks Includes execCGI 
    AllowOverride All 
    Allow From All 
    Order Allow,Deny 
</Directory> 
</VirtualHost> 
# My custom host 
<VirtualHost *:80> 
ServerName "site1.local" 
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/site1" 
<Directory "/Applications/XAMPP/xamppfiles/htdocs/site1/"> 
    Options Indexes FollowSymLinks Includes ExecCGI 
    Order allow,deny 
    Allow from all 
    AllowOverride All 
    Require all granted 
</Directory> 
ErrorLog "Applications/XAMPP/xamppfiles/htdocs/site1/site1.local-error_log" 
</VirtualHost> 

넣어 브라우저 http://site1.local/ 에 그것은 작동한다 : 그것은해야처럼 보인다.