Rails Deployment/Remote Access

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:///myapp I get the error message 404 not found, what am I doing wrong

I am able to access it with http://:3000 when I start the app with “rails s”

rgds

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

start cheking the firewall and make a ping to host name

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

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

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

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

it is the file in the directory: /etc/apache2 is there any other directory?

What server are you using? Ubuntu? Some other Linux? The only thing I can tell you for certain is that it depends...

Walter

I am using ubuntu 10.04

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

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

I resolved it, I copied the app directory to /var/www and chmod it Is it safe to do like that?

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

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写道:

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?

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?