
Recientemente configuré Capistrano en mi servidor y funciona muy bien.
Cambié mis hosts virtuales para que apunten al enlace simbólico creado por Capistrano.
Mi archivo de hosts virtuales:
<VirtualHost *:80>
DocumentRoot /var/www/html/my_app.com/current
ServerName my_app.com
<Directory />
Options FollowSymLinks
AllowOverride Indexes
</Directory>
</VirtualHost>
Cuando reinicio mi servidor Apache usando sudo service httpd restart
, aparece el error:
Warning: DocumentRoot [/var/www/html/my_app.com/current] does not exist
El current
directorio definitivamente existe. Cuando configuro el vhost para que apunte a .../my_app.com/
, funciona y muestra la página predeterminada de Apache, el problema es este enlace simbólico current
(que se actualiza a medida que implemento aplicaciones usando capistrano).
Estoy usando una instancia de Amazon ec2, apache 2.2 (LAMP).
Básicamente, ¿cómo apunto un host virtual a un enlace simbólico?
Actualizar La salida de
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
En mis httpd.conf
(comentarios eliminados):
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Mis registros de errores:
[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/
La salida de ls -l
for /var/www/html/my_app.com/releases/20120828223949
.
drwxrwxr-x 6 ec2-user ec2-user 4096 Aug 28 22:39 20120828223949
Cuando ejecuto el comandols -l /var/www/html/my_app.com/current/
ls: cannot access /var/www/html/my_app.com/current/: No such file or directory
Parece un enlace simbólico muerto... ¿Cómo soluciono esto?
Respuesta1
Según mi comentario y su seguimiento, parece que su current
enlace simbólico no apunta a un objetivo válido; elimínelo y vuelva a agregarlo:
$ rm -f /var/www/html/my_app.com/current
$ ln -s /var/www/html/my_app.com/{releases/20120828223949,current}