create bootstrap scripts : created /etc/init/tomcat1.conf /etc/init/tomcat2.conf ==> use these to set the envvars for tomcat
download latest released JSPWiki : wget 'http://www.apache.org/dist/incubator/jspwiki/2.9.1-incubating/JSPWiki-2.9.1-incubating-4-bin.zip'
create tomcat[1/2] webapp dirs : with user tomcat[1/2]: cd /usr/local/tomcat[1/2]/webapps && mv ROOT ROOT.old && mkdir ROOT && cd ROOT && jar -xf /tmp/ff/JSPWiki-bin/JSPWiki.war
patch wiki vanilla jspwiki.properties : created ~tomcat1/jspwiki/jspwiki.properties.patch and run: patch /usr/local/tomcat1/webapps/wiki/WEB-INF/jspwiki.properties ~tomcat1/jspwiki/jspwiki.properties.patch
patch doc vanilla jspwiki.properties : created ~tomcat2/jspwiki/jspwiki.properties.patch and run: patch /usr/local/tomcat2/webapps/wiki/WEB-INF/jspwiki.properties ~tomcat2/jspwiki/jspwiki.properties.patch
created /usr/local/tomcat[1/2]/lib/jspwiki-custom.properties (see attached files)
patch tomcat1 server.xml (disable port 8080, change redirect port to 443) : cd /usr/local/tomcat1/conf && patch server.xml ~/jspwiki/tomcat.server.xml.patch
patch tomcat2 server.xml (disable port 8080 and shift 8005 8009 up 100, change redirect port to 443) : cd /usr/local/tomcat2/conf && patch server.xml ~/jspwiki/tomcat.server.xml.patch
install spam filterfilters.xml to /usr/local/tomcat[1/2]/lib
install jspwiki security policyjspwiki-custom.policy to /usr/local/tomcat[1/2]/lib (anonymous users can only view)
redirect root mail : /etc/aliases : direct "root" to harry.metske@gmail.com (and run newaliases) ==> puppet reverts it
==> edit /etc/cron.weekly/00logwatch : logwatch --mailto harry.metske@gmail.com
create the /etc/logrotate.d/tomcats file to truncate catalina.out
create the /etc/cron.daily/cleanTomcatLogs file to get rid of old log files
create the /etc/cron.daily/backupWikis file to arrange the backup
no lvm installed, so just one fs, simple and easy:
root@jspwiki-vm:~# mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro)
.....snip.....
/dev/sda6 on /tmp type ext4 (rw)
root@jspwiki-vm:~# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 28G 1.9G 25G 8% /
JSPWIKI VM #
Table of Contents
Intro#
Description of the setup of the Ubuntu VM we have to run http://jspwiki.apache.org/wiki
and http://jspwiki.apache.org/doc
.
for more background.
See INFRA-5588
Important directories and files#
Extra installed packages#
Configuration and installation#
==> edit /etc/cron.weekly/00logwatch : logwatch --mailto harry.metske@gmail.com
Todo#
Findings#
metskem@jspwiki-vm:~$ ifconfig eth0 Link encap:Ethernet HWaddr 00:50:56:9d:00:19 inet addr:140.211.11.82 Bcast:140.211.11.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fe9d:19/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:69671783 errors:0 dropped:9171 overruns:0 frame:0 TX packets:23419837 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:16814561371 (16.8 GB) TX bytes:1662666969 (1.6 GB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)root@jspwiki-vm:/opt# iptables -vnL Chain INPUT (policy DROP 3697 packets, 301K bytes) pkts bytes target prot opt in out source destination 67M 16G fail2ban-ssh tcp -- * * 0.0.0.0/0 0.0.0.0/0 15701 1494K fail2ban-ssh tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 68M 16G ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED /* ASF IP tables enabled */ 0 0 ACCEPT all -- lo * 127.0.0.1 0.0.0.0/0 /* Allow all loopback traffic */ 55 1804 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 8 state NEW,RELATED,ESTABLISHED /* Allow ICMP */ 801 47592 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 3442K packets, 196M bytes) pkts bytes target prot opt in out source destination Chain fail2ban-ssh (2 references) pkts bytes target prot opt in out source destination 18 1488 DROP all -- * * 61.153.110.253 0.0.0.0/0 20 1564 DROP all -- * * 123.30.143.150 0.0.0.0/0 21 3288 DROP all -- * * 112.216.76.110 0.0.0.0/0 14 704 DROP all -- * * 117.135.139.142 0.0.0.0/0 17 1640 DROP all -- * * 58.59.176.61 0.0.0.0/0 23 2228 DROP all -- * * 196.22.220.8 0.0.0.0/0 23 2228 DROP all -- * * 200.146.120.122 0.0.0.0/0 28 1820 DROP all -- * * 122.147.2.254 0.0.0.0/0 67M 16G RETURN all -- * * 0.0.0.0/0 0.0.0.0/0 Chain test (0 references) pkts bytes target prot opt in out source destination