неделя, 2 февруари 2014 г.

RAMJ - Raspberry, Apache Tomcat, MySQL, Java host server

In this post I will show how to run RAMJ server for test purposes on Raspberry Pi computer.

Step 1

On Raspbian Wheezy, the Java is preisntalled (/usr/lib/jvm/jdk-7-oracle-armhf/jre/bin),
but in case it is not there you can install it easily.
There is no need to be Unix guru, all you need is to perform:
sudo apt-get update && sudo apt-get install oracle-java7-jdk
Our Apache Tomcat server needs to know where the Java is located.export JAVA_HOME="/usr/lib/jvm/jdk-7-oracle-armhf"
export PATH=$PATH:$JAVA_HOME/bin
Check the path echo $JAVA_HOME.

Step 2

Installing the Tomcat is not tricky too.
Download it from:

After the download completes, untar the file.
tar -zxvf apache-tomcat-7.0.50.tar.gz
-z : Uncompress the resulting archive with gzip command.
-x : Extract to disk from the archive.
-v : Produce verbose output i.e. show progress and file names while extracting files.
-f data.tar.gz : Read the archive from the specified file called data.tar.gz.

In order to start Tomcat, we need to add it as an environment variable in the /.bashrc file: sudo nano ~/.bashrc
We have add next rows to the end of the file:

export export JAVA_HOME=/usr/lib/jvm/jdk-7-oracle-armhf
export CATALINA_HOME=~/home/pi/apache-tomcat-7.0.50

After saving the additions we can make the changes effective by restarting the bashrc file: ~/.bashrc

It is more convenient to have Tomcat started on each linux startup.
For that we have to create start script and place it in /etc/init.d

sudo nano tomcat7
# Short-Description: Start Tomcat.
# Description: Start the Tomcat servlet engine.
# Tomcat 7 init-script
export JAVA_HOME
export PATH
case $1 in
 sh $CATALINA_HOME/bin/startup.sh
 echo "tomcat7 started successfully"
 sh $CATALINA_HOME/bin/shutdown.sh
 echo "tomcat7 stoped successfully"
 sh /home/pi/apache-tomcat-7.0.50/bin/shutdown.sh
 sh /home/pi/apache-tomcat-7.0.50/bin/startup.sh
 echo "tomcat7 restarted successfully"
 sh $CATALINA_HOME/bin/startup.sh
 echo "tomcat7 started successfully"
exit 0

After saving it with Ctrl ^x, we have to make it executable.
sudo chmod 751 tomcat7
sudo update-rc.d tomcat7 defaults

Check if it works, type sudo reboot, after the restart, type  in RP Midori browser the address of the default Tomcat's page: http://localhost:8080

Step 3

Now download the MySQL archve from: To be continued...

сряда, 15 януари 2014 г.

How do I run my ATX power supply without a motherboard?

Just short pin 13 and 14 as long as you want the supply to be on.