Kategorien
Tutorials

Eucalyptus: Installation eines Tomcat in ein vorhandenes Image

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

Von Rene Buest

Rene Buest is Gartner Analyst covering Infrastructure Services & Digital Operations. Prior to that he was Director of Technology Research at Arago, Senior Analyst and Cloud Practice Lead at Crisp Research, Principal Analyst at New Age Disruption and member of the worldwide Gigaom Research Analyst Network. Rene is considered as top cloud computing analyst in Germany and one of the worldwide top analysts in this area. In addition, he is one of the world’s top cloud computing influencers and belongs to the top 100 cloud computing experts on Twitter and Google+. Since the mid-90s 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 technology articles. He regularly writes for well-known IT publications like Computerwoche, CIO Magazin, LANline as well as Silicon.de and is cited in German and international media – including New York Times, Forbes Magazin, Handelsblatt, Frankfurter Allgemeine Zeitung, Wirtschaftswoche, Computerwoche, CIO, Manager Magazin and Harvard Business Manager. Furthermore Rene Buest is speaker and participant of experts rounds. He is founder of CloudUser.de and writes about cloud computing, IT infrastructure, technologies, management and strategies. He 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.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert