Forum: Ruby on Rails Rails Deployment/Remote Access

76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-16 08:11
(Received via mailing list)
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
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2014-04-16 09:51
(Received via mailing list)
On 16 April 2014 00:09, Melb01 <melaggouni@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
5b8a4c3160bb28c094ad12f271bf6bd7?d=identicon&s=25 Maese (Guest)
on 2014-04-16 12:42
(Received via mailing list)
El miércoles, 16 de abril de 2014 01:09:20 UTC+2, Melb01 escribió:
>
> I am able to access it with http://<host name>:3000 when I start the  app
> with "rails s"
>
> rgds
>


start cheking the firewall and make a ping  to host name
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-16 20:11
(Received via mailing list)
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
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2014-04-16 20:18
(Received via mailing list)
On Apr 16, 2014, at 2:09 PM, Melb01 wrote:

> Thank you answering me
> I open the logs and I found this error:
> File does not exist: /var/www/myapp
>
> How to add it?
>

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
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-16 20:41
(Received via mailing list)
I found it, but it is an empty file, what line I have to add it?
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2014-04-16 21:11
(Received via mailing list)
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
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-16 21:24
(Received via mailing list)
it is the file in the directory: /etc/apache2
is there any other directory?
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2014-04-16 21:34
(Received via mailing list)
What server are you using? Ubuntu? Some other Linux? The only thing I
can tell you for certain is that it depends...

Walter
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-16 21:52
(Received via mailing list)
I am using ubuntu 10.04
A47e0a6beeb9d048ff054fc1c3a97418?d=identicon&s=25 Walter Davis (walterdavis)
on 2014-04-16 23:18
(Received via mailing list)
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
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-16 23:33
(Received via mailing list)
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
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-16 23:43
(Received via mailing list)
I resolved it, I copied the app directory to /var/www and chmod it
Is it safe to do like that?
46f52c33235283752423837b91c581dd?d=identicon&s=25 Norm Scherer (Guest)
on 2014-04-17 01:41
(Received via mailing list)
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
941056da1db23b2c0081e9c8d9416574?d=identicon&s=25 yan shi (Guest)
on 2014-04-17 08:35
(Received via mailing list)
if you are using Passenger, I recommend this
post
http://hlcfan.logdown.com/posts/139092-deploy-rail...
 and beside, did you check the difference between local and remote?


在 2014年4月16日星期三UTC+8上午7时09分20秒,Melb01写道:
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-21 23:49
(Received via mailing list)
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?
76841a063077b64ab9e9856841e22dda?d=identicon&s=25 Melb01 (Guest)
on 2014-04-21 23:57
(Received via mailing list)
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?
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.