Rails Deployment/Remote Access

106 views
Skip to first unread message

Melb01

unread,
Apr 15, 2014, 7:09:20 PM4/15/14
to rubyonra...@googlegroups.com
Hi,
I developped a rails application and I wanted to deploy it,
I get a dedicated server, and I installed the necessary package: rails, apache2, passenger
and I deploy it locally with success and I access it with: http://myapp

when I tried to access it from a remote server with tthe url : http://<host name>/myapp
I get the error message 404 not found, what am I doing wrong

I am able to access it with http://<host name>:3000 when I start the  app with "rails s"

rgds

Colin Law

unread,
Apr 16, 2014, 3:49:25 AM4/16/14
to rubyonra...@googlegroups.com
On 16 April 2014 00:09, Melb01 <melag...@gmail.com> wrote:
> Hi,
> I developped a rails application and I wanted to deploy it,
> I get a dedicated server, and I installed the necessary package: rails,
> apache2, passenger
> and I deploy it locally with success and I access it with: http://myapp
>
> when I tried to access it from a remote server with tthe url : http://<host
> name>/myapp
> I get the error message 404 not found, what am I doing wrong

There are very many things that could be going wrong so to answer it
with such limited data is impossible. The first thing you should do
is look in the various logs and see where it is failing. Starting
with the apache logs I guess.

Colin

Maese

unread,
Apr 16, 2014, 6:41:45 AM4/16/14
to rubyonra...@googlegroups.com
start cheking the firewall and make a ping  to host name 

Melb01

unread,
Apr 16, 2014, 2:09:47 PM4/16/14
to rubyonra...@googlegroups.com
Thank you answering me
I open the logs and I found this error:
File does not exist: /var/www/myapp

How to add it?


rgds

Walter Lee Davis

unread,
Apr 16, 2014, 2:16:51 PM4/16/14
to rubyonra...@googlegroups.com
I'm going to take a WAG here, and say that this was boilerplate in the Passenger configuration code that you got when you installed the Passenger application server. Try opening your httpd.conf file, locate that line there, and replace it (two places, in a normal Apache config file) with the actual root-relative path to your application's public folder on the server disk.

Or better, tell us which app server and which Web server you are using.

Walter

>
> rgds
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/56fbed1d-90e4-421a-bbfa-db6d8147a87f%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Melb01

unread,
Apr 16, 2014, 2:39:57 PM4/16/14
to rubyonra...@googlegroups.com
I found it, but it is an empty file, what line I have to add it?

Walter Lee Davis

unread,
Apr 16, 2014, 3:10:51 PM4/16/14
to rubyonra...@googlegroups.com
On Apr 16, 2014, at 2:39 PM, Melb01 wrote:

> I found it, but it is an empty file, what line I have to add it?

Then you haven't found the right file.

Walter
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/1168c685-e82c-4ec0-9c1e-e2fdc09da5b7%40googlegroups.com.

Melb01

unread,
Apr 16, 2014, 3:23:12 PM4/16/14
to rubyonra...@googlegroups.com
it is the file in the directory: /etc/apache2
is there any other directory?

Walter Lee Davis

unread,
Apr 16, 2014, 3:32:48 PM4/16/14
to rubyonra...@googlegroups.com
What server are you using? Ubuntu? Some other Linux? The only thing I can tell you for certain is that it depends...

Walter
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7ef676d5-c45d-4c47-9015-06e20b836ce6%40googlegroups.com.

Melb01

unread,
Apr 16, 2014, 3:51:21 PM4/16/14
to rubyonra...@googlegroups.com
I am using ubuntu 10.04

Walter Lee Davis

unread,
Apr 16, 2014, 5:16:44 PM4/16/14
to rubyonra...@googlegroups.com
In the apache2 folder, you should see a pair of folders named sites-available and sites-enabled. Inside sites-available, you will find one or more text files, each of which contains the configuration for a single name-based virtual host. If you see default and default-ssl (or similar) in there, then edit the default file.

sites-enabled contains symbolic links to the files in sites-available, which allows you to disable a site without removing its configuration file. If you add more sites to this server, you're going to want to create new config files based on default. Once you do, be sure to add a link to the file (original is in -available, link goes in -enabled).

Walter
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/cd42710a-0ebc-4a0f-b93d-a9b976d00b53%40googlegroups.com.

Melb01

unread,
Apr 16, 2014, 5:32:09 PM4/16/14
to rubyonra...@googlegroups.com
I already did that and I myapp file in both directories but I am not able to access the app remotely
I used the gem speedy to deploy the app

Melb01

unread,
Apr 16, 2014, 5:41:39 PM4/16/14
to rubyonra...@googlegroups.com
I resolved it, I copied the app directory to /var/www and chmod it
Is it safe to do like that?

Norm Scherer

unread,
Apr 16, 2014, 7:40:14 PM4/16/14
to rubyonra...@googlegroups.com
I deploy my app in a similar manner using virtual hosts on apache2 with passenger.  To do this I need to define a hostname with dns though you could do it by putting the hostname in /etc/hosts on both the server and client.  That is what I do for local testing.  From what you indicate I think you need put the appropriate entries in /etc/hosts and address http://myapp.

Norm
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

yan shi

unread,
Apr 16, 2014, 9:31:00 PM4/16/14
to rubyonra...@googlegroups.com
if you are using Passenger, I recommend this post http://hlcfan.logdown.com/posts/139092-deploy-rails-app-with-passenger-and-nginx
 and beside, did you check the difference between local and remote?


在 2014年4月16日星期三UTC+8上午7时09分20秒,Melb01写道:

Melb01

unread,
Apr 21, 2014, 5:48:02 PM4/21/14
to rubyonra...@googlegroups.com
Hi, thx for the answer but I am using passenger with apache2
I put myapp to the default site in apache and it worked but when I add a new site and I try to access with
http://hostname/myapp
I get the error message: 

The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved.


How to solve thios problem, do I need to do something with /etc/hosts?

Melb01

unread,
Apr 21, 2014, 5:56:33 PM4/21/14
to rubyonra...@googlegroups.com
I added the ip of the server in my /etc/hosts and it worked, it is great
what I have to do, if I want to link myapp to a domainname?
Reply all
Reply to author
Forward
0 new messages