Eucalyptus: Installation eines Tomcat in ein vorhandenes Image

[ 0 ] Mai 28, 2010 |

Dieser Artikel beschreibt die Installation eines Tomcat Servlet Container in ein bereits vorhandenes Ubuntu Image.

Dafür muss zunächst das Image gemounted werden.

losetup /dev/loop5 root.img
mount /dev/loop5 temp-mnt

Im Anschluß muss ein JDK sowie ein Tomcat heruntergeladen und in das /opt Verzeichnis des Images gespeichert werden.

Nun muss das JDK installiert und die JAVA_HOME Umgebungsvariable gesetzt werden. Danach wird eine Datei mit dem Namen “java_env.sh” in das Verzeichnis “/etc/profile.d/” des Images angelegt. Diese erhält folgenden Inhalt:

#!/bin/bash -l export JAVA_HOME="/opt/java/jre1.6.0_18"

Jetzt kann der Tomcat entpackt werden.

tar xvzf apache-tomcat*

Im Anschluß wird eine Datei mit dem Namen “tomcat” unter “/etc/init.d/” mit dem folgenden Inhalt erzeugt.

# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid
export JAVA_HOME=/opt/java/jre1.6.0_18
case $1 in
start)
sh /opt/tomcat/apache-tomcat-5.5.28/bin/startup.sh
;;
stop)
sh /opt/tomcat/apache-tomcat-5.5.28/bin/shutdown.sh
;;
restart)
sh /opt/tomcat/apache-tomcat-5.5.28/bin/shutdown.sh
sh /opt/tomcat/apache-tomcat-5.5.28/bin/startup.sh
;;
esac
exit 0

Dieses Skript muss nun noch ausführbar gemacht werden.

sudo chmod 755 /etc/init.d/tomcat

Weiterhin muss das Skript mit den Ordnern für den Bootvorgang verlinkt werden.

sudo ln -s /etc/init.d/tomcat /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat /etc/rc2.d/S99tomcat

Jetzt kann der unmount des Images erfolgen.

umount /dev/loop5
losetup -d /dev/loop5

Am Ende muss das Image noch in die Cloud hochgeladen und dort registriert werden.

Quelle

Tags: , , , , , , , , , , , , , , ,

Category: Tutorials

About the Author ()

Rene Buest is Principal Analyst and Senior Advisor at renebuest research, covering cloud computing, business technology and collaboration. He is member of the GigaOm Pro Analyst Network and top cloud computing blogger in Germany. Worldwide he is one of the top 50 bloggers in this area. For more than 16 years he is focused on the strategic use of information technology in businesses and the IT impact on our society as well as disruptive technologies. Rene Buest is the author of numerous professional cloud computing and technology articles, speaker and participant of experts rounds. On CloudUser.de he writes about topics from the fields of cloud computing, it-infrastructures, technologies, management and strategies and is moving on Twitter via his account @ReneBuest. Rene Buest is organizer of numerous cloud computing and technology events. Covering the CloudCamp Hamburg 2010, CloudCamp Frankfurt 2012, CloudOps Summit 2012 and the Amazon Web Services and Windows Azure User Groups in Germany. Rene Buest is a fully qualified specialist for system integration und holds a diploma in computer engineering from the Hochschule Bremen (Dipl.-Informatiker (FH)) as well as a M.Sc. in IT-Management and Information Systems from the FHDW Paderborn. Detailed curriculum vitaes are hosted on XING and LinkedIn.

Leave a Reply

You must be logged in to post a comment.