Setting up a ruby on rails server for use on my webpage

60 Views Asked by At

I have my own rack server and I host my own web server on it. pretty standard ubuntu 15.10 Linux, Nginx web server, PHP5, MySQL...

So assume everything there works right out of the box, the site-enabled conf is the only thing I changed to include index.php and such.

my ip address is linked to my domain name echobase.camp at domain.com

Cool now I can build all sorts of stuff like logins forms etc... fun times and late nights...

Now on top of this I want to add ruby / RoR on top of that --

Now there are 15 million how do it files out there on the web which all seem to point me to setting this up to run localhost or on one of their servers.

So here is where the problem lies -

If I plug in a monitor keyboard mouse - install a desktop to server I can get it to show localhost:3000 using the rails server` -- sweet I accomplished finding a default page.

-- not sweet part is there is no way to see this from my webpage --

rails server -b<my ip> -p <port I want to use> -- didn't work...

I thought of running apache2 as the web server for just ruby on rails app

-- screwed around with all that for awhile nothing seemed to work other than breaking things that I just had to fix --

-- tried a few things in nginx conf files to see if I could get it to go from there -- Yup just broke the files and had to fix them...

not sure what to do now...

so lets address this from here... really want to get into the nuts and bolts of ruby outside of a training environment, make things live to view from any web browser

1

There are 1 best solutions below

0
On

Try rails server -b 0.0.0.0 -p someport as it is one the things that had me stuck as well when I started.

In older versions the default for rails server was to bind to all addresses, this was then changed to be localhost only. You have to explicitly allow all IPs (0.0.0.0) for it to be accessible outside your local environment. I am guessing this is also the reason why most older guides might not have this bit mentioned.