Redmine sub-URI on Passenger: "Cannot resolve possible symlink ..."

797 views
Skip to first unread message

recurve7

unread,
Sep 22, 2010, 4:30:24 PM9/22/10
to Phusion Passenger Discussions
In reading every thread about this error that Google can find, I know
that the Apache error_log entry "Cannot resolve possible symlink ..."
coupled with a Phusion crash when accessing a Rails app via a
symlinked sub-URI is most likely an issue with how I've set up my
symlink, except that I've tried just about every permutation of
setting up the symlink now to no avail.

In particular, I think I have carefully followed the instructions from
Andrew Hodgkinson in the "OS X 10.6.2's Apache crashes when servicing
a request with Passenger" thread from Nov 18, 2009 (relevant text from
Andrew included at bottom).

Details:

CentOS
Apache 2.2.14

Relevant Apache conf entries:

LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/
gems/passenger-2.2.15/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/
passenger-2.2.15
PassengerRuby /opt/ruby-enterprise/bin/ruby

<VirtualHost *:80>
ServerName mysite.com
DocumentRoot /www/mysite.com/docroot
<Directory "/www/mysite.com/docroot">
Options FollowSymLinks
AllowOverride all
Order allow,deny
Allow from all
</Directory>
RailsEnv production
RailsBaseURI /redmine
<Directory "/www/mysite.com/docroot/redmine">
AllowOverride all
Options FollowSymLinks -MultiViews
</Directory>
</VirtualHost>

$ cd /www/mysite.com/docroot
$ ll redmine
lrwxrwxrwx 1 root root 19 Sep 22 12:58 redmine -> /opt/redmine/public

Relevant Apache Error Log entries:

terminate called after throwing an instance of
'Passenger::FileSystemException'
what(): Cannot resolve possible symlink '/www/mysite.com/docroot/
redmine': No such file or directory (2)
terminate called after throwing an instance of
'Passenger::FileSystemException'
what(): Cannot resolve possible symlink '/www/mysite.com/docroot/
redmine': No such file or directory (2)
[Wed Sep 22 12:59:32 2010] [notice] child pid 13216 exit signal
Aborted (6)
[Wed Sep 22 12:59:32 2010] [notice] child pid 13217 exit signal
Aborted (6)

The instructions I've followed, from Andrew's Nov 18, 2009 "OS X
10.6.2's Apache crashes when servicing a request with Passenger"
message:

For deploying in a sub-URI of "/myapp" I would need to have a symlink
somewhere that pointed to ".../myapp/public" in the local filesystem
and
set DocumentRoot to the directory in which this symlink resides; then
add
a RailsBaseURI of "/myapp". For example:

<VirtualHost *:80>
ServerName trackrecord.local
DocumentRoot "/path/to/folder/containing/symlink"
<Directory "/path/to/folder/containing/symlink">
Allow from all
</Directory>

RailsEnv development
RailsBaseUri "/name_of_symlink"

<Directory "/path/to/folder/containing/symlink/name_of_symlink">
Options -MultiViews
</Directory>
</VirtualHost>

matt connolly

unread,
Sep 23, 2010, 4:32:25 PM9/23/10
to Phusion Passenger Discussions
I had a similar problem. Along the way, I read somewhere abou a bug
where permission errors were incorrectly reported as unable to resolve
symlink... Can you apache user (www or nobody...) access /opt/
redmine ?

That user will also need to have write acces to "files" "log" and
"tmp" in the redmine directory.

Matt.

recurve7

unread,
Sep 23, 2010, 7:46:32 PM9/23/10
to Phusion Passenger Discussions
Thanks for the reply and the suggestions, Matt, although it appears
there's something more causing my "'Passenger::FileSystemException'
what(): Cannot resolve possible symlink '/www/mysite.com/docroot/
redmine" errors.

The Apache user on this system is 'apache', although it looks like
passenger-spawn-server is running as root:

$ ps -ef|grep apache

root 20194 10634 0 16:34 ? 00:00:00 /opt/ruby-enterprise/
lib/ruby/gems/1.8/gems/passenger-2.2.15/ext/apache2
ApplicationPoolServerExecutable 0 /opt/ruby-enterprise/lib/ruby/gems/
1.8/gems/passenger-2.2.15/bin/passenger-spawn-server /opt/ruby-
enterprise/bin/ruby /tmp/passenger.10634

apache 20348 10634 0 16:34 ? 00:00:00 /z/services/apache/
2.2.14-prefork/bin/httpd -k restart

And the 'apache' user owns /opt/redmine and everything below it and
it's all chmod 755. (To make sure, I just did another sudo chown -Rv
apache redmine and Passenger is still logging 'Cannot resolve possible
symlink ...' and crashing every time I browse to the sub-URI symlink
I've set up (http://mysite.com/redmine).

$ ll redmine

drwxrwxr-x 16 apache developers 4096 Sep 23 12:36 redmine

recurve7

unread,
Sep 28, 2010, 10:34:34 PM9/28/10
to Phusion Passenger Discussions
Has anyone had any ideas about why my symlink-ed sub-URI setup (below)
might be causing Passenger to crash?

candlerb

unread,
Oct 3, 2010, 3:41:41 AM10/3/10
to Phusion Passenger Discussions
On Sep 22, 9:30 pm, recurve7 <recur...@yahoo.com> wrote:
>   <Directory "/www/mysite.com/docroot">
>     Options FollowSymLinks
>     AllowOverride all
>     Order allow,deny
>     Allow from all
>   </Directory>
>   RailsEnv production
>   RailsBaseURI /redmine
>   <Directory "/www/mysite.com/docroot/redmine">
>     AllowOverride all
>     Options FollowSymLinks -MultiViews
>   </Directory>

I'm not 100% sure, but I think I needed to disable multiviews on the
real target directory, i.e. in your case

<Directory "/opt/redmine/public">
Options -MultiViews
</Directory>

You can test this by creating a file /opt/redmine/public/foo.html.en
and then curl http://mysite.com/redmine/foo.html

If it succeeds, then multiviews is enabled, which means your config is
broken.

> $ cd /www/mysite.com/docroot
> $ ll redmine
> lrwxrwxrwx 1 root root 19 Sep 22 12:58 redmine -> /opt/redmine/public

And what do

ls -ld / /opt /opt/redmine /opt/redmine/public
ls -l /opt/redmine/public
ls -l /opt/redmine/config/environment.rb

show?
Reply all
Reply to author
Forward
0 new messages