SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    May 2007
    Location
    Denmark.
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.

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

  2. #2
    SitePoint Member kabeerg512's Avatar
    Join Date
    Jun 2010
    Location
    Mumbai,India
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you wanted to list only names and phone numbers, you could create phone.rhtml, accessible via http://localhost:3000/addresses/phone.

  3. #3
    SitePoint Member
    Join Date
    May 2007
    Location
    Denmark.
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by kabeerg512 View Post

    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

  4. #4
    SitePoint Guru downtroden's Avatar
    Join Date
    Dec 2004
    Location
    illinois
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    your brain reacts in the same way whether you are
    looking at something or thinking about it...

  5. #5
    SitePoint Member
    Join Date
    May 2007
    Location
    Denmark.
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by downtroden View Post
    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.
    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

  6. #6
    SitePoint Guru downtroden's Avatar
    Join Date
    Dec 2004
    Location
    illinois
    Posts
    971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do by chance have the firewall on, blocking access to port 3000?
    your brain reacts in the same way whether you are
    looking at something or thinking about it...

  7. #7
    SitePoint Member
    Join Date
    May 2007
    Location
    Denmark.
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by downtroden View Post
    do by chance have the firewall on, blocking access to port 3000?
    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


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •