Forum: Ruby on Rails passenger on localhost

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mk 2. (Guest)
on 2009-06-05 21:49
I installed passenger at home.  How should I configure apache to make it
usable?
This was my last guess:

<VirtualHost localhost:3121>
    ServerName 127.0.0.1
    DocumentRoot /var/www/html/docsearch/public
</VirtualHost>

This gets by "apachectl start" without complaint, but I really haven't a
clue what I'm doing ;)

Do I need to access it via a different port?  Or could I just set up a
link in my /var/www/html/index.html page?
Steve R. (Guest)
on 2009-06-05 22:32
(Received via mailing list)
On Jun 5, 2009, at 10:49 AM, Mk 27 wrote:

>
> This gets by "apachectl start" without complaint, but I really
> haven't a
> clue what I'm doing ;)
>
> Do I need to access it via a different port?  Or could I just set up a
> link in my /var/www/html/index.html page?
> --

Edit your hosts file and point 127.0.0.1 to some local name like
docsearch.local. Then in your VirtualHost directive, use
docsearch.local:80. Or, if you're on a Mac, just install PassengerPane
and drag/drop the folder to there and forget about all the junk I just
said :)
Mk 2. (Guest)
on 2009-06-05 23:10
Steve R. wrote:

> Edit your hosts file and point 127.0.0.1 to some local name like
> docsearch.local.

127.0.0.1 already points to localhost and some other aliases.

> Or, if you're on a Mac, just install PassengerPane
> and drag/drop the folder to there and forget about all the junk I just
> said :)

I'm on linux, and I prefer to avoid GUI apps in programming as much as
possible (which IMO should always be possible).
Mk 2. (Guest)
on 2009-06-05 23:46
Okay, I added an alias for "dev.docsearch.net" and httpd.conf now
contains:

<VirtualHost *:80>
    ServerName dev.docsearch.net
    DocumentRoot "/var/www/html/docsearch/public/"
</VirtualHost>

which does take me to the index.html, but if I try a method I get a
rails message:

"We're sorry, but something went wrong."

Unfortunately, there is *absolutely no information* about the
"something" error to find, either in docsearch/logs or in the apache
logs.  Up to now I've just been working in a "development" environment.
Does that have anything to do with it?
Mk 2. (Guest)
on 2009-06-06 00:02
I added

<Directory /var/www/html/html/docsearch>
    RailsEnv "development"
</Directory>


But not luck...
Mk 2. (Guest)
on 2009-06-06 00:05
I find the addendum

"We've been notified about this issue..."

somewhat ironic as it is not true.  So fallacious, more than just
"ironic".
Mk 2. (Guest)
on 2009-06-06 03:55
Mk 27 wrote:
> I find the addendum
>
> "We've been notified about this issue..."
>
> somewhat ironic as it is not true.  So fallacious, more than just
> "ironic".


Does anyone actually use passenger?  Is there anyway to get it to
provide some trace output via apache, a la WEBrick?
Steve R. (Guest)
on 2009-06-06 07:52
(Received via mailing list)
Are you watching your logs? You should have all kinds of information
about what went wrong. Are you running in development or production
mode? Really, the Phusion documentation is kick-ass great. I would
guess that shared hosts are using Passenger, several VPS services I
know of are including it in their recommended Rails stack. I'm
currently running 5 sites on one server under Passenger.

Yeah, people are using it.
Mk 2. (Guest)
on 2009-06-06 13:39
Steve R. wrote:
> Are you watching your logs?  You should have all kinds of information
about what went wrong. Are you running in development or production
mode?

As I mentioned earlier, there is *NO* output to any logs by passenger,
other than

Apache/2.2.10 (Unix) DAV/2 Phusion_Passenger/2.2.2 configured --
resuming normal operations

Apache's log level is set to "debug".  There are 0 bytes in the actual
app logs. And there is at least an entire post here about my mode.  I
have the feeling we are using different software.

> Really, the Phusion documentation is kick-ass great.

I would feel that way too, if "Phusion Passenger" itself worked.  Since
my app runs fine under WEBbrick, I am kind of at a loss.

Certainly, it is not "kick-ass" to have the software throw up this
notice

"We're sorry, but something went wrong. We've been notified about this
issue."

and then do absolutely noting else (who is this "we" and how were they
"notified"?  Maybe it is inclusive, like:  "Here we are.  Something went
wrong! We -- including you -- have just been notified.  Goodbye!"  I
feel kind of like Dave talking to Hal, outside the air lock*.).  I would
say it was lame, but I don't want to offend anyone ;)


*like wow, what kick-ass software.  It lies!
Colin L. (Guest)
on 2009-06-06 15:24
(Received via mailing list)
2009/6/6 Mk 27 <removed_email_address@domain.invalid>:
> resuming normal operations
> Certainly, it is not "kick-ass" to have the software throw up this
>
Are you sure the 'something went wrong' message is not from your
public/500.html file?

Colin
Rick D. (Guest)
on 2009-06-06 16:57
(Received via mailing list)
On Sat, Jun 6, 2009 at 5:39 AM, Mk 27<removed_email_address@domain.invalid>
wrote:
> resuming normal operations
Anything in the rails log for your environment which should be in
/var/www/html/docsearch/log

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
Rahmat Budiharso (Guest)
on 2009-06-06 17:38
(Received via mailing list)
I use passenger to, and it works like a charm.
this is what i got in my /etc/apache2/sites-available/rails

<VirtualHost *:80>
   ServerName rpdam.local
   DocumentRoot /home/rahmat/Rails-Projects/pdam/public
   RailsEnv development
</VirtualHost>

and this is in my /etc/hosts

127.0.0.1 rpdam.local

hopes this helps...
Mk 2. (Guest)
on 2009-06-06 20:24
Rahmat Budiharso wrote:
> I use passenger to, and it works like a charm.
> this is what i got in my /etc/apache2/sites-available/rails
>
> <VirtualHost *:80>
>    ServerName rpdam.local
>    DocumentRoot /home/rahmat/Rails-Projects/pdam/public
>    RailsEnv development
> </VirtualHost>

I had it like this:

<VirtualHost *:80>
    ServerName dev.docsearch.net
    DocumentRoot "/var/www/html/docsearch/public/"
</VirtualHost>

<Directory /var/www/html/docsearch>
   RailsEnv development
</Directory>

Which I copied that from the Phusion webpage documentation.  Anyway,
moving "RailsEnv ..." into the VirtualHost block worked.  I guess that
documentation kicked my ass!

Thanks Rahmat.
alexey (Guest)
on 2009-06-07 09:05
(Received via mailing list)
"We're sorry, but something went wrong. We've been notified about this
issue."
It is a rails error, and maybe you are in production mode,
My apache conf:
NameVirtualHost site.com:80
<VirtualHost www.site.com:80>
    ServerName www.site.com
    RailsEnv development
    RailsAllowModRewrite off
    DocumentRoot /var/www/site/public
</VirtualHost>

and its running fine in development.
Check /log dir, and look for development.log file,.
Ahmet K. (Guest)
on 2010-05-29 21:16
alexey wrote:
> "We're sorry, but something went wrong. We've been notified about this
> issue."
> It is a rails error, and maybe you are in production mode,
> My apache conf:
> NameVirtualHost site.com:80
> <VirtualHost www.site.com:80>
>     ServerName www.site.com
>     RailsEnv development
>     RailsAllowModRewrite off
>     DocumentRoot /var/www/site/public
> </VirtualHost>
>
> and its running fine in development.
> Check /log dir, and look for development.log file,.

it is Ok for me also.
But why it is not working with RailsEnv production???
Is it not a bit strange!?:(
Steve R. (Guest)
on 2010-05-30 00:52
(Received via mailing list)
Ahmet K. wrote:
>>      DocumentRoot /var/www/site/public
>> </VirtualHost>
>>
>> and its running fine in development.
>> Check /log dir, and look for development.log file,.
>
> it is Ok for me also.
> But why it is not working with RailsEnv production???
> Is it not a bit strange!?:(

So, if I understand correctly, the exact stuff from httpd.conf that
you've shown above works, but it fails if you change to RailsEnv
production?

Have you looked at your Apache error_log and/or
/path/to/app/log/production.log? Maybe there's a clue there. It seems an
exception is being raised and you are seeing the default error page. If
that's the case, then there should be a log entry.
Ahmet K. (Guest)
on 2010-05-30 17:50
Steve R. wrote:
> Ahmet K. wrote:
>>>      DocumentRoot /var/www/site/public
>>> </VirtualHost>
>>>
>>> and its running fine in development.
>>> Check /log dir, and look for development.log file,.
>>
>> it is Ok for me also.
>> But why it is not working with RailsEnv production???
>> Is it not a bit strange!?:(
>
> So, if I understand correctly, the exact stuff from httpd.conf that
> you've shown above works, but it fails if you change to RailsEnv
> production?
>
> Have you looked at your Apache error_log and/or
> /path/to/app/log/production.log? Maybe there's a clue there. It seems an
> exception is being raised and you are seeing the default error page. If
> that's the case, then there should be a log entry.

nothing different than others people logs.
That reason I told it is a bit strange.
and What is the difference between development and production env.?
If I can find it I can solve my problem.
Steve R. (Guest)
on 2010-05-30 22:43
(Received via mailing list)
Ahmet K. wrote:
>>> Is it not a bit strange!?:(
> nothing different than others people logs.
> That reason I told it is a bit strange.
> and What is the difference between development and production env.?
> If I can find it I can solve my problem.

The differences are numerous, but primarily they revolve around
ActiveRecord optimizations, exceptions are gobbled up, files are not
reloaded between requests when they change, and of course the logging
level is lower.

My configuration looks like this:

<VirtualHost *:80>
   ServerName foosball.local
   DocumentRoot "/Users/foos/Developer/Rails/foosball/public"
   RailsEnv production
   <Directory "/Users/foos/Developer/Rails/foosball/public">
     Order allow,deny
     Allow from all
   </Directory>
</VirtualHost>

As I recall, you are using <VirtualHost somename:80>

That shouldn't matter, though.

Try setting your production log level to (production.rb)

ActiveRecord::Base.logger.level = :debug
config.whiny_nils = true

See:
http://guides.rubyonrails.org/debugging_rails_appl...

This is also grasping at straws, because what it seems is happening is
that something is raising an exception in your app and it's being
rescued in public (default in production, not development).

Remind me ... what OS?
This topic is locked and can not be replied to.