CrunchyToast

Active Member
May 13, 2011
28
0
51
Yakima, WA
cPanel Access Level
DataCenter Provider
I have an app that runs on port 12009 and I start it just fine via cPanel, but if I use the command from the app directory, it does not start.

# /usr/bin/ruby script/server -p 12009 -d
=> Booting Mongrel
=> Rails 2.3.14 application starting on http://0.0.0.0:12009
The app does not start. I'm trying to find the command to make it run so I can configure Monit to restart it if it crashes. The config might be a little odd as I had to use this guide to make the app work.

Any help would be wonderful. Thanks in advance!
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
The command indicates the application is starting, so you are stating it doesn't actually start, but how are you determining this is the case?

Have you reviewed the logs at /home/username/rails_apps/appname/log/ location? Please note that username is the cPanel username and appname is the application name in the path indicated.
 

CrunchyToast

Active Member
May 13, 2011
28
0
51
Yakima, WA
cPanel Access Level
DataCenter Provider
The log didn't change at all when I ran it and also I could not access the app. Also in cPanel it showed the app as not running and that's how I left it all night. Today I tried to access the app with no change from last night and it's instantly working. If I kill the PID and run the start command again, it isn't available via web access. Do I need to restart Apache too or something?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Please check if the application is running by checking via ps aux on the port number:

Code:
ps aux | grep 12009
Next, which log are you even checking? There are typically 2 log files, the mongrel log and the development or production log. Please provide the output on date stamps for both and then review both.
 

CrunchyToast

Active Member
May 13, 2011
28
0
51
Yakima, WA
cPanel Access Level
DataCenter Provider
I've got both logs open and I'm watching them with the tail -f command. After running the command to start the app, neither of the logs changed - production.log and mongrel.log.

root 5960 0.0 0.0 103292 840 pts/3 S+ 22:20 0:00 grep 12009
mongrel.log AFTER command /usr/bin/ruby script/server -p 12009 -d is blank as is production.log.

Still tailing both logs and starting the app via cPanel then displays the following upon the app startup:

** Daemonized, any open files are closed. Look at log/mongrel.pid and log/mongrel.log for info.
** Starting Mongrel listening at 0.0.0.0:12009
** Starting Rails with production environment...
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
** Rails signals registered. HUP => reload (without restart). It might not work well.
** Mongrel 1.1.5 available at 0.0.0.0:12009
** Writing PID file to log/mongrel.pid
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Could you ps aux the command cPanel is using in SSH? You can again use the same port to find what command it is running.