Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Mar 08, 2012 10:58 pm 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
Hello,
I'm a newbie to this, so I appreciate you patience and help. I'm trying to start mongrel running and not getting anywhere real fast.

I type the command to start:

mongrel_rails start -a IPAddress -e production -c /home/path -l log/mongrel.log -p 80 -d

The log shows it started fine:

from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
send'
from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
run'
from /home/path/config/environment.rb:64
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
... 9 levels...
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:19:in `load'
from /usr/bin/mongrel_rails:19

However, netstat doesn't show it running:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 4362/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 4182/sshd
tcp6 0 0 :::11211 :::* LISTEN 4389/memcached
tcp6 0 0 :::22 :::* LISTEN 4182/sshd

But if I type ps aux | grep mongrel it does show it running, but I don't think on port 80:

root 4611 0.0 0.0 1848 236 hvc0 S+ 21:10 0:00 grep --colour=auto mongrel

Of course the website isn't reachable. I sure would appreciate some detailed pointers to figuring this out! Thanks


Top
   
PostPosted: Fri Mar 09, 2012 12:29 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
FatCat wrote:
But if I type ps aux | grep mongrel it does show it running, but I don't think on port 80:

root 4611 0.0 0.0 1848 236 hvc0 S+ 21:10 0:00 grep --colour=auto mongrel

No, this only shows that the grep mongrel process (which you started as part of the ps command pipeline) is running. Either your mongrel server has exited or something has killed it off. Does it produce any log files? Those might have useful details.


Top
   
 Post subject:
PostPosted: Fri Mar 09, 2012 12:41 am 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
Are you running mongrel as root? (You must be root to bind port numbers below 1024.)

Do you have anything else running on port 80, like Apache or nginx?


Top
   
PostPosted: Fri Mar 09, 2012 1:11 am 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
Vance wrote:
FatCat wrote:
But if I type ps aux | grep mongrel it does show it running, but I don't think on port 80:

root 4611 0.0 0.0 1848 236 hvc0 S+ 21:10 0:00 grep --colour=auto mongrel

No, this only shows that the grep mongrel process (which you started as part of the ps command pipeline) is running. Either your mongrel server has exited or something has killed it off. Does it produce any log files? Those might have useful details.


This is all the mongrel logs show:

from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
send'
from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
run'
from /home/path/config/environment.rb:64
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
... 9 levels...
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:19:in `load'
from /usr/bin/mongrel_rails:19

Is there a different log file I should look at?


Top
   
 Post subject:
PostPosted: Fri Mar 09, 2012 1:16 am 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
hybinet wrote:
Are you running mongrel as root? (You must be root to bind port numbers below 1024.)

Do you have anything else running on port 80, like Apache or nginx?


It is running as root, or at least I'm logged in as root when I type the command to start it.

I'm not sure how to tell what else might be running on port 80. Is there a command I can type that will show everything running on port 80?


Top
   
 Post subject:
PostPosted: Fri Mar 09, 2012 5:07 am 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Code:
netstat -lpntu
will show you what's listening on your server, it'll output something like
Code:
netstat -lpntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      20394/nginx: worker

It's the local address you want to look at

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
PostPosted: Fri Mar 09, 2012 8:31 am 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
FatCat wrote:
This is all the mongrel logs show:

from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
send'
from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
run'
from /home/path/config/environment.rb:64
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
... 9 levels...
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:19:in `load'
from /usr/bin/mongrel_rails:19

Is there a different log file I should look at?


That's a ruby traceback. That means it did not start successfully; rather, it crashed on line 19 of /usr/bin/mongrel_rails.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
PostPosted: Fri Mar 09, 2012 12:00 pm 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
hoopycat wrote:
FatCat wrote:
This is all the mongrel logs show:

from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
send'
from /home/path/config/../vendor/rails/railties/lib/initializer.rb:49:in `
run'
from /home/path/config/environment.rb:64
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
... 9 levels...
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:19:in `load'
from /usr/bin/mongrel_rails:19

Is there a different log file I should look at?


That's a ruby traceback. That means it did not start successfully; rather, it crashed on line 19 of /usr/bin/mongrel_rails.


Here is the contents of mongrel_rails, but it doesn't have 19 lines:

li86-249 bin # tail mongrel_rails

version = ">= 0"

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end

gem 'mongrel', version
load 'mongrel_rails'


Top
   
 Post subject:
PostPosted: Fri Mar 09, 2012 12:02 pm 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
obs wrote:
Code:
netstat -lpntu
will show you what's listening on your server, it'll output something like
Code:
netstat -lpntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      20394/nginx: worker

It's the local address you want to look at


mongrel certainly isn't listed here.

li86-249 bin # netstat -lpntu
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 4362/mysqld
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 4182/sshd
tcp6 0 0 :::11211 :::* LISTEN 4389/memcached
tcp6 0 0 :::22 :::* LISTEN 4182/sshd
udp 0 0 0.0.0.0:11211 0.0.0.0:* 4389/memcached


Top
   
PostPosted: Fri Mar 09, 2012 2:59 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
FatCat wrote:
Here is the contents of mongrel_rails, but it doesn't have 19 lines:

li86-249 bin # tail mongrel_rails


How many lines does it have? Which line number is that "load 'mongrel_rails'" on? Something tells me that's probably the culprit.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
PostPosted: Fri Mar 09, 2012 4:36 pm 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
hoopycat wrote:
FatCat wrote:
Here is the contents of mongrel_rails, but it doesn't have 19 lines:

li86-249 bin # tail mongrel_rails


How many lines does it have? Which line number is that "load 'mongrel_rails'" on? Something tells me that's probably the culprit.


Assuming that the initial blank line should be counted as line 1, then the load mongrel_rails command is line 10.

li86-249 bin # tail mongrel_rails
1)
2) version = ">= 0"
3)
4) if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
5) version = $1
6) ARGV.shift
7)end
8)
9)gem 'mongrel', version
10) load 'mongrel_rails'


Top
   
 Post subject:
PostPosted: Fri Mar 09, 2012 7:07 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
'tail' only shows the last 10 lines of the file... try 'cat' or (for longer files) 'less'.


Top
   
 Post subject:
PostPosted: Fri Mar 09, 2012 7:33 pm 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
hoopycat wrote:
'tail' only shows the last 10 lines of the file... try 'cat' or (for longer files) 'less'.


Sorry about that:

li84-37 bin # cat mongrel_rails
#!/usr/bin/ruby18
#
# This file was generated by RubyGems.
#
# The application 'mongrel' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0"

if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
version = $1
ARGV.shift
end

gem 'mongrel', version
load 'mongrel_rails'


Top
   
 Post subject:
PostPosted: Sat Mar 10, 2012 1:20 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Ah, so it is the load command that's failing. Based on the name of the file, is it trying to load itself? (I know almost nothing about Ruby.)

BTW, you can use cat -n file or nl -ba file to number lines on a printout, or less -N file for interactive viewing.


Top
   
 Post subject:
PostPosted: Mon Mar 12, 2012 4:44 pm 
Offline
Senior Newbie

Joined: Thu Mar 08, 2012 10:45 pm
Posts: 10
I've started mongrel_rails in the foreground and am able to see different messages than from reviewing the log:

** Starting Rails with production environment...
/home/cbws/relaystrategy_cbw/vendor/rails/activerecord/lib/active_record/connection_adapters/abstrac
t/connection_specification.rb:217:in `establish_connection': production database is not configured (
ActiveRecord::AdapterNotSpecified)
from /home/cbws/relaystrategy_cbw/vendor/rails/activerecord/lib/active_record/connection_ada
pters/abstract/connection_specification.rb:208:in `establish_connection'
from /home/cbws/relaystrategy_cbw/config/../vendor/rails/railties/lib/initializer.rb:234:in
`initialize_database'
from /home/cbws/relaystrategy_cbw/config/../vendor/rails/railties/lib/initializer.rb:94:in `
process'
from /home/cbws/relaystrategy_cbw/config/../vendor/rails/railties/lib/initializer.rb:49:in `
send'
from /home/cbws/relaystrategy_cbw/config/../vendor/rails/railties/lib/initializer.rb:49:in `
run'
from /home/cbws/relaystrategy_cbw/config/environment.rb:64
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
... 9 levels...
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
from /usr/bin/mongrel_rails:19:in `load'
from /usr/bin/mongrel_rails:19


Does this help anybody?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group