Difference between revisions of "Node"

From DHVLab

(Created page with "Category:VMs")
 
Line 1: Line 1:
 
[[Category:VMs]]
 
[[Category:VMs]]
 +
== Install Desktop ==
 +
<syntaxhighlight lang="bash">
 +
yum groupinstall "X Window System"
 +
yum groupinstall "Fonts"
 +
yum install kde-workspace
 +
yum install gdm
 +
unlink /etc/systemd/system/default.target
 +
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
 +
systemctl isolate graphical.target
 +
</syntaxhighlight>
 +
 +
== Install Tomcat ==
 +
<syntaxhighlight lang="bash">
 +
yum install java-1.7.0-openjdk-devel
 +
groupadd tomcat
 +
useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat
 +
wget -O /tmp/tomcat.tar.gz http://mirror.sdunix.com/apache/tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.tar.gz
 +
mkdir /opt/tomcat
 +
tar xvf /tmp/tomcat.tar.gz -C /opt/tomcat --strip-components=1
 +
cd /opt/tomcat
 +
chgrp -R tomcat conf
 +
chmod g+rwx conf
 +
chmod g+r conf/*
 +
sudo chown -R tomcat webapps/ work/ temp/ logs/
 +
nano -w /etc/systemd/system/tomcat.service
 +
</syntaxhighlight>
 +
/etc/systemd/system/tomcat.service
 +
<syntaxhighlight lang="text">
 +
# Systemd unit file for tomcat
 +
[Unit]
 +
Description=Apache Tomcat Web Application Container
 +
After=syslog.target network.target
 +
[Service]
 +
Type=forking
 +
Environment=JAVA_HOME=/usr/lib/jvm/jre
 +
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
 +
Environment=CATALINA_HOME=/opt/tomcat
 +
Environment=CATALINA_BASE=/opt/tomcat
 +
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
 +
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
 +
ExecStart=/opt/tomcat/bin/startup.sh
 +
ExecStop=/bin/kill -15 $MAINPID
 +
User=tomcat
 +
Group=tomcat
 +
[Install]
 +
WantedBy=multi-user.target
 +
</syntaxhighlight>
 +
 +
<syntaxhighlight lang="bash">
 +
systemctl daemon-reload
 +
systemctl start tomcat
 +
systemctl enable tomcat
 +
</syntaxhighlight>
 +
 +
=== Setup Tomcat ===
 +
/opt/tomcat/conf/tomcat-users.xml
 +
<syntaxhighlight lang="text">
 +
<tomcat-users>
 +
    <user username="admin" password="password" roles="manager-gui,admin-gui"/>
 +
</tomcat-users>
 +
</syntaxhighlight>
 +
<syntaxhighlight lang="bash">
 +
systemctl restart tomcat
 +
</syntaxhighlight>

Revision as of 18:39, 9 September 2016

Install Desktop

yum groupinstall "X Window System"
yum groupinstall "Fonts"
yum install kde-workspace
yum install gdm
unlink /etc/systemd/system/default.target
ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target
systemctl isolate graphical.target

Install Tomcat

yum install java-1.7.0-openjdk-devel
groupadd tomcat
useradd -M -s /bin/nologin -g tomcat -d /opt/tomcat tomcat
wget -O /tmp/tomcat.tar.gz http://mirror.sdunix.com/apache/tomcat/tomcat-8/v8.0.23/bin/apache-tomcat-8.0.23.tar.gz
mkdir /opt/tomcat
tar xvf /tmp/tomcat.tar.gz -C /opt/tomcat --strip-components=1
cd /opt/tomcat
chgrp -R tomcat conf
chmod g+rwx conf
chmod g+r conf/*
sudo chown -R tomcat webapps/ work/ temp/ logs/
nano -w /etc/systemd/system/tomcat.service

/etc/systemd/system/tomcat.service

# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl start tomcat
systemctl enable tomcat

Setup Tomcat

/opt/tomcat/conf/tomcat-users.xml

<tomcat-users>
    <user username="admin" password="password" roles="manager-gui,admin-gui"/>
</tomcat-users>
systemctl restart tomcat