Use of MAC computer as remote webserver

Hello ror developers.
I Have a small Ruby on Rails program on a MAC home computer,
and wan’t to use this home computer, at the same time, as a web server with this same Ruby on Rails program being connectable from Internet and another of my computers.
I ask this question here because many rails developers has mac knowledge.

  1. ABOUT THE PROGRAM on home computer, local use:
    Pointing home computer to:
    http://localhost:3000/user/list responds “hello world” as expected.
    user and list is controller and action.
    So this Ruby on Rails program works well enough through the local server, Mongrel I guess.
    I know my Home computer IP address: http://nn.nnn.nnn.nn.bredband.3.dk/~erikaaaa/, This information is available from Mac System preferences if you set the WEB SHARE flag to ON then you can read the IP address.

  2. CONNECTING TO HOME COMPUTER FROM ANOTHER COMPUTER, remote use.
    Now, I wish to run the Rails program from another computer, actually the program is a browser on my Windows Mobile Phone which has its own internet connection.

Pointing the Windows Mobile Phone to:

http://nn.nnn.nnn.nn.bredband.3.dk/~erikaaaa/ responds the index.html page which is located on home computer in the (home) Sites folder.

Pointing the Windows Mobile Phone to:
http://nn.nnn.nnn.nn.bredband.3.dk/ responds a page with the text “it works”, I don’t know where this page is located???

Something surely works.

I think that these 2 requests are answered automatically by the mac os, the mac os respond when it receives a http request. Some server is in action, but which server, is it build into mac os. Mogrel is stopped and I have not started another.

  1. my question to you is: which address (request) should I point to from the phones webbrowser in order to connect to the Rails program located in a app0 folder???

Comments and answeres are very much appriciated.

kind regards
Erik

Home computer: mac mini, snow leopard, internet connection over USB broadband
Phone: Samsung i780, os = Windows Mobile 6.0.

downtroden
thanks for the answer

I tried local
Started the mongrel server from just within then application folder.
By this process I think that Mongrel is configured to point to the beginning of the application.
Pointed to http://localhost:3000
Safari responded with WELCOME ABOARD as expected

I tried external
Pointed to http://nn.nnn.nnn.nn.bredband.3.dk:3000
the browser responded: searching, opening… TIMEOUT while processing

I tried external + user
Pointed to http://nn.nnn.nnn.nn.bredband.3.dk/~eriknnnn:3000
the browser responded: NOT FOUND the requested URL /~eriknnnn:3000 was not found on this server
Also there is no activity registered on the Terminal window.

can you give a possibility

Erik

downtroden
Right, turned off firewall and
IT all WORKS NOW

thanks a lot

(I will think about bringing the app into Apache server as you suggested)

Erik

do by chance have the firewall on, blocking access to port 3000?

the problem is that when you come at it from an external device, you’re using the wrong url. The url you’re given in the control panel is for the built in apache server that’s installed with the OS, which communicates via port 80… you want 3000.

You can do one of two things. Integrate your rails instance into the apache server (if you expect high traffic to site or just want a :3000less url) OR just use http://nn.nnn.nnn.nn.bredband.3.dk:3000 from your phone/external machine. That’ll use the mongrel server that rails runs on.

if you wanted to list only names and phone numbers, you could create phone.rhtml, accessible via http://localhost:3000/addresses/phone.

yes, if I point to: http://localhost:3000/addresses/phone , from my HOME COMPUTER it WILL WORK.

but if I point from another computer or a phone it will not work.

that is the problem

Erik