繁体   English   中英

如何在树莓派上部署Java Web应用程序

[英]How to deploy a Java web application on raspberry pi

我已经使用netbeans 8创建了一个Java Web应用程序。该项目运行正常。

我需要帮助将我的项目放到raspberry pi上,因此当我在Web浏览器中键入IP地址时,它应该运行我的Java Web应用程序。

另外,我需要将树莓派作为Web服务器需要做些什么。

在我的树莓派中,我已经有Java 8,apache2,tomcat8。

步骤1按照Digital Ocean的说明进行操作并安装tomcat。

Step 2 After installing in netbeans, Go to Run->Clean and build.
Step 3 Goto Project folder and find the projectname.war file in dist folder.
Step 4 Rename the war to ROOT.war.
Step 5 Assuming you have followed all the procedure as mentioned in digital 
ocean from step 1, goto http://localhost:8080/
Step 6. Click Manage App .
Step 7  At the bottom there will be a browse button under upload war. Click it
Step 8  After selecting ROOT.war . Click deploy.

妳去 现在,从本地网络中的任何浏览器输入http:// ip_of_pi:8080来查看您的站点。

进行端口转发以全局访问它。 (可选的)。

PS:-如果在步骤1指南中的curl -O行中发现错误,请通过从Tomcat官方网站手动下载tomcat.tar来替换该步骤。 Tomcat的官方站点到tmp文件夹。

希望对别人有帮助

  1. 从/ home / pi https://tomcat.apache.org/download-80.cgi#8.0.53下载Tomcat8

  2. $ cd $ HOME

  3. $ tar xzf apache-tomcat-8.0.53.tar.gz
  4. $ mv apache-tomcat-8.0.53 tomcat8
  5. $ tar xzf tomcat8.tar.gz
  6. $ cd $ HOME / tomcat8 / conf
  7. $ sudo nano tomcat-users.xml添加添加

  8. $ cd $ HOME / tomcat8 / bin

  9. $ sh startup.sh
  10. 打开浏览器http:// localhost:8080 / manager / html用户名:admin密码:admin
  11. 在要部署的WAR文件下选择.war文件
  12. 打开浏览器并运行您的应用程序,例如。 http:// localhost:8080 / FirstJspProject / HelloWorld.jsp

暂无
暂无

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

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