0

There is a running stand alone web service running in windowserver its address http://localhost:1234, it starts running with double click of service.bat file,

In IIS, I have created a web site with hostname(myhostname) and set apps target folder as same path with service.bat,

and expected browsing from another computer like http://myhostname.com direct to this web app,

of course it doesnt work.. how can I achieve that?

adeveloper
  • 311
  • 1
  • 4
  • 14
  • Did you try to use IIS Manager? – Novy Oct 09 '20 at 10:53
  • well, no I would If I have a idea how to do – adeveloper Oct 09 '20 at 10:54
  • I did ask because it think it would be the quicker way when you public your site. By the way if it was on port 80 you would just have to configure your host file – Novy Oct 09 '20 at 11:02
  • "set apps target folder as same path with service.bat" won't work if `service.bat` is the only way to launch your web service. Either you expose that web service via a valid binding for external (not localhost), or you set up IIS as a reverse proxy. – Lex Li Oct 09 '20 at 19:56
  • IIS won't actively execute a bat file, unless executed with the help of asp.net applications, and for security reasons, by default iis will block access to the bat file, and you need to set the permissions of the application pool. If you want to redirect to localhost:1234 by myhostname.com, use url rewrite or redirect and enable proxy in arr is a great choice. – Bruce Zhang Oct 12 '20 at 06:54
  • @LexLi can you post your answer with eloborate in detail please, thanks – adeveloper Oct 12 '20 at 15:13
  • @BruceZhang can you add your post as answer with eloborate in detail please, thanks – adeveloper Oct 12 '20 at 15:14

1 Answers1

1

IIS won't actively execute a bat file, unless executed with the help of asp.net applications. And for security reasons, by default iis will block access to the bat file, and you need to set the permissions of the application pool. Not only the bat file, but the exe file is the same. When executing the exe file with the asp.net application, you need to set the file in the folder and add the application pool as the executable.(You can refer to this answer)

If you want to redirect to localhost:1234 by myhostname.com,you can use url rewrite or redirect module ,then enable proxy in arr. This is detail steps.

Bruce Zhang
  • 2,880
  • 1
  • 5
  • 11