2014-10-21 4 views
7

어제 요세미티로 업그레이드 했으므로 웹 개발을위한 로컬 구성이 더 이상 작동하지 않습니다.Yosemite로 업그레이드 한 후 Apache 구성이 깨졌습니다.

나는 /Users/user/public_html에서 userdir을 설정했으며 localhost/~user/websitename을 통해 모든 웹 사이트에 액세스 할 수있었습니다. 특별한 것은 없지만 구성하는 데 시간이 걸렸습니다.

아파치 디렉토리를 보면 백업을 유지하면서 많은 파일이 교체 된 것을 알았습니다. 다시 설정을 사용하여 파일을 다시 넣으려고했지만 여전히 작동하지 않습니다. 어쩌면 내가 기억하지 못하는 파일이 없어 졌을 수도 있습니다.

# Settings for user home directories 
# 
# Required module: mod_userdir 

# 
# UserDir: The name of the directory that is appended onto a user's home 
# directory if a ~user request is received. Note that you must also set 
# the default access control for these directories, as in the example below. 
# 
UserDir public_html 

# 
# Users might not be in /Users/*/Sites, so use user-specific config files. 
# 
Include /private/etc/apache2/users/*.conf 
<IfModule bonjour_module> 
     RegisterUserSite customized-users 
</IfModule> 

<Directory "/Users/*/public_html/"> 
    AllowOverride FileInfo AuthConfig Limit Indexes 
     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec 
     Order allow,deny 
     Allow from all 
</Directory> 

그런하여 http.conf에 내가 설정 한 일부 모듈 :

Include /private/etc/apache2/extra/httpd-userdir.conf 
LoadModule userdir_module libexec/apache2/mod_userdir.so 

이 :

을 DocumentRoot "/ 사용자/사용자

이것은 아파치 - userdir.conf입니다/public_html "

Directory "/Users/user/public_html"> 
    # 
    # Possible values for the Options directive are "None", "All", 
    # or any combination of: 
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews 
    # 
    # Note that "MultiViews" must be named *explicitly* --- "Options All" 
    # doesn't give it to you. 
    # 
    # The Options directive is both complicated and important. Please see 
    # http://httpd.apache.org/docs/2.2/mod/core.html#options 
    # for more information. 
    # 
    Options Indexes FollowSymLinks MultiViews 

    # 
    # AllowOverride controls what directives may be placed in .htaccess files. 
    # It can be "All", "None", or any combination of the keywords: 
    # Options FileInfo AuthConfig Limit 
    # 
    AllowOverride all 

    # 
    # Controls who can get stuff from this server. 
    # 
    Order allow,deny 
    Allow from all 

</Directory> 

단순히 localhost에 액세스하려고하면 "It works!"라는 메시지가 표시됩니다. 내가 localhost/user에 가면 웹 사이트 중 하나에 액세스하려고하면로드되지 않고 똑같습니다.

파일을 놓쳤습니까? 아파치 로그에서 어떤 오류도 표시하지 않습니다.

+2

요세미티는 Apache를 2.2에서 2.4로 업그레이드합니다. 구성이 변경되었습니다. mod_userdir 모듈을 활성화 했습니까? 또한 "주문"및 "허용"지침을 변경하고자 할 것입니다. http://httpd.apache.org/docs/2.4/upgrading.html –

+1

미래의 독자는 [Mac OS X Yosemite에서 Apache, PHP 및 MySQL 설치]로 시작하려고 할 수 있습니다 (http : //jason.pureconcepts.net/2012/10/install-apache-php-mysql-mac-os-x/) * 올바른 방법 *. –

+0

또한 읽으십시오 [https://discussions.apple.com/thread/6602475#26885389](https://discussions.apple.com/thread/6602475#26885389) – luisnicg

답변

18

OS X 10.10 Yosemite는 Mavericks의 Apache 2.2 대신 Apache 2.4가 제공됩니다.
구성의 큰 차이는 ...와 ... ... 당신은 교체해야한다는

Order allow,deny 
Allow from all 

입니다

Require all granted 

자세한 내용 Upgrading to 2.4 from 2.2 설명서를 참조 아파치 문서의.

UPDATE :
다음 요세미티가 쓴 새에 OS의 X를 업그레이드 한 후에는 일반적으로 백업으로 이전 설정 파일을 찾을 수 있음을 유의하시기 바랍니다. 라벨에는 예를 들어 httpd.conf.pre-update 및/또는 httpd.conf ~ 이전이며 새 구성과 동일한 경로에서 찾을 수 있습니다 (예 : /개인/etc/apache2).

+0

httpd에있는 userdir을 언급하는 두 줄의 주석 처리를 제거하십시오. conf, httpd-userdir.conf에 Include의 주석 처리를 제거하고 위의 Guest.conf를 변경하면 마침내 ~ Guest 사이트가 수정되었습니다. 감사! – lionello

+0

아파치 설정 파일에'Order' 또는'Allow' 문자열이 보이지 않습니다 ... – Michael

+1

@Michael Apache 2.4를 새로 설치하면 주문이나 허용 줄을 찾을 수 없습니다. 그러나 Apache 2.2에서 기존 구성을 인계받는 경우 httpd.conf (예 : DocumentRoot 지시문 다음) 및 httpd-vhosts.conf (가상 호스트를 사용하는 경우)에서 해당 구성 요소를 확실히 찾아야합니다. – Jpsy

1

이 문제를 6 시간 동안 해결하려고 시도한 후에 마침내이 작업을 수행 할 수있었습니다. 나는 httpd.conf, httpd-userdir.conf, httpd-vhosts.conf 등을 편집했다. 요세미티 구성에서이 파일들을 편집하지 않고 남겨 두었던 것은 마침내 나를 위해 httpd_server_app를 편집하는 것이 었습니다.(각 사이트) 다음을 추가하여 /Library/Server/Web/Config/apache2/에있는 conf의 다음과 같이 당신이 기울어 인용의 자동 삽입을 취소이 파일을 편집 할 텍스트 편집기를 사용하는 경우

<Directory /> 
 
\t Options +FollowSymLinks 
 
\t AllowOverride All 
 
\t Order deny,allow 
 
\t Deny from all 
 
</Directory> 
 

 
<Directory "/Library/Server/Web/Data/Sites/Default/"> 
 
\t Options +Indexes +FollowSymLinks +MultiViews 
 
\t AllowOverride All 
 
\t Order allow,deny 
 
\t Allow from all 
 
</Directory> 
 

 
<Directory "/Library/Server/Web/Data/Sites/[OTHER SITE DIRECTORY]/"> 
 
\t Options +Indexes +FollowSymLinks +MultiViews 
 
\t AllowOverride All 
 
\t Order allow,deny 
 
\t Allow from all 
 
</Directory>

것이 확인 그렇지 않으면 유니 코드 오류 메시지가 나타납니다.

희망이 있습니다.

관련 문제