2013-04-17 2 views
0

가상 호스트를 설정하려고하고 내가 무엇을 잘못하고 있는지 확신 할 수 없습니다. apachectl을 실행하면이 경고 메시지가 나타납니다.Mountain Lion apache vhost

$ sudo apachectl -t 
httpd: Could not reliably determine the server's fully qualified domain name, using Johns-MacBook-Pro.local for ServerName 
[Tue Apr 16 21:34:01 2013] [warn] _default_ VirtualHost overlap on port 80, the first has precedence 
Syntax OK 

그래서 모든 일이 최고의 유령으로 되돌아 가고 있습니다. 여기에 아직 서버 이름을 정의하지 않았기 때문에 내 가상 호스트가,

<VirtualHost *:80> 
    DocumentRoot "/Users/jcostanzo/development/impress" 
    ServerName impress.local 
    ServerAlias impress.local 
    ErrorLog "/private/var/log/apache2/impress.local-error_log" 

    <Directory "/Users/jcostanzo/development/impress" > 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

<VirtualHost *:80> 
    DocumentRoot "/Users/jcostanzo/development/testsomething" 
    ServerName testing.local 
    ServerAlias testing.local 
    ErrorLog "/private/var/log/apache2/test.local-error_log" 

    <Directory "/Users/jcostanzo/development/testsomething" > 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

답변

0

첫 번째 경고

httpd: Could not reliably determine the server's fully qualified domain name, using Johns-MacBook-Pro.local for ServerName 

당신이 얻을 파일입니다. 호스트 이름은 localhost입니다

ServerName localhost 

보다 당신이 더 이상이 경고를받지 않습니다 : 쉽게 /private/etc/apache2/httpd.conf에서 정의합니다. 좀 더 정보가 여기에 있습니다 : httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

두 번째 경고 : 당신이 당신의 가상 호스트 파일에

NameVirtualHost *:80 

을 없기 때문에

[Tue Apr 16 21:34:01 2013] [warn] _default_ VirtualHost overlap on port 80, the first has precedence 

아마 나타납니다. 표준

/private/etc/apache2/extra/httpd-vhosts.conf
파일을 수정 했습니까?

NameVirtualHost *:80 

<VirtualHost *:80> 
    ServerName impress.local 
    ServerAlias www.impress.local 
    DocumentRoot "/Users/jcostanzo/development/impress" 
    ErrorLog "/private/var/log/apache2/impress.local-error_log" 
    <Directory "/Users/jcostanzo/development/impress" > 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

<VirtualHost *:80> 
    ServerName testing.local 
    ServerAlias www.testing.local 
    DocumentRoot "/Users/jcostanzo/development/testsomething" 
    ErrorLog "/private/var/log/apache2/test.local-error_log" 
    <Directory "/Users/jcostanzo/development/testsomething" > 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
    </Directory> 
</VirtualHost> 

실행

apachectl -S
보고, 아파치 구성을 받아들이는 경우 : 그것은 당신이
ServerName
이 구성을 다시 시도로
ServerAlias
에 대해 동일한 URL을하고 작업을해야하는 것도 조금 이상하다.

관련 문제