I currently have the below command running as a batch script
/usr/local/rvm/wrappers/ruby-1.8.7-p358/ruby /var/rails/sandbox/script/server -p 8080 -e sandbox -d
However the log ends at trying to initialize 0.0.0.0 8080
if I remove the -d so the script is
/usr/local/rvm/wrappers/ruby-1.8.7-p358/ruby /var/rails/sandbox/script/server -p 8080 -e sandbox
then everything runs perfect. The only issue is I am trying to detach the output so I can reuse the terminal session.
Please let me know if there is something I need to run?
Also just an fyi if I were to run the script/server alone I would have to use rvmsudo script/server -p 8080 -e sandbox -d, I get the same issue of it trying to end at 0.0.0.0 8080 but my site will not run and I will not get the message WEBrick::HTTPServer#start
Related
On my computer, I can start redmine by:
cd /usr/share/redmine
bundle exec rails server webrick -e production -p 3001
and this will start redmine just fine at port 3001.
If I create a bash script, it always starts at port 3000, like the parameters were ignored.
What am I doing wrong ?
This is what I have
#!/bin/bash
#exec /usr/lib/x86_64-linux-gnu/opera/opera --no-sandbox $#
cd /usr/share/redmine
# Port from settings file will be ignored either way ...
#bundle exec rails -p 3003 server webrick -e production
bundle exec rails server webrick -e production -p 3001
Quickly checked that and found that your script works perfectly fine for me, changing the port in the script also changes the port WEBrick is listening at.
So nothing wrong with the script.
I'm having a hard time running a container from the Ghost image in development (after docker pull ghost).
Using:
docker run --name some-ghost -p 4000:2368 -v /Users/Documents/ghost-blog/content/themes/:/var/lib/ghost/content/themes/ -e NODE_ENV=development ghost
seems to start the container in development but when I navigate to the page in browser I get
localhost didn’t send any data. ERR_EMPTY_RESPONSE
I've tried looking this up but it seems like development was previously the default environment until recently. I'm not really sure where to proceed.
According to acburdine's answer, you need to specify further environment variables:
docker run --name some-ghost -p 4000:2368 -v /Users/Documents/ghost-blog/content/themes/:/var/lib/ghost/content/themes/ -e NODE_ENV=development -e server__host=0.0.0.0 -e url="http://localhost:2368" ghost
I developed a Ruby On Rails application and want to deploy in production (intranet).
As of now i created an sh file to run the passenger like so:
cd /pathofmyapp
passenger start -a 0.0.0.0 -p 3000 -d -e production
cd /pathofmyapp2
passenger start -a 0.0.0.0 -p 3000 -d -e production
When the ubuntu server starts i have to execute the sh or manually start the passenger.
Is their a way to automate this so that whenever the ubuntu server starts, the command will automatically run or the ruby on rails application will start?
Thanks in advance.
You can add that to your cronjob to run the code on reboot.
#reboot cd /pathofmyapp && passenger start -a 0.0.0.0 -d -e production
I am trying to configure my own "Thingspeak" server on Ubuntu 12.04 LTS virtual machine. I introduced this commands on terminal (installation on clean install of ubuntu): https://github.com/iobridge/ThingSpeak but at the final I use:
rvmsudo rails server -d -b <myip> -p 80
This command let me run Thingspeak app on port 80 as a daemon. It works well, but when the server reboot (sudo reboot for example) the thingspeak server shut down and I don't want this, I want to automatically (on booting or startup) start the thingspeak server so I don't need to manually use in terminal the rvmsudo command again.
How can I achieve this?
You can add to:
/etc/rc.local
rvmsudo rails server -d -b -p 80
or add it to /etc/init.d as well
Updating this:
sudo nano /etc/rc.local
Add the following before the exit 0 line:
cd <folder path>
rvmsudo rails server -d -b -p 80
I'm starting the Rails 3 application with the following command:
passenger start -a 0.0.0.0 -p 3000 -d
but how do I tell passenger to start the application in production environment?
passenger start -a 0.0.0.0 -p 3000 -d -e production
Side note: always check the help, passenger start --help would have told you the same.