0

I have created a java web application using netbeans 8. The project works fine.

I need a help to put my project to the raspberry pi , so that when i type the ip address in the web browser it should run my java web application.

Also what are the things i needed to make my raspberry pi as a web server.

In my raspberry pi ,i already have java 8 ,apache2 ,tomcat8.

5
  • Is it a question about system administration or programming? Commented Jul 27, 2015 at 9:44
  • Connect to the device via ssh, copy the war, launch tomcat. After that you should be able to use the application Commented Jul 27, 2015 at 9:49
  • @DiegoMartinoia first of all thank you for your valuable comment.......do i need to put copy whole project to the raspberry pi..... Commented Jul 28, 2015 at 14:08
  • If you have a webapp, when you compile it should generate an archive file (usually a .war) . You need to copy that to the PI and tell the tomcat inside to run that. No need to copy the source files. Commented Jul 28, 2015 at 14:49
  • of course that's under the condition that Tomcat's properly set up to provide whatever resources the application needs (database resource pools, etc.). Commented Jul 29, 2015 at 11:08

2 Answers 2

1
  1. Download Tomcat8 from in /home/pi https://tomcat.apache.org/download-80.cgi#8.0.53

  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 add add

  8. $ cd $HOME/tomcat8/bin

  9. $ sh startup.sh
  10. Open Browser http://localhost:8080/manager/html User Name: admin Password: admin
  11. Choose .war file under WAR file to deploy section
  12. Open Browser and run your application eg. http://localhost:8080/FirstJspProject/HelloWorld.jsp
Sign up to request clarification or add additional context in comments.

Comments

0

Step 1 Follow the instructions from Digital Ocean and install 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.

There you go. Now enter http://ip_of_pi:8080 from any browser in local network to view your site.

Port forward it to access it globally. (optional).

P.S :- if you find error in the line curl -O in step 1 guide , replace the step by manually downloading tomcat.tar from Tomcat Official Site.Tomcat's Official Site to tmp folder.

Hope it helps someone

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.