sunnuntai 31. maaliskuuta 2013

Tomcat on RaspberryPi

Original tutorial:  MacGyver Development

We are doing a dynamic web project in school and we needed a Tomcat server. I then wanted to host the page myself because I wanted to learn everything from 0 to 100.

Raspberry Pi is little slow to read from MySQL but the price for this server is so low that it doesn't matter for me. Also Pi is completely silent and very small.

Here's what you need to do to make Tomcat 7 run.

Tomcat obviously need Java:
$ sudo apt-get install openjdk-6-jdk

Clean up your installs to save some space on the SD card
$ sudo apt-get clean

Now, download, unpack and install Tomcat (notice that the version number may have been changed)
$ wget http://mirrors.axint.net/apache/tomcat/tomcat-7/v7.0.35/bin/apache-tomcat-7.0.35.tar.gz
$ tar xzf apache-tomcat-7.0.35.tar.gz
$ cd apache-tomcat-7.0.35/conf
$ nano tomcat-users.xml

Add a user to the authorization file, directly below <tomcat-users> add
<user username="system" password="raspberry" roles="manager-gui"/>

Now start Tomcat
cd ../bin
sudo sh startup.sh

Now you have a Tomcat server on your PI. Surf to the Tomcat console: yourIP:8080
example http://192.168.1.90:8080/ You can check your IP with $ ifconfig command

It takes a short while to warm up the server but then you can login via Manager App.

Ei kommentteja:

Lähetä kommentti