가상 호스트 및 심볼릭 링크, DocumentRoot를 심볼릭 링크로 설정할 수 없는 이유는 무엇입니까?

가상 호스트 및 심볼릭 링크, DocumentRoot를 심볼릭 링크로 설정할 수 없는 이유는 무엇입니까?

나는 최근 내 서버에 Capistrano를 설치했는데 훌륭하게 작동합니다.
Capistrano가 만든 심볼릭 링크를 가리키도록 가상 호스트를 변경했습니다.
내 가상 호스트 파일:

<VirtualHost *:80>
    DocumentRoot /var/www/html/my_app.com/current
    ServerName my_app.com
    <Directory />
    Options FollowSymLinks
        AllowOverride Indexes
    </Directory>
</VirtualHost>

을 사용하여 Apache 서버를 다시 시작하면 sudo service httpd restart오류가 발생합니다.

Warning: DocumentRoot [/var/www/html/my_app.com/current] does not exist

디렉토리 current가 확실히 존재합니다. 가상 호스트가 을 가리키도록 설정하면 .../my_app.com/작동하고 기본 아파치 페이지가 표시됩니다. 문제는 이 심볼릭 링크입니다 current(capistrano를 사용하여 애플리케이션을 배포할 때 업데이트됨).

Amazon ec2 인스턴스인 Apache 2.2(LAMP)를 사용하고 있습니다.

기본적으로 가상 호스트를 심볼릭 링크로 지정하려면 어떻게 해야 합니까?


업데이트 출력 ls-l:

lrwxrwxrwx 1 ec2-user ec2-user   57 Aug 28 22:40 current -> /var/www/html/my_app.com/releases/20120828223437
drwxrwxr-x 3 ec2-user ec2-user 4096 Aug 28 22:40 releases
drwxrwxr-x 6 ec2-user ec2-user 4096 Aug 28 16:01 shared

httpd.conf(댓글은 제거됨):

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order allow,deny
    Allow from all
</Directory>

내 오류 로그:

[Wed Aug 29 00:04:39 2012] [error] [client 87.194.51.136] Symbolic link not allowed or link target not accessible: /var/www/html/my_app.com/current
[Wed Aug 29 00:04:40 2012] [error] [client 128.30.52.73] Symbolic link not allowed or link target not accessible: /var/www/html/my_app.com/current
[Wed Aug 29 00:04:40 2012] [error] [client 87.194.51.136] Symbolic link not allowed or link target not accessible: /var/www/html/my_app.com/current, referer: http://mydomain.com/

ls -lfor 의 출력입니다 /var/www/html/my_app.com/releases/20120828223949.

drwxrwxr-x 6 ec2-user ec2-user 4096 Aug 28 22:39 20120828223949

명령을 실행할 때ls -l /var/www/html/my_app.com/current/

ls: cannot access /var/www/html/my_app.com/current/: No such file or directory

죽은 심볼릭 링크인 것 같습니다. 이 문제를 어떻게 해결합니까?

답변1

내 의견과 후속 조치에 따르면 심볼릭 current링크가 유효한 대상을 가리키지 않는 것 같습니다. 그것을 제거하고 다시 추가하십시오 :

$ rm -f /var/www/html/my_app.com/current
$ ln -s /var/www/html/my_app.com/{releases/20120828223949,current}

관련 정보