# Apache2 - local host works; external route error

**URL:** <https://www.ruby-forum.com/t/apache2-local-host-works-external-route-error/50121>\
**Category:** Rails\
**Created:** [December 13, 2005, 7:24am UTC](https://www.ruby-forum.com/t/apache2-local-host-works-external-route-error/50121 "2005-12-13T07:24:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michae](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@Michae](https://www.ruby-forum.com/u/Michae)\
**Post date:** [December 13, 2005, 7:24am UTC](https://www.ruby-forum.com/t/apache2-local-host-works-external-route-error/50121/1 "2005-12-13T07:24:16Z")

</div>

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/ and did a2ensite .  
Also, I edited /etc/hosts to add 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:///

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

http:////

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

/etc/apache2/sites-available/

file. However, if I try

http:////

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

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

Alias / /var/www/rails//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?

---

<div class="post-metadata">

**Author:** ![Michae](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@Michae](https://www.ruby-forum.com/u/Michae)\
**Post date:** [December 13, 2005, 11:39am UTC](https://www.ruby-forum.com/t/apache2-local-host-works-external-route-error/50121/2 "2005-12-13T11:39:57Z")

</div>

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:///.

---

<div class="post-metadata">

**Author:** ![Michae](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/9fc348/32.png) [@Michae](https://www.ruby-forum.com/u/Michae)\
**Post date:** [December 15, 2005, 6:14am UTC](https://www.ruby-forum.com/t/apache2-local-host-works-external-route-error/50121/3 "2005-12-15T06:14:17Z")

</div>

Norman T. 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:///.

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 . . .
