Forum: Ruby on Rails Apache2 - local host works; external route error

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
581701974a12a858692f53cd1d3a8bdb?d=identicon&s=25 Michae; (Guest)
on 2005-12-13 07:24

Hi -

I have a RoR installation on debian sarge, serving with Apache2. On the
same machine I also have a phpmyadmin serving. I made a entry in the
/etc/apache2/sites-available/<appname>  and did a2ensite <appname> .
Also, I edited /etc/hosts to add <appname> to the localhost line at the
end, as per directions I found in the Rails Wiki.

These are the symptoms:

From localhost I can get to a controller page with

w3m http://<appname>/<controllername>

and I see the scaffolded data come up. From the external ip I can do

http://<ipaddress>/<appname>/

and I get the welcome to RoR welcome page. So the virtual host setup
seems to work in the

/etc/apache2/sites-available/<appname>

file. However, if I try

http://<ipaddress>/<appname>/<controllername>...

I get a route error. Even though this works for localhost with  w3m
http://<ipaddress>/<appname>/ from the command line.

I have an Alias directive in the virtual host file that reads:

Alias /<appname> /var/www/rails/<appname>/public

without that alias, I wasn't getting the RoR welcome page from external
before.

The phpmyadmin was also broken after adding my rails virtual host entry
until I added an alias in /etc/phpmyadmin/apache.conf:

Alias /phpmyadmin /var/www/phpmyadmin

How do I get the pages that are serving from my rails app to localhost
to appear on port 80 from external requests? Anyone else with similar
problems?
953c18019bceaa294ae0429bef6ab388?d=identicon&s=25 Norman Timmler (Guest)
on 2005-12-13 11:39
(Received via mailing list)
Am Dienstag, den 13.12.2005, 07:24 +0100 schrieb Michae;:
>
>
>
> How do I get the pages that are serving from my rails app to localhost
> to appear on port 80 from external requests? Anyone else with similar
> problems?

You have to specify the host entry for the IP of your server on every
computer you want to access the rails application or point a DNS entry
to your server.

The aliases you defined are for the default Apache VHost. This is why
you get the welcome page or PHPMyAdmin under http://<ipaddress>/<alias>.
5550d5400b6e15c911cff206dc7543bd?d=identicon&s=25 Michael (Guest)
on 2005-12-15 06:14
Norman Timmler wrote:
> Am Dienstag, den 13.12.2005, 07:24 +0100 schrieb Michae;:
>>
>>
>>
>> How do I get the pages that are serving from my rails app to localhost
>> to appear on port 80 from external requests? Anyone else with similar
>> problems?
>
> You have to specify the host entry for the IP of your server on every
> computer you want to access the rails application or point a DNS entry
> to your server.
>
> The aliases you defined are for the default Apache VHost. This is why
> you get the welcome page or PHPMyAdmin under http://<ipaddress>/<alias>.


But, if this was the case, would i be able to reach the
public/index.html page from outside? I can do this, but get a routing
error if I try to get to the railsapp.

Thanks for the help . . .
This topic is locked and can not be replied to.