Web app on Mac personal web sharing

  1. 5 years ago

    Michel B

    17 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com

    Just wondering : would it be possible to run a web app in the Mac personal web sharing ? How would one go about it ?

    @Michel B So, if this is possible, could you please be so kind to teach me step by step how to run a standalone app on the Mac and make it available through a local network to other computers ?

    I'll give you a rough outline. Expanding each into detail is a good 2 to 3 hours of training.

    1. Build standalone app.
    2. Run from Terminal, e.g.
          cd [path to MyApp]
           ./MyApp --port=3000 --maxSockets=100 &

    or
    Create a certificate file in same directory as MyApp.

          ./MyApp --securePort=3000 --maxSecureSockets=100 &

    3. Open port 3000 in any firewall you have, and/or port forward from your router.

    HTH.

  2. Andre K

    17 May 2014 Pre-Release Testers

    http://www.cnet.com/how-to/how-to-enable-web-sharing-in-os-x-mountain-lion/

    I think this would get you going! Wish you success!

  3. Michel B

    17 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com

    @Andre K http://www.cnet.com/how-to/how-to-enable-web-sharing-in-os-x-mountain-lion/

    I think this would get you going! Wish you success!

    Thank you Andre. I already know how to activate the personal web sharing for HTML.

    Since my post, I did find how to activate CGI for it at:
    http://www.macdevcenter.com/pub/a/mac/2001/12/14/apache_two.html

  4. Brad H

    17 May 2014 Down here on the farm.

    @Michel B Just wondering : would it be possible to run a web app in the Mac personal web sharing ? How would one go about it ?

    I can't imagine a scenario where one might be tempted to use PWS where a stand-alone deployment on that Mac wouldn't be easier and better. But I have no imagination today, so YMMV.

  5. Michel B

    17 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com
    Edited 5 years ago

    @Brad H I can't imagine a scenario where one might be tempted to use PWS where a stand-alone deployment on that Mac wouldn't be easier and better. But I have no imagination today, so YMMV.

    My imagination maybe limited by lack of knowledge, and I would love to be enlightened. I never used standalone Web apps anywhere. Just CGI. So, if this is possible, could you please be so kind to teach me step by step how to run a standalone app on the Mac and make it available through a local network to other computers ?

    Thank you in advance.

  6. Brad H

    17 May 2014 Answer Down here on the farm.

    @Michel B So, if this is possible, could you please be so kind to teach me step by step how to run a standalone app on the Mac and make it available through a local network to other computers ?

    I'll give you a rough outline. Expanding each into detail is a good 2 to 3 hours of training.

    1. Build standalone app.
    2. Run from Terminal, e.g.
          cd [path to MyApp]
           ./MyApp --port=3000 --maxSockets=100 &

    or
    Create a certificate file in same directory as MyApp.

          ./MyApp --securePort=3000 --maxSecureSockets=100 &

    3. Open port 3000 in any firewall you have, and/or port forward from your router.

    HTH.

  7. Michel B

    17 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com
    Edited 5 years ago

    Thank you. Followed your outline with a program called weblistbox built as standalone..

    [2] 1621
    [1]   Exit 126                ./weblistbox --port=80 --maxsockets=100
    Mitchs-iMac:weblistbox Mitch$ -bash: ./weblistbox: cannot execute binary file

    weblistbox is set as chmod 755...
    Did you say it was easy ?

  8. Brad H

    17 May 2014 Down here on the farm.

    I think I said "easier". One note... you'll need to be root to serve on ports <= 1023. Did you build for Mac OS X? You'd get a similar error if you tried to run the Linux binary on OS X I think.

  9. Michel B

    17 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com
    Edited 5 years ago

    @Brad H I think I said "easier". One note... you'll need to be root to serve on ports <= 1023. Did you build for Mac OS X? You'd get a similar error if you tried to run the Linux binary on OS X I think.

    OK. Easier. Got it. Thank you. I had built for Linux. Built again for Mac this time, and the program launched.

    Now I have the process running. But how do I access the web app ?

    With http://192.168.1.34:80 which is the IP of my Mac or 127.0.0.1:80 all I access is the personal web sharing index.html :(

  10. Andre K

    17 May 2014 Pre-Release Testers

    The default port for stand-alone webapps is 8080, did you change it to 80?
    Both ip-numbers should work and also the name 'localhost'.

  11. Michel B

    17 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com

    @Andre K The default port for stand-alone webapps is 8080, did you change it to 80?
    Both ip-numbers should work and also the name 'localhost'.

    I have now changed to 8080 and access the app through http://127.0.0.1:8080 and http://192.168.1.34:80 from other computers :)

    it is indeed easier than setting up WPS Apache for cgi-bin, I had to understand the steps involved.

    Thank you for your help.

  12. Andre K

    17 May 2014 Pre-Release Testers

    Then you were a victim of the < 1024 port number barriere of Apple ;) . Glad to hear it works. :D

  13. Brad H

    17 May 2014 Down here on the farm.

    @Michel B I have now changed to 8080 and access the app through http://127.0.0.1:8080 and http://192.168.1.34:80 from other computers :)

    it is indeed easier than setting up WPS Apache for cgi-bin, I had to understand the steps involved.

    Thank you for your help.

    I have found that time is better spent by most getting over this hurdle than dealing with the can of worms that the "ease" of cgi deployments opens up, regardless of platform. But yeah, it's a hurdle.

  14. Michel B

    17 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com

    @Brad H I have found that time is better spent by most getting over this hurdle than dealing with the can of worms that the "ease" of cgi deployments opens up, regardless of platform. But yeah, it's a hurdle.

    My experience with cgi came from perl on a host, and I quite naturally deployed cgi over my web sites. Lucky I was that my VPS readily took Xojo web apps, and afterward that 1701 came along. So I never had to wonder about standalone.

    Now, I still have a question : is it possible to access a standalone app without explicitly enter the port number ?

  15. Brad H

    17 May 2014 Down here on the farm.

    @Michel B Now, I still have a question : is it possible to access a standalone app without explicitly enter the port number ?

    Sure, create a "wrapper" page (PHP/HTML) and embed the app in a frame. The frame could even take up the whole page, so visually, the user would have no idea what's going on. Serve the main page with a traditional web server. You can use this technique to do rudimentary (but surprisingly effective) load balancing or to provide a recognizable branded URL to distinguish multiple systems.

    If you use HTTPS, you'll need to research and handle modern browser frame security rules. Small hassle.

  16. Michel B

    18 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com

    @Brad H Sure, create a "wrapper" page (PHP/HTML) and embed the app in a frame. The frame could even take up the whole page, so visually, the user would have no idea what's going on. Serve the main page with a traditional web server. You can use this technique to do rudimentary (but surprisingly effective) load balancing or to provide a recognizable branded URL to distinguish multiple systems.

    If you use HTTPS, you'll need to research and handle modern browser frame security rules. Small hassle.

    Thanks :)

  17. Sascha S

    18 May 2014 Pre-Release Testers, Xojo Pro Germany, Lower Saxonary

    @Andre K Then you were a victim of the < 1024 port number barriere of Apple ;) .

    AFAIK: This is no "Apple Barriere". Ports between 0 and 1023 are so called "well known ports" (WKP's) and will be "blocked" by most OS's. ;)

  18. Andre K

    18 May 2014 Pre-Release Testers

    @SaschaSchneppmueller AFAIK: This is no "Apple Barriere". Ports between 0 and 1023 are so called "well known ports" (WKP's) and will be "blocked" by most OS's. ;)

    AFAIK i haven't seen that on Windows or Linux. On Windows and Linux it's just a matter of settings in the firewall. On a Mac you have to run as root to use those ports (again AFAIK).

  19. Michel B

    18 May 2014 Pre-Release Testers, Xojo Pro RubberViews.com

    Thanks to Andre's guidance in the Windows thread about running a standalone app for local access, I know now that a web app contains its own server, and that Personal Web Sharing is not even necessary.

    What I notice, though, is that the terminal must remain opened after launching the app for it to stay active.

  20. Newer ›

or Sign Up to reply!