0

I ran mvn clean install on my project and compiled a fat JAR. It built without any errors. I moved the JAR to my server and ran java -jar app.jar from its file location. Now I when I hit the server's address I get the following:

403 - Forbidden: Access is denied.
You do not have permission to view this directory or page using the credentials that you supplied.

I'm running Windows Server 2012R2. The folder C:\inetpub\wwwroot does serve webpage when I include an index.html file there. When I have nothing in there I get a 403 error. At some point I had the Springboot app running but I can't recall what had changed. Should I delete the inetpub folder? Why isn't my web app running from the provided JAR?

Edit: I just realized that if I use the IP address and the correct server port, i.e. http://00.00.00.0:8080/ then I can access the application. Is there a way to set this up so that the app launches with just the IP address? Is there anything I can put in my application.properties file, for example?

Martin Erlic
  • 5,467
  • 22
  • 81
  • 153

1 Answers1

1

The standard HTTP port for HTTP is 80. So to omit the port in the URL, you need to set the server port of spring boot to 80.

And you realize that spring boot starts its own HTTP server, serving the application in the jar file, right? So the content if your wwwroot directory if completely irrelevant, and you shouldn't have another web server running on the machine to serve your spring boot app.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • I set the port to 80 but I get the same error. I need to look into uninstalling the IIS server that seems to have been packaged with my Windows server installation... – Martin Erlic Apr 09 '17 at 18:29
  • If the port 80 is already used, you should get an exception when starting the spring boot app. – JB Nizet Apr 09 '17 at 18:31
  • Actually I see this is a common problem: http://stackoverflow.com/questions/1430141/port-80-is-being-used-by-system-pid-4-what-is-that – Martin Erlic Apr 09 '17 at 18:49