InrichtenServer

Inrichten Linux servers#

We willen een server inrichten die permanent aan blijft staan, en fysiek los staat van desktop machines.

Voor de inrichting maken we gebruik van SLES10 met daarop een OpenVZ kernel voor virtualisatie. De belangrijkste reden voor deze keuze is het gemak van beheer van OpenVZ (geen gerommel met schijf partities, en je kan makkelijk vanuit de HN beheer doen op de VPS's), en bovendien ondersteunt de OpenVZ kernel ACPI goed (in elk geval op de Toshiba M1 laptop)
Voor de VPS systemen wordt openSUSE 10 als template gebruikt.

Primaire server (blackpearl)#

Op de primaire machine (blackpearl, VPS 101) wordt bij voorkeur openSuSE 10.x geinstalleerd en moeten de volgende services gehost worden :

  1. Tomcat 6.0.x, met daarop de volgende webapplicaties :
    1. KRM administratie
    2. JSPWiki
    3. DHFDS
  2. Apache als frontend voor:
    1. Tomcat
    2. Webmin
    3. Gallery
  3. Gallery
  4. MySQL, tbv Gallery en KRM
  5. Snort (beveiliging)
  6. Webmin als beheertool
  7. vsFTPD
  8. cupsd ? (alleen als remote printing goed te regelen is)
  9. ntpd
  10. sshd
  11. postfix mailserver
  12. linux firewall (iptables, geconfigureerd met webmin)
  13. zie verder ook InstallHistorySUSE10.2

Hardware Node (hood)#

Op de hardware node (hood) wordt een bijna default SuSE install gedaan (basic server met Gnome als desktop), met daarop voorlopig alleen uitsluitend een SSH server, en een HTTP server, en uiteraard de openvz daemon.

IP address HN is 10.0.0.151, hostnaam hood

Partities#

Server wordt opgedeeld in 3 partities.

De partities zijn :

  1. / (root) partitie, hda5, 5 GB
  2. swap partite, hda6, 2 GB
  3. /vz partitie, hda7, 29 GB (alle resterende ruimte dus)

Linux (virtual) servers#

See: Linux Servers

Installatie verslag#

  1. Als eerste pakken we de gekochte 2e hands laptop (Medion 6200, 512MB , 30 GB).
  2. We beginnen met een nagenoeg standaard SLES10 installatie. Dat gaat wat moeizaam omdat de DVD tijdens de installatie van de software storingen geeft, en we moeten dan ook halverwege overschakelen op een netwerk installatie waarbij de SLES10 DVD in de desktop gaat, en via http://10.0.0.150/suse bereikbaar is.
  3. Vervolgens zetten we met de runlevel editor de nodige services uit, Samba, splash, en nog wat meer, dat moet nog ff gefinetuned worden
  4. Dan begint de installatie van OpenVZ, te starten met de download/installatie van de OpenVZ kernel, we kiezen voor de SLES10 based versie (kernel-default-2.6.16.21_2_ve026test016-1.i586). Dit gaat met RPM, gevolgd door een reboot (de menu.lst wordt automatisch goed aangepast.)
  5. Dan volgt aanpassing van sysctl (/etc/sysctl.conf) : # On Hardware Node we generally need # packet forwarding enabled and proxy arp disabled net.ipv4.ip_forward = 1 net.ipv4.conf.default.proxy_arp = 0 # Enables source route verification net.ipv4.conf.all.rp_filter = 1 # Enables the magic-sysrq key kernel.sysrq = 1 # TCP Explict Congestion Notification #net.ipv4.tcp_ecn = 0 # we do not want all our interfaces to send redirects net.ipv4.conf.default.send_redirects = 1 net.ipv4.conf.all.send_redirects = 0 Please edit the file as described.
  6. gevolgd door een sysctl -p command, en tevens zorgen dat het met boot wordt uitgevoerd door /etc/init.d/boot.sysctl : chkconfig boot.sysctl on
  7. dan installatie van de utilities, daar heb ik nog wat rpms van de vorige install gevonden die kennelijk nog nodig zijn, het gaat al met al om de volgende RPM's (eerst nog Python xml en Python-tk met Yast erop rijden) : kernel-2.6.18-ovz028stab027.1.src.rpm python-elementtree-1.2.6-7.rh9.rf.i386.rpm sqlite-3.2.7-3.i386.rpm vzpkg-2.7.0-18.noarch.rpm vzrpm44-python-4.4.1-22.5.i386.rpm kernel-default-2.6.16.21_2_ve026test016-1.i586.rpm python-sqlite-1.1.6-1.i386.rpm vzctl-3.0.16-1.i386.rpm vzquota-3.0.9-1.i386.rpm vztmpl-fedora-core-5-2.0-2.i386.rpm python-elementtree-1.2.6-4.i386.rpm python-urlgrabber-2.9.6-1.noarch.rpm vzctl-lib-3.0.16-1.i386.rpm vzrpm44-4.4.1-22.5.i386.rpm vzyum-2.4.0-11.noarch.rpm
  8. dan de download en installatie van de openSUSE template, we gebruiken hiervoor een precreated cache
  9. aanpassen /etc/vz/vz.conf: DEF_OSTEMPLATE="suse"
  10. hierop moet de cache naam worden aangepast : hood:/vz/template/cache # l total 92592 drwxr-xr-x 2 root root 4096 Jun 10 14:41 ./ drwxr-xr-x 4 root root 4096 Jun 10 13:59 ../ -rw-r--r-- 1 root root 94704595 Dec 29 2005 suse.tar.gz
  11. hostnaam ip adres en startup regelen: hood:/vz/template/cache # vzctl set 101 --onboot yes --save Saved parameters for VE 101 hood:/vz/template/cache # vzctl set 101 --hostname blackpearl.computerhok.nl --save Saved parameters for VE 101 hood:/vz/template/cache # vzctl set 101 --ipadd 192.168.169.101 --save Saved parameters for VE 101
  12. en starten die handel: hood:/vz/template/cache # vzctl start 101 Starting VE ... VE is mounted Adding IP address(es): 192.168.169.101 Setting CPU units: 1000 Set hostname: blackpearl.computerhok.nl VE start in progress...

Root password#

Root password kan worden ingesteld met : vzctl set 101 --userpasswd root:xxxxxx

Inrichten blackpearl server#

SuSE Installatie bron#

Installatie server wordt vorlopig nog de oude desktop, want de DVD speler op de hood is defect, daar komt de DVD in te hangen, en de SUSE installatie bron voor de VPS's wordt http://blackpearl/suse.
Dit doen we door op te voeren /etc/apache2/user.conf met de volgende inhoud:

#---------------------------
# tbv suse dvd:
Alias /suse "/media/cdrom"
<Directory "/media/cdrom">
  Allow from all
  Options Indexes
</Directory>
En door tevens op te nemen in de /etc/apache2/httpd.conf : Include /etc/apache2/user.conf, gevolgd door een restart van de http server.

Na net Yast installeren van mysql doet yast zelf het niet meer, bij keuze van Software Management krijg ik segmentation faults, na wat Googlen komen we niet meteen veel verder. Ik besluit te concluderen dat de door openvz geleverde (unsupported) suse cache niet helemaal lekker is, en dat je niet zomaar een SLES10 installatie CD als installation source kan gebruiken.

Volgende poging:
Copy the hood naar /vz/private/102
Dat wordt helemaal niks, boot niet goed, geen netwerk interfaces enz.. weer weggooien maar.

I Think I found it, ik gebruikte de SLES10 DVD terwijl de cache een openSuSE 10.0 is:

blackpearl:/etc # cat SuSE-release 
SUSE LINUX 10.0 (i586) OSS
VERSION = 10.0

Dus we gaan verder met de openSuSE 10.0 installatie DVD, en dat gaat beter, YaST install gedaan voor locate lynx mysql++

Na reboot problemen met memory: "Cannot allocate memory" bij ongeveer alles wat je doet. Heel fijn, kijk even in de /proc/user_beancounters:

hood:/proc # cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
         0: kmemsize        3330967    4204679 2147483647 2147483647          0
            lockedpages           0         33 2147483647 2147483647          0
            privvmpages       24637      34177 2147483647 2147483647          0
            shmpages           8980       9076 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            numproc              70         94 2147483647 2147483647          0
            physpages          9743      16812 2147483647 2147483647          0
            vmguarpages           0          0 2147483647 2147483647          0
            oomguarpages       9743      16812 2147483647 2147483647          0
            numtcpsock            9         13 2147483647 2147483647          0
            numflock              2          4 2147483647 2147483647          0
            numpty                2          2 2147483647 2147483647          0
            numsiginfo            0          2 2147483647 2147483647          0
            tcpsndbuf          2228     265540 2147483647 2147483647          0
            tcprcvbuf             0     201108 2147483647 2147483647          0
            othersockbuf     204020     426664 2147483647 2147483647          0
            dgramrcvbuf           0       8372 2147483647 2147483647          0
            numothersock        146        179 2147483647 2147483647          0
            dcachesize       941194    1011468 2147483647 2147483647          0
            numfile             884       1278 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            dummy                 0          0 2147483647 2147483647          0
            numiptent            10         10 2147483647 2147483647          0
       101: kmemsize         586787     949644    2752512    2936012          0
            lockedpages           0          0         32         32          0
            privvmpages       48390      49788     131072     131072        196
            shmpages              0        336       8192       8192          0
            dummy                 0          0          0          0          0
            numproc              21         33         65         65          0
            physpages         13317      14534          0 2147483647          0
            vmguarpages           0          0       6144 2147483647          0
            oomguarpages      13317      14534       6144 2147483647          0
            numtcpsock            3          4         80         80          0
            numflock             10         11        100        110          0
            numpty                0          1         16         16          0
            numsiginfo            0          2        256        256          0
            tcpsndbuf             0       4456     319488     524288          0
            tcprcvbuf             0       8552     319488     524288          0
            othersockbuf       4456      17244     132096     336896          0
            dgramrcvbuf           0      27400     132096     132096          0
            numothersock          3          9         80         80          0
            dcachesize        65000      92040    1048576    1097728          0
            numfile             128        248       2048       2048          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            10         10        128        128          0

En kijk bij privvmpages van VPS 101, daar zie je een failcount van 196, dus die waarde *dynamisch* verhoogd :

vzctl set 101 --privvmpages 512m --save
, en hup gaan weer met die banaan.

Apache wil niet opstarten, wederom "Cannot allocate memory" , weer beancounters bekijken, nu staat de numproc van de 0 failcnt:

uid  resource           held    maxheld    barrier      limit    failcnt
     numproc              24         65         65         65          8

Dus de numproc opgehoogd: vzctl set 101 --numproc 512 --save , en hij gaat weer..... :-) I like that...

NBD testen#

Gallery 2.2.1#

De installatie log is van de vorige keer gebruikt: InstallatieVerslagGallery
#-------------------------- 
# tbv gallery2: 
#-------------------------- 
Alias /gallery "/usr/local/gallery2" 
<Directory "/usr/local/gallery2">  
Allow from all 
</Directory> 

Install / Clone grafspee#

De grafspee is de HN op de M1 laptop die productie moet gaan draaien, hier kort een verslag van de installatie stappen:

Overig#

MAX_DAYS_IN_TMP15
MAX_DAYS_IN_LONG_TMP15
TMP_DIRS_TO_CLEARdefault to /tmp
LONG_TMP_DIRS_TO_CLEAR/var/tmp
ProxyPass /webmin http://localhost:51981
ProxyPassReverse /webmin http://localhost:51981
webprefix=/webmin
webprefixnoredir=1
referer=h88211133030.dsl.spedlinq.nl
Jun 25 17:06:39 blackpearl syslog-ng[1367]: STATS: dropped 0
Jun 25 18:06:39 blackpearl syslog-ng[1367]: STATS: dropped 0
Jun 25 18:30:02 blackpearl logrotate: ALERT exited abnormally with [1]
Jun 25 18:30:02 blackpearl logrotate: error: error accessing /var/log/tomcat5/base: No such file or directory
Jun 25 18:30:02 blackpearl logrotate: error: tomcat5:1 glob failed for /var/log/tomcat5/base/*.txt
Jun 25 18:30:05 blackpearl su: (to nobody) root on none
==> opgelost door wegmikken van /etc/logrotate.d/tomcat5
blackpearl:~ # xosview
Can not open file : /proc/interrupts

Backup regelen van grafspee naar hood#

Deze procedure regelmatig gebruiken om een complete backup te maken van alle VPS'en op de grafspee naar de hood.
cd /etc/vz && tar -c vz.conf | ssh -c blowfish hood tar -xv -C /etc/vz
cd /etc/sysconfig && tar -c vz-scripts | ssh -c blowfish hood tar -xv -C /etc/sysconfig
cd /vz && tar -c private template | ssh -c blowfish hood tar -xv -C /vz

Uitgevoerde backups#

Per 10-11-2007 hier bijhouden wanneer je een backup hebt gemaakt.

Overpiepen heel titanic naar grafspee#

Creating a second VPS#

grafspee:/usr/lib # ln -s libexpat.so.1 libexpat.so.0
grafspee:~/openvz/rpm # rpm -i vztmpl-centos-4-2.0-2.i386.rpm --nodeps
warning: vztmpl-centos-4-2.0-2.i386.rpm: Header V3 DSA signature: NOKEY, key ID a7a1d4b6
grafspee:~/openvz/rpm # vzpkgls 
fedora-core-5-i386-default
fedora-core-5-i386-minimal
centos-4-i386-default
centos-4-i386-minimal
(de --nodeps durf ik te doen omdat ik al een vzrpm44-python-4.4.1-22.5, de fc template ging er zonder --nodeps in)
grafspee:/usr/lib # vzpkgcache fedora-core-5-i386-default
Creating cache for fedora-core-5-i386-default OS template
Setting up Install Process
Setting up repositories
fc5-base                  100% |=========================| 1.1 kB    00:00     
fc5-vz-addons             100% |=========================|  951 B    00:00     
fc5-updates-released      100% |=========================| 1.2 kB    00:00     
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 767 kB    00:03     
fc5-base  : ################################################## 2207/2207
Added 2207 new packages, deleted 0 old in 11.18 seconds
primary.xml.gz            100% |=========================| 1.8 kB    00:00     
fc5-vz-add: ################################################## 3/3
Added 3 new packages, deleted 0 old in 0.16 seconds
primary.xml.gz            100% |=========================| 406 kB    00:01     
fc5-update: ################################################## 1159/1159
Added 1159 new packages, deleted 0 old in 7.53 seconds
Parsing package install arguments
..................
..........
........
Packing cache file fedora-core-5-i386-default.tar.gz ...
Cache file fedora-core-5-i386-default.tar.gz [118M] created.
grafspee:~ # vzctl create 102 --ostemplate fedora-core-5-i386-default --ipadd 192.168.169.102 --hostname tirpitz
Creating VE private area (fedora-core-5-i386-default)
Performing postcreate actions
VE private area was created
grafspee:/usr/share/vzpkgtools # ln -s vzrpm44 vzrpm43
grafspee:/usr/share/vzpkgtools # vzpkgcache centos-4-i386-default
Creating cache for centos-4-i386-default OS template
Setting up Install Process
Setting up repositories
centos4-vz-addons         100% |=========================|  951 B    00:00     
centos4-base              100% |=========================| 1.1 kB    00:00     
centos4-updates-released  100% |=========================|  951 B    00:00     
Reading repository metadata in from local files
primary.xml.gz            100% |=========================| 1.8 kB    00:00     
centos4-vz: ################################################## 3/3
Added 3 new packages, deleted 0 old in 0.16 seconds
primary.xml.gz            100% |=========================| 580 kB    00:02     
centos4-ba: ################################################## 1518/1518
Added 1518 new packages, deleted 0 old in 8.64 seconds
primary.xml.gz            100% |=========================|  66 kB    00:00     
......
.............
...........
Complete!
chmod: cannot access `/etc/cron.daily/makewhatis.cron': No such file or directory
Packing cache file centos-4-i386-default.tar.gz ...
Cache file centos-4-i386-default.tar.gz [108M] created.
grafspee:/vz/template/cache # vzctl create 103 --ostemplate  centos-4-i386-default --ipadd 192.168.169.103 --hostname repulse
Creating VE private area (centos-4-i386-default)
Performing postcreate actions
VE private area was created

Port mappings VPS'en#

Zie overzicht bovenaan voor de poorten.

Voor elke VPS kan je een port forward aanzetten door b.v. het volgende te doen :
ssh -L *:10222:localhost:22 -c blowfish -N root@localhost

Printing#

Tja, je kan niet via de VPS printen, want die heeft geen toegang tot USB devices. We gaan voor de makkelijke oplossing, we gaan printen via de HN (grafspee). Daar dus met YaST cups+ installed, en wat lopen tweaken met de /etc/cups/cupsd.conf (vooral autorisaties openzetten, zodat je remote beheer kan doe via http://grafspee:631.
Op andere pc's printer ingesteld op http://grafspee:631/printers/Deskjet

2007-10-29: Printing werkt niet lekker, je kan geen jobs cancellen. Dus maar even de /etc/cups/cupsd.conf op grafspee aangepast (RunAsUser en Authtype User) :

LogLevel info
AutoPurgeJobs No
Printcap /etc/printcap
User lp
Group lp
RunAsUser No
Port 631
Browsing On
BrowseAllow @LOCAL
BrowseDeny All
SystemGroup users

<Location />
AuthType None
Order Allow,Deny
Allow from All
</Location>

<Location /jobs>
AuthClass User
AuthType Basic
Order Allow,Deny
Allow from All
</Location>

sshdfilter#

iptables -N SSHD
-A INPUT -p tcp -m tcp --dport 22 -j SSHD
(hetzelfde ook even in webmin regelen, of wat ook kan is een revert configuration in webmin doen
cp sshdfilter.1 /usr/share/man/man1
cp sshdfilterrc.5 /usr/share/man/man5
mkfifo /var/log/sshd.fifo
chmod 600 /var/log/sshd.fifo
Jul  7 21:15:26 blackpearl sshd[17696]: Invalid user nooooo from 127.0.0.1
Jul  7 21:15:26 blackpearl sshdfilt[16289]: DB:INVALID: dirty=0 user=nooooo, ip=127.0.0.1 
Jul  7 21:15:26 blackpearl sshdfilt[16289]: Chanced illegal user name from 127.0.0.1, 1 guesses out of 3 
Jul  7 21:15:41 blackpearl sshd[17700]: Invalid user nooooo from 127.0.0.1
Jul  7 21:15:41 blackpearl sshdfilt[16289]: DB:INVALID: dirty=0 user=nooooo, ip=127.0.0.1 
Jul  7 21:15:41 blackpearl sshdfilt[16289]: Chanced illegal user name from 127.0.0.1, 2 guesses out of 3 
Jul  7 21:15:46 blackpearl sshd[17704]: Invalid user nooooo from 127.0.0.1
Jul  7 21:15:46 blackpearl sshdfilt[16289]: DB:INVALID: dirty=0 user=nooooo, ip=127.0.0.1 
Jul  7 21:15:46 blackpearl sshdfilt[16289]: Chanced illegal user name from 127.0.0.1, 3 guesses out of 3 
Jul  7 21:15:53 blackpearl sshd[17708]: Invalid user nooooo from 127.0.0.1
Jul  7 21:15:53 blackpearl sshdfilt[16289]: DB:INVALID: dirty=0 user=nooooo, ip=127.0.0.1 
Jul  7 21:15:53 blackpearl sshdfilt[16289]: Illegal user name, blocking 127.0.0.1 after 3 chances 
Jul  7 21:15:53 blackpearl sshdfilt[17710]: DB:pre mail command is $mailcommand="mail -s \"sshdfilter event for $ip, $event\" harry.metske\@gmail.com" 
Jul  7 21:15:53 blackpearl sshdfilt[17710]: DB:post mail command is mail -s "sshdfilter event for 127.0.0.1, Illegal user name, blocking after 3 chances." harry.metske@gmail.com 
Jul  7 21:15:53 blackpearl sshdfilt[16289]: DB: pre fw add command is $fwcommand="iptables -A $chain -p tcp -s $ip --dport 22 -j DROP" 
Jul  7 21:15:53 blackpearl sshdfilt[16289]: DB: post fw add command is iptables -A SSHD -p tcp -s 127.0.0.1 --dport 22 -j DROP 

Diversen#

#
#  enable compression:
<Location />
# Insert filter
SetOutputFilter DEFLATE

# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</Location>
grafspee:~ # vzctl set 101 --tcpsndbuf 1000000 2000000 --save
non-option ARGV-elements: 2000000 
grafspee:~ # vzctl set 101 --tcpsndbuf 1000000:2000000 --save
UB limits were set successefully
Saved parameters for VE 101
grafspee:~ # vzctl set 101 --tcprcvbuf 1000000:2000000 --save
UB limits were set successefully
Saved parameters for VE 101
grafspee:~ # vzctl set 101 --lockedpages 5000:10000 --save
UB limits were set successefully
Saved parameters for VE 101
grafspee:~ # vzctl set 101 --kmemsize 8000000:9000000 --save
UB limits were set successefully
Saved parameters for VE 101
grafspee:~ # vzctl set 101 --numtcpsock 400:500 --save
UB limits were set successefully
Saved parameters for VE 101
grafspee:~ # vzctl set 101 --numiptent 400:500 --save
UB limits were set successefully
Saved parameters for VE 101
grafspee:~ # vzctl set 101 --numfile 8000:10000 --save
UB limits were set successefully
Saved parameters for VE 101
Nieuwe UBC's :
blackpearl:/home/metskem # cat /proc/user_beancounters 
Version: 2.5                                                                   
       uid  resource           held    maxheld    barrier      limit    failcnt
       101: kmemsize        3973652    5038289    8000000    9000000         18
            lockedpages           0          0       5000      10000          5
            privvmpages      114023     454005     500000     600000          0
            shmpages           1289       4617       8192       8192          0
            dummy                 0          0          0          0          0
            numproc              89        116        512        512          0
            physpages         37973      81013          0 2147483647          0
            vmguarpages           0          0       6144 2147483647          0
            oomguarpages      37973      81013       6144 2147483647          0
            numtcpsock           34         80        400        500          3
            numflock              6         29        100        110          0
            numpty                2          3         16         16          0
            numsiginfo            5         14        256        256          0
            tcpsndbuf         12648     406380    1000000    2000000         66
            tcprcvbuf          1204     416012    1000000    2000000        165
            othersockbuf     166408     416404     500000     800000          0
            dgramrcvbuf           0      16744     500000     600000          0
            numothersock        105        134        250        250          0
            dcachesize       404040     464360    1048576    1097728          0
            numfile            1426       1733       8000      10000          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent            59        111        400        500          0

smtp mail access#

VPN with openvpn#

dev tun
ifconfig 10.8.0.1 10.8.0.2
secret static.key
comp-lzo
# 
# routes:
push "route 10.0.0.0 255.255.255.0"
push "route 10.0.0.101 255.255.255.255" 
daemon
verb 4
log-append /var/log/openvpn.log

JMX monitoring for Tomcat#

See also the official Sun docs
Add the following line to /home/tomcat/.bash_profile (scharnhorst) and /home/tomcat/.bashrc (blackpearl):

export JAVA_OPTS="-Dcom.sun.management.jmxremote.port=5001  -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false "
On your laptop start jconsole, and do a remote connect to port 5001 (scharnhorst or blackpearl)

MessAdmin#

MessAdmin can be used to reveal the webapps HttpSession size. Installation instructions :

<filter>
        <!-- MessAdmin Servlet Filter -->
        <filter-name>MessAdminFilter</filter-name>
        <filter-class>clime.messadmin.filter.MessAdminFilter</filter-class>
</filter>

<filter-mapping>
        <filter-name>MessAdminFilter</filter-name>
        <url-pattern>/*</url-pattern>
</filter-mapping>

<listener>
        <!-- MessAdmin listener -->
        <listener-class>clime.messadmin.core.MessAdminListener</listener-class>
</listener>

CVS#

Install CVS on blackpearl:

# CVS pserver (remote acces to your CVS repositories)  
# Please read the section on security and passwords in the CVS manual,
# before you enable this.
# default: off

service cvspserver
{
        port            = 2401
#        disable         = yes
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = root  
        server          = /usr/bin/cvs
        server_args     = -f --allow-root=/usr/local/cvsroot pserver
}

Google Analytics#

This enables you to keep track of statistics of your website visitors.
It works by inserting a small piece of javascript in your html pages. This js then sends requests to the google analytics site.
You first have to register with GA. You then get a unique ID that you have to use in your java script.
The java script looks like this:

       <script type="text/javascript">
         var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
         document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
      </script>
      <script type="text/javascript">
        var pageTracker = _gat._getTracker("UA-3977725-1");
        pageTracker._initData();
        pageTracker._trackPageview();
      </script>
Now to make sure that this js is inserted in as many pages as possible you have to change some things, see next chapter. When you've done that, you can view your reports on GA.

JSPWiki changes for GA#

JSPWiki has a localheader.jsp, so this is easy, just stick in the above js, and you are done.

Gallery 2 changes for GA#

This is explained on the Gallery2 wiki
So I created /usr/local/gallery2/themes/carbon/templates/local and copied theme.tpl from the upper directory in it, and added the js at the end of the file just before the </body> tag. You'r done

PXE Boot server#

root@scharnhorst /etc> apt-get install inetutils-inetd
root@scharnhorst /etc> sudo apt-get install tftpd-hpa dhcp3-server lftp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  dhcp3-server lftp tftpd-hpa
0 upgraded, 3 newly installed, 0 to remove and 7 not upgraded.
Need to get 752kB of archives.
After this operation, 2413kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com hardy/main dhcp3-server 3.0.6.dfsg-1ubuntu9 [318kB]
Get:2 http://archive.ubuntu.com hardy/main lftp 3.6.1-1 [399kB]
Get:3 http://archive.ubuntu.com hardy/main tftpd-hpa 0.48-1ubuntu1 [34.7kB]
Fetched 752kB in 0s (1422kB/s)
Preconfiguring packages ...
Selecting previously deselected package dhcp3-server.
(Reading database ... 45253 files and directories currently installed.)
Unpacking dhcp3-server (from .../dhcp3-server_3.0.6.dfsg-1ubuntu9_i386.deb) ...
Selecting previously deselected package lftp.
Unpacking lftp (from .../archives/lftp_3.6.1-1_i386.deb) ...
Selecting previously deselected package tftpd-hpa.
Unpacking tftpd-hpa (from .../tftpd-hpa_0.48-1ubuntu1_i386.deb) ...
Setting up dhcp3-server (3.0.6.dfsg-1ubuntu9) ...
Generating /etc/default/dhcp3-server...
 * Starting DHCP server dhcpd3                                                                          [fail] 
invoke-rc.d: initscript dhcp3-server, action "start" failed.

Setting up lftp (3.6.1-1) ...

Setting up tftpd-hpa (0.48-1ubuntu1) ...
root@scharnhorst /etc> netstat -uap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
netstat: no support for `AF INET (udp)' on this system.

Dat draait natuurlijk weer niet op een virtuele server, dus er weer af :

root@scharnhorst /e/init.d> sudo apt-get remove inetutils-inetd tftpd-hpa dhcp3-server 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  dhcp3-server inetutils-inetd tftpd-hpa
0 upgraded, 0 newly installed, 3 to remove and 7 not upgraded.
After this operation, 1110kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 45301 files and directories currently installed.)
Removing dhcp3-server ...
 * Stopping DHCP server dhcpd3                                                                      [fail] 
Removing tftpd-hpa ...
Removing inetutils-inetd ...
 * Stopping internet superserver inetd   
 
En maar even op een real server proberen:
root@grafspee:~# apt-get install inetutils-inetd tftpd-hpa dhcp3-server lftp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  whois
Use 'apt-get autoremove' to remove them.
The following NEW packages will be installed:
  dhcp3-server inetutils-inetd lftp tftpd-hpa
0 upgraded, 4 newly installed, 0 to remove and 9 not upgraded.
Need to get 831kB of archives.
After this operation, 2593kB of additional disk space will be used.
Get:1 http://nl.archive.ubuntu.com hardy/main dhcp3-server 3.0.6.dfsg-1ubuntu9 [318kB]
Get:2 http://nl.archive.ubuntu.com hardy/universe inetutils-inetd 2:1.5.dfsg.1-4 [79.4kB]
Get:3 http://nl.archive.ubuntu.com hardy/main lftp 3.6.1-1 [399kB]
Get:4 http://nl.archive.ubuntu.com hardy/main tftpd-hpa 0.48-1ubuntu1 [34.7kB]
Fetched 831kB in 0s (1682kB/s)
Preconfiguring packages ...
Selecting previously deselected package dhcp3-server.
(Reading database ... 53815 files and directories currently installed.)
Unpacking dhcp3-server (from .../dhcp3-server_3.0.6.dfsg-1ubuntu9_i386.deb) ...
Selecting previously deselected package inetutils-inetd.
Unpacking inetutils-inetd (from .../inetutils-inetd_2%3a1.5.dfsg.1-4_i386.deb) ...
Selecting previously deselected package lftp.
Unpacking lftp (from .../archives/lftp_3.6.1-1_i386.deb) ...
Selecting previously deselected package tftpd-hpa.
Unpacking tftpd-hpa (from .../tftpd-hpa_0.48-1ubuntu1_i386.deb) ...
Setting up dhcp3-server (3.0.6.dfsg-1ubuntu9) ...
Generating /etc/default/dhcp3-server...
 * Starting DHCP server dhcpd3                                                                                                   [fail] 
invoke-rc.d: initscript dhcp3-server, action "start" failed.

Setting up inetutils-inetd (2:1.5.dfsg.1-4) ...
 * Starting internet superserver inetd                                                                                           [ OK ] 

Setting up lftp (3.6.1-1) ...

Setting up tftpd-hpa (0.48-1ubuntu1) ...

vi /etc/inetd.conf and add :

#:BOOT: Tftp service is provided primarily for booting.  Most sites
# run this only on machines acting as "boot servers."
tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd /usr/sbin/in.tftpd -s /var/lib/tftpboot

and recycle the inetd: invoke-rc.d inetutils-inetd restart

root@grafspee:/etc/dhcp3# netstat -uap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 *:10000                 *:*                                 5754/perl       
udp        0      0 *:openvpn               *:*                                 25176/openvpn   
udp        0      0 *:bootps                *:*                                 8085/dhcpd3     
udp        0      0 localhost:47087         localhost:syslog        ESTABLISHED 4169/perl       
udp        0      0 *:10000                 *:*                                 4169/perl       
udp        0      0 *:10000                 *:*                                 9183/perl       
udp        0      0 *:ipp                   *:*                                 4753/cupsd      
udp        0      0 10.8.0.1:ntp            *:*                                 4778/ntpd       
udp        0      0 grafspee.computerho:ntp *:*                                 4778/ntpd       
udp        0      0 localhost:ntp           *:*                                 4778/ntpd       
udp        0      0 *:ntp                   *:*                                 4778/ntpd       
udp6       0      0 [::]:tftp               [::]:*                              7696/inetutils-inet
udp6       0      0 fe80::200:39ff:febf:ntp [::]:*                              4778/ntpd       
udp6       0      0 ip6-localhost:ntp       [::]:*                              4778/ntpd       
udp6       0      0 [::]:ntp                [::]:*                              4778/ntpd       
option domain-name-servers 213.197.30.28,213.197.28.3;

default-lease-time 86400;
max-lease-time 604800;

authoritative;

subnet 10.0.0.0 netmask 255.255.255.0 {
        range 10.0.0.170 10.0.0.180;
        filename "pxelinux.0";
        option subnet-mask 255.255.255.0;
        option broadcast-address 10.0.0.255;
        option routers 10.0.0.138;
}

download images and save to /var/lib/tftpboot:

root@grafspee:/tmp# lftp -c "open http://archive.ubuntu.com/ubuntu/dists/intrepid/main/installer-i386/current/images/; mirror netboot/"
root@grafspee:/tmp# mv netboot/* /var/lib/tftpboot                                                                  
root@grafspee:/tmp# rm -fr netboot 

install tftp on bismarck so we can test, then tftp to grafspee, this gives in /var/log/daemon.log :

Feb  7 14:25:42 grafspee in.tftpd[9705]: received address was not AF_INET, please check your inetd config
Feb  7 14:25:42 grafspee inetd[7696]: /usr/sbin/in.tftpd: exit status 0x4c00
google'ing........
change /etc/inetd.conf : udp => udp4