简体   繁体   中英

Run Jetty Website on Azure Virtual Machine

I have created a Java Web Application using Jetty (in Eclipse, using OSGI etc.). The application itself runs quite well (when being tested locally), so I wanted to run it on an Azure virtual machine in order to be accessible for external users (for testing reasons).

What I did so far:

  • created an Azure account
  • create a virtual machine with Windows Server running in it
  • downloaded all my eclipse files etc. to the virtual machine
  • started the application (in fact in eclipse, not the compiled jar) in the virtual machine; the application is published to port 8080
  • so, when i run a webbrowser in the VM and connect to localhost:8080, everything works well
  • but when I try to access the website from external (using my assigned domain of the VM, something.cloudapp.net:8080), it does not work
  • I also created endpoints in the azure management console for this VM (80, 8080, etc.)

Does anyone ever tried to run a java webapp on Azure or has a hint what could go wrong here?

By default, windows servers in Azure have the windows firewall enabled. This would block external connections to port 8080 by default. Try adding an appropriate exception to the windows firewall rules.

According to your description, I think you have correctly configured the new endpoints for the network traffic of Java Webapp. If not or incorrectly does, please refer to the article https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-create-nsg-arm-pportal/ to configure again.

Then, as @CtrlDot said, you need to configure the firewall for allowing the inbound traffic on Windows Server.

As reference, please see the article about allowing inbound traffic to a specified TCP or UDP port on Windows Server to do it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM