简体   繁体   English

在Azure虚拟机上运行Jetty网站

[英]Run Jetty Website on Azure Virtual Machine

I have created a Java Web Application using Jetty (in Eclipse, using OSGI etc.). 我已经使用Jetty创建了一个Java Web应用程序(在Eclipse中,使用OSGI等)。 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). 该应用程序本身运行得很好(在本地进行测试时),因此我想在Azure虚拟机上运行它,以便外部用户可以访问(出于测试原因)。

What I did so far: 到目前为止,我做了什么:

  • created an Azure account 创建一个Azure帐户
  • create a virtual machine with Windows Server running in it 创建运行Windows Server的虚拟机
  • downloaded all my eclipse files etc. to the virtual machine 将我所有的eclipse文件等下载到虚拟机
  • started the application (in fact in eclipse, not the compiled jar) in the virtual machine; 在虚拟机中启动应用程序(实际上是在eclipse中,而不是在已编译的jar中); the application is published to port 8080 该应用程序已发布到端口8080
  • so, when i run a webbrowser in the VM and connect to localhost:8080, everything works well 因此,当我在VM中运行Web浏览器并连接到localhost:8080时,一切正常
  • 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 但是当我尝试从外部访问网站时(使用我分配的虚拟机域,something.cloudapp.net:8080),该网站不起作用
  • I also created endpoints in the azure management console for this VM (80, 8080, etc.) 我还在azure管理控制台中为此虚拟机(80、8080等)创建了端点。

Does anyone ever tried to run a java webapp on Azure or has a hint what could go wrong here? 是否有人尝试在Azure上运行Java WebApp或暗示此处可能出问题?

By default, windows servers in Azure have the windows firewall enabled. 默认情况下,Azure中的Windows服务器已启用Windows防火墙。 This would block external connections to port 8080 by default. 默认情况下,这将阻止与端口8080的外部连接。 Try adding an appropriate exception to the windows firewall rules. 尝试将适当的例外添加到Windows防火墙规则。

According to your description, I think you have correctly configured the new endpoints for the network traffic of Java Webapp. 根据您的描述,我认为您已经为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. 如果不是或错误地进行了配置,请参考文章https://azure.microsoft.com/en-us/documentation/articles/virtual-networks-create-nsg-arm-pportal/进行重新配置。

Then, as @CtrlDot said, you need to configure the firewall for allowing the inbound traffic on Windows Server. 然后,如@CtrlDot所述,您需要配置防火墙以允许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. 作为参考,请参阅有关允许进入Windows Server上指定TCP或UDP端口的入站流量的文章。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Azure虚拟机上启动jar文件 - Launching jar file on Azure virtual machine 如何知道虚拟机是否在Azure中停止 - How to Know if Virtual Machine is stopped in Azure 可以在没有Java虚拟机的情况下运行Java吗? - Can Java be run without a Java Virtual Machine? 找不到Java虚拟机来运行eclipse - No java Virtual Machine was found to run eclipse 在云提供商上初始化虚拟机,然后在该计算机上运行一些自定义代码 - initialise a virtual machine on a cloud provider and run some custom code on that machine 当我添加--exec参数时,jetty无法启动“无法创建虚拟机” - jetty cannot start “unable to create the virtual machine” when I add the --exec parameter 使用Java SDK使用临时OS磁盘创建Azure虚拟机 - Create Azure Virtual Machine with ephemeral OS disk using Java SDK 如何在 azure 中获取运行我的应用程序的虚拟机名称 - How to get the virtual machine name that my app is running on in azure 是否可以使用Java程序在Microsoft Azure中创建虚拟机? - Is there a way to create a virtual machine in Microsoft Azure using a Java Program? java,xenserver,有人知道如何在虚拟机上运行命令吗? - java, xenserver, does anybody knows how to run a command on a virtual machine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM