Strange problem publishing a fresh Ruby on Rails 3 application on localhost (Apache, Passenger and VirtualHosts)

Posted by user502052 on Stack Overflow See other posts from Stack Overflow or by user502052
Published on 2011-01-07T00:12:37Z Indexed on 2011/01/07 0:54 UTC
Read the original article Hit count: 242

Filed under:
|
|
|

I recently created a new Ruby on Rails 3 application locally on a Mac OS, named "test".

Since I use apache2, in the private/etc/apache2/httpd.conf I set the VirtualHost for the "test" application:

<VirtualHost *:443>
  ServerName test.pjtmain.localhost:443
  DocumentRoot "/Users/<my_user_name>/Sites/test/public"

  RackEnv development

  <Directory "/Users/<my_user_name>/Sites/test/public">
    Order allow,deny
    Allow from all
  </Directory>

  # SSL Configuration
  SSLEngine on
  ...
</VirtualHost>

<VirtualHost *:80>
  ServerName test.pjtmain.localhost
  DocumentRoot "/Users/<my_user_name>/Sites/test/public"

  RackEnv development

  <Directory "/Users/<my_user_name>/Sites/test/public">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

Of course I restart apache2, but trying to access to http://test.pjtmain.localhost/ I have this error message from:

FIREFOX

Oops! Firefox could not find test.pjtmain.localhost
Suggestions:

    *
      Search on Google:
      ...

SAFARI

Safari can’t find the server.
Safari can’t open the page “http://test.pjtmain.localhost/” because Safari can’t find the server “test.pjtmain.localhost”.

I have other RoR3 applications setted like that above in the httpd.conf file and all them work.

What is the problem (maybe it is not related to apache...)?

Notes:

1. Using the 'Network Uility'

I did a Ping with the following result:

ping: cannot resolve test.pjtmain.localhost: Unknown host

and I did a Lookup with the follonwing result:

; <<>> DiG 9.6.0-APPLE-P2 <<>> test.pjtmain.localhost +multiline +nocomments +nocmd +noquestion +nostats +search
;; global options: +cmd
<MY_BROADBAND_TELECOMUNICATIONS_COMPANY_NAME>.com.  115 IN SOA dns1.<MY_BROADBAND_TELECOMUNICATIONS_COMPANY_NAME>.com. dnsmaster.<MY_BROADBAND_TELECOMUNICATIONS_COMPANY_NAME>.com. (
    2010110500 ; serial
    10800      ; refresh (3 hours)
    900        ; retry (15 minutes)
    604800     ; expire (1 week)
    86400      ; minimum (1 day)
    )

2. I am using Phusion Passenger

3. Since I not changed nothing to the new "test" application, I expect to see the default RoR index.html page:

alt text

4. It seems that in the 'Console Messages' there is any warning or error

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about apache