Web App listening on port 80

  1. 6 weeks ago

    For reasons I won't go into here, I am trying to get a Xojo stand alone Web App to listen on port 80. This is on Windows 2008 Server. When I try to start up Xojo the command window opens up then immediately closes. We have turned off IIS and I do not think any other app on this box is running a web server.

    I have read some of the documentaionn regarding using port 80. I see that Mac OS and Linux have issues with assigneing port 80 which require Admin privileges. No mention of windows OS. I have tried starting the web app with Admin priviledges, but the same thing happens,

    Is it possible to have a Xojo Web App listening on port 80. The goal here is to have any incoming request go by default to port 80. Trying to get port forwarding working on the temporary router we are trying to use has for some reason has been a lesson in futility. So using port 80 seems to me to be a viable solution.

    Thanks.

    In that case try net stop http

  2. Norman P

    Oct 11 Pre-Release Testers, Xojo Pro Outside

    firewall maybe that stops the app from being able to listen on port 80 ?
    system restrictions are really the only reason it isnt work (even on macOS and Linux)

  3. Michel B

    Oct 11 Pre-Release Testers, Xojo Pro

    I would start first with trying to see if the app works fine on your system, listening to 8080, or something like that.

    Then when you are certain it works just fine, you may try port 80. But I vaguely remember these ports are usually unaccessible.

    The easiest solution is to employ an index.html page which contains a redirection to the Xojo app.

    <head> 
      <meta http-equiv="refresh" content="0; URL=http://www.toto.com/myapp:8080" />
    </head>

    The big advantage of an index.html page is that you can stuff it with keywords destined to be index by search engines bots.

    There are other redirects, such as those described here:
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Redirections

  4. Anthony M

    Oct 11 Pre-Release Testers, Xojo Pro

    From an elevated command prompt issue a:

    netstat -ban | more

    and if anything is listening on port 80 it will show that it is in use and the name of the process that is listening on 80

  5. Wayne G

    Oct 11 Pre-Release Testers, Xojo Pro Auckland, New Zealand
    Edited 6 weeks ago

    A Xojo web application is based on the service template. I would suggest creating a service to run your web app and use IIS routing & redirect to forward requests from port 80 to whatever you choose.

    Have a look at movie

  6. @Anthony M I Ran netstat. I see sinething is listentning on port 80 but it says "Can not obtain ownership information". Any suggestions?

  7. Anthony M

    Oct 12 Pre-Release Testers, Xojo Pro

    Make sure you are running as an administrator

    Click Start
    Type “cmd” in the search bar
    When the search results show up you’ll see Command Prompt
    Right-click the Command Prompt and select “Run as Administrator”
    Run the command as before

  8. I am running as administrator...

    -image-

  9. Anthony M

    Oct 12 Pre-Release Testers, Xojo Pro

    Running as a user that has administrator privileges isn’t the same as launching the app using the “Run as Administrator” option which elevates the app permissions itself. Try that.

    Either way, this is the only way i know. If you still aren’t able to see the process owner you’ll need to download a utility that can identify it.

  10. Anthony M

    Oct 12 Pre-Release Testers, Xojo Pro

    One other thing to try:

    Enable telnet client in Programs and Features and try from a command prompt:

    telnet 127.0.0.1 80
    Then type “get” and hit enter

    That may give you the output with the name of the listening process

  11. Markus R

    Oct 13 Pre-Release Testers, Xojo Pro Europe / Germany
    Edited 6 weeks ago

    try cmd as admin and netstat -a -b or netstat -?
    if the port is in use you will see the exe name.

  12. OK, I opened cmd.exe as admin. I get the same thing. Nearly all of the of the active connections display the exe names. A few including the one listening on port 80 sayts "Can not obtain ownership information" instead of the .exe name..

    I tried -a -b and found the the line that says TCP [::]:80 and where the exe should it says the same thing... "Can not obtain ownership information"

    I tried the Telnet suggestion. I get

    HTTP/1.1 400 Bad Request
    Content:-Type: text/html: charset=us-ascii
    Date: Sun, 13 Oct 2019 08:45:08 GMT
    Server: Microsoft-HTTPAPI/2.0
    Connection: close
    Content-Length: 326

    Followed by the head html which is returning Request - Invalid Verb

    Any other suggestions?

  13. Julian S

    Oct 13 Pre-Release Testers, Xojo Pro UK

    Run this from your "Run as administrator" cmd prompt

    netstat -oan | findstr ":80" | findstr "LISTENING"

    If you see this (as I do)

      TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       4
      TCP    [::]:80                [::]:0                 LISTENING       4

    Then IIS is still running.

    If you see a vastly different number at the end (where I see 4) then type that number into the following (where xyz is shown)

    tasklist | findstr "xyz"

    This will find the program that has the PID which owns the open port 80 from above. Find that on your system, shut it down and find out how to stop it automatically running next reboot.

    Now, if its IIS, you can shut it down (until net reboot) by typing

    net stop w3svc

    Now try the first line from above and see if it shows nothing. Your app should now be able to bind to port 80.

    If you want to stop IIS from starting after you reboot, open Services (services.msc), find World Wide Web Publishing Service in the list, right click it and select properties, then change the startup type drop down from Automatic to Manual.

  14. Anthony M

    Oct 13 Pre-Release Testers, Xojo Pro

    It could be one of several services:

    IIS (World Wide Web Publishing Service)
    SQL Reporting Services
    Web Deployment Agent Services

    In any case, as Julian said, you need to stop and disable the offending service. To do that, go to the services control panel (run services.msc from a command prompt or the search bar) and look for one of those listed above. If you find something that looks suspicious, right-click on it and select stop and then run "netstat -ban" again and see if port 80 is still bound. If not, go back to services.msc and double-click the service that you stopped to edit it and change the startup mode to "Disabled". If that wasn't the one just right-click and restart it.

  15. Markus R

    Oct 13 Pre-Release Testers, Xojo Pro Europe / Germany

    you can't use other port?
    the start url would be http://domain.com:81 or http://ip:81
    your app run in intranet?

  16. @Markus R no we cannot use our normal 8881 port due to a misbehaving router. Trying to work around the issue until we can get the router replaced

    @Julian S looks just like yours. Do I have to do anything else besides stopping IIS under "Actions" in IIS? I get 4 with IIS started or stopped.

  17. Julian S

    Oct 13 Pre-Release Testers, Xojo Pro Answer UK

    In that case try net stop http

  18. 5 weeks ago

    Got 80 working. Thanks all who helped. I learned a lot in the process. net stop http fixed it.

or Sign Up to reply!