<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>johker's blog</title>
	<atom:link href="http://johker.ibutho.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://johker.ibutho.de</link>
	<description>stories about me, my life, science and my trips</description>
	<lastBuildDate>Mon, 15 Feb 2010 10:04:23 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Sammelleidenschaft</title>
		<link>http://johker.ibutho.de/2010/02/15/sammelleidenschaft/</link>
		<comments>http://johker.ibutho.de/2010/02/15/sammelleidenschaft/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 10:04:23 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Konsolen]]></category>
		<category><![CDATA[50/60Hz]]></category>
		<category><![CDATA[Cartmod]]></category>
		<category><![CDATA[Cartmodding]]></category>
		<category><![CDATA[Controller Mod]]></category>
		<category><![CDATA[Fantranslation]]></category>
		<category><![CDATA[Fanübersetzung]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Lockout]]></category>
		<category><![CDATA[Retro]]></category>
		<category><![CDATA[Rollenspiel]]></category>
		<category><![CDATA[RPG]]></category>
		<category><![CDATA[SNES]]></category>
		<category><![CDATA[Super Nintendo]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=291</guid>
		<description><![CDATA[Gerade kurz vor den Klausuren sucht man sich ja immer mal wieder gerne Beschäftigungen um sich vom Lernen abzuhalten. So ist das auch bei mir. Meine Sammelleidenschaft wurde wieder neu entfacht. Und das für meine treue Kindheitskonsole: das Super Nintendo. Bis heute hat es keine einzige Konsole geschafft mich so zu fesseln wie das SNES [...]]]></description>
			<content:encoded><![CDATA[<p>Gerade kurz vor den Klausuren sucht man sich ja immer mal wieder gerne Beschäftigungen um sich vom Lernen abzuhalten. So ist das auch bei mir. Meine Sammelleidenschaft wurde wieder neu entfacht. Und das für meine treue Kindheitskonsole: das Super Nintendo. Bis heute hat es keine einzige Konsole geschafft mich so zu fesseln wie das SNES zu seiner Zeit. Auf keiner Konsole gab es so viele faszinierende Rollenspiele wie auf dem Super Nintendo. Höchste Zeit die Konsole mal wieder auszupacken und die Spielesammlung etwas zu erweitern. Insbesondere mit Spieleperlen wie Star Ocean, Tales of Phantasia, Secret of Mana 2, ... kurzum mit Spielen, die es nie nach Europa bzw. in die USA geschafft haben und die durch Fanübersetzungen für mich erst spielbar wurden. Da am Emulator kein so richtiges Flair aufkommen will, muss ein anderer Weg her diese Spiele auf dem SNES zu spielen. Das Stichwort heißt Cartmodding und damit verbunden auch andere Hardware-Hacks an der Konsole. Mehr zu diesen Themen bald hier auf dem Blog, bzw. auf einer gesonderten Projektseite.</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2010/02/15/sammelleidenschaft/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Neue Universität, alter Stress</title>
		<link>http://johker.ibutho.de/2010/02/11/neue-universitat-alter-stress/</link>
		<comments>http://johker.ibutho.de/2010/02/11/neue-universitat-alter-stress/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 08:51:04 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Studium]]></category>
		<category><![CDATA[Anerkennung]]></category>
		<category><![CDATA[Antrag]]></category>
		<category><![CDATA[BA Stuttgart]]></category>
		<category><![CDATA[Bachelor]]></category>
		<category><![CDATA[Beamte]]></category>
		<category><![CDATA[Bologna-Prozess]]></category>
		<category><![CDATA[Chaos]]></category>
		<category><![CDATA[ECTS]]></category>
		<category><![CDATA[Hochschule]]></category>
		<category><![CDATA[Master]]></category>
		<category><![CDATA[Prüfungsausschuss]]></category>
		<category><![CDATA[Ungerechtigkeit]]></category>
		<category><![CDATA[Universität]]></category>
		<category><![CDATA[Verwaltungshölle]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=289</guid>
		<description><![CDATA[Man sollte meinen andere Hochschulen seien besser organisiert als die Berufsakademie Stuttgart, doch weit gefehlt! Wenn ich einen Vergleich ziehe, dann ist die BA Stuttgart die bestorganisierte Hochschule, die ich kenne (allerdings kenne ich nur 2 Hochschulen). Sekretärinnen haben keine Sprechstunden, man hat definitive Ansprechpartner, Probleme können schnell, unkompliziert und unbürokratisch gelöst werden, ...
 Ganz [...]]]></description>
			<content:encoded><![CDATA[<p>Man sollte meinen andere Hochschulen seien besser organisiert als die Berufsakademie Stuttgart, doch weit gefehlt! Wenn ich einen Vergleich ziehe, dann ist die BA Stuttgart die bestorganisierte Hochschule, die ich kenne (allerdings kenne ich nur 2 Hochschulen). Sekretärinnen haben keine Sprechstunden, man hat definitive Ansprechpartner, Probleme können schnell, unkompliziert und unbürokratisch gelöst werden, ...<br />
 Ganz anders hier. Mit meiner Zulassung zum Masterstudiengang waren Zulassungsauflagen verbunden. Ich will hier nicht pauschal behaupten, dass man BA-Studenten damit einen Stein in den Weg legen will, z.B. weil man sie an regulären Hochschulen nicht oder nur sehr ungern aufnehmen will, aber der Eindruck kann schnell entstehen. Natürlich gab ich mich mit den Zulassungsauflagen nicht zufrieden, da ich alle Leistungen, die ich nachholen sollte schon an der BA Stuttgart erfolgreich erbracht habe. Also hieß es: Bescheinigungen an der BA einholen, Anträge schreiben, begründen, Gegenüberstellungstabellen ausfüllen, etc etc. Der Antrag ging letzte Woche dann endlich durch den Prüfungsausschuss und siehe da: er wurde in allen Punkten bewilligt. Mein (naheliegender) Schluss ist nun, dass einem wirklich jemand Steine in den Weg legen will oder dass Zulassungsanträge nicht individuell bearbeitet werden, sondern sobald ein gewisses Stichwort gefunden wurde (wie z.B. Berfusakademie) pauschal (nicht gerechtfertigte) Auflagen erteilt werden.<br />
Mein Tipp für alle, denen es ähnlich geht: Wenn ihr euch ungerecht behandelt fühlt, wehrt euch! Und wehrt euch früh, denn wenn man es erst kurz vor Semesterende macht, wie z.B. ich, dann ist der Stundenplan schon versaut und man kommt nicht auf seine XX ECTS-Punkte, die man in einem Semester sammeln soll, damit man das Studium in der Regelstudienzeit abschließen kann. Der Prüfungsausschuss ist gerne bereit sein "Urteil" zu revidieren, wenn man nachvollziehbar darlegt, dass man geforderte Leistungen schon erbracht hat.</p>
<p>P.S.: Meine Auflagen waren das Nachholen von Theoretischer Informatik, Mathematik 3 (z.B. Gleichungen mehrerer Veränderlicher, Integralrechnung), sowie Algorithmen. Also nicht gerade wenig Auflagen und auch nicht gerade wenig anspruchsvoll. Und vor allem völlig unnötig, wenn man die Leistungen schon erbracht hat...</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2010/02/11/neue-universitat-alter-stress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Der neue Server: Teil X Sonstiges</title>
		<link>http://johker.ibutho.de/2010/01/13/der-neue-server-teil-x-sonstiges/</link>
		<comments>http://johker.ibutho.de/2010/01/13/der-neue-server-teil-x-sonstiges/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 18:33:15 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[a2ensite]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[chrooted]]></category>
		<category><![CDATA[csr]]></category>
		<category><![CDATA[diffie-hellman]]></category>
		<category><![CDATA[guest]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[sftp]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssl]]></category>
		<category><![CDATA[tausch]]></category>
		<category><![CDATA[vHost]]></category>
		<category><![CDATA[vhost automation]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=159</guid>
		<description><![CDATA[Der Entwurf zu diesem Beitrag ist schon fast ein Jahr alt. Ich will ihn nun endlich mal veröffentlichen in der Hoffnung, dass er einigen Leuten hilft und ihnen Arbeit abnimmt.
------------------
In diesem Beitrag sind alle Dinge zusammengefasst, die thematisch nicht direkt zusammenpassen oder nicht direkt in einen einzigen Beitrag passen, da sie mehrere Themen streifen.
ssl-Zertifikat erstellen
Jetzt [...]]]></description>
			<content:encoded><![CDATA[<p>Der Entwurf zu diesem Beitrag ist schon fast ein Jahr alt. Ich will ihn nun endlich mal veröffentlichen in der Hoffnung, dass er einigen Leuten hilft und ihnen Arbeit abnimmt.</p>
<p>------------------</p>
<p>In diesem Beitrag sind alle Dinge zusammengefasst, die thematisch nicht direkt zusammenpassen oder nicht direkt in einen einzigen Beitrag passen, da sie mehrere Themen streifen.</p>
<h1>ssl-Zertifikat erstellen</h1>
<p>Jetzt erstellen wir ein <em>ssl</em>-Zertifikat, welches wir bei <a href="http://cacert.org/" target="_blank">cacert.org</a> signieren lassen. Dies bietet einige Vorteile gegenüber dem Selbst-Signieren (self-signing). Leider ist das <em>cacert.org</em> Root-Zertifikat noch nicht in Firefox aufgenommen und somit erhält man immer diese lästige Warnung, wenn man eine cacert-zertifizierte Webseite aufruft, bis man deren Root-Zertifikat in Firefox importiert.<br />
Am Besten geht man nach dieser Anleitung vor zum Erstellen eines Zertifikats: <a href="http://wiki.cacert.org/wiki/CSRGenerator" target="_blank">http://wiki.cacert.org/wiki/CSRGenerator</a>. Danach verschiebt man den Private-Key nach "<em>/etc/ssl/private</em>" und den Public-Key nach "<em>/etc/ssl/certs</em>". Nun kann man das Zertifikat z.B. in Apache verwenden, aber auch für den Mailserver, IMAP-/POP-Server, svn, ... Sollte eine Applikation nicht auf den Private-Key zugreifen können, benötigt aber Zugriff darauf, so muss man den Benutzer unter der die Applikation läuft in die Gruppe "<em>ssl-cert</em>" aufnehmen (<strong>ACHTUNG:</strong> Dies könnte ein Sicherheitsrisiko darstellen!).</p>
<h2>Diffie-Hellman-Code erzeugen</h2>
<p>Dies wird z.B. für postfix gebraucht, aber auch für einige IMAP-Server, deshalb erzeugen wir hier diesen Code und speichern ihn unter "/etc/ssl/private/":</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl gendh <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>dh_1024.pem <span style="color: #660033;">-2</span> <span style="color: #660033;">-rand</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom <span style="color: #000000;">1024</span>
openssl gendh <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>dh_512.pem <span style="color: #660033;">-2</span> <span style="color: #660033;">-rand</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom <span style="color: #000000;">512</span></pre></div></div>

<h2>SSL-vHost in apache erstellen</h2>
<p>Um in <em>apache</em> einen SSL-vHost erstellen kann, muss man die Datei <em>ports.conf</em> unter "<em>/etc/apache2</em>" ändern und die folgende Zeilen hinzufügen/ergänzen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_ssl.c<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #666666; font-style: italic;"># SSL name based virtual hosts are not yet supported, therefore no</span>
    <span style="color: #666666; font-style: italic;"># NameVirtualHost statement here</span>
    NameVirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">443</span>
    Listen <span style="color: #000000;">443</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>Danach können wie gehabt vHosts erstellt werden, mit dem Unterschied, dass die Zeile "<VirtualHost *:80>" in "<VirtualHost *:443>" geändert werden und folgende Zeilen hinzugefügt werden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">        SSLEngine on
        SSLCertificateFile <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>server.pem
        SSLCertificateKeyFile <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>privatekey.pem
        SSLCipherSuite HIGH
        SSLProtocol all <span style="color: #660033;">-SSLv2</span></pre></div></div>

<p>Weiter unten stelle ich ein Skript vor, mit welchem man bequem vHosts (sowohl mit und ohne SSL) erstellen kann und automatisch von Port 80 auf Port 443 weiterleiten, wenn der vHost SSL unterstützt.</p>
<p>Quellen:<br />
<a href="http://wiki.cacert.org/wiki/CSRGenerator" target="_blank">http://wiki.cacert.org/wiki/CSRGenerator</a><br />
<a href="http://cacert.org/" target="_blank">http://cacert.org/</a></p>
<h1>sftp-Gastzugang</h1>
<p>Oft möchte man Leuten einen Zuganz zu seinem Server verschaffen, damit man etwas in ein bestimmtes Verzeichnis hochladen, bzw. daraus herunterladen darf, aber nicht aus diesem Verzeichnis herausnavigieren darf und evtl. Schaden anrichten kann. Dies kann man mit openSSH 5.0 sehr einfach lösen, da es eingebaute chroot-Mechanismen hat. So kann man z.B. eine ganze Gruppe auf ihr Home-Laufwerk oder einen anderen Ordner beschränken oder aber auch nur einen einzigen Benutzer. Im Folgenden legen wir eine Gruppe "<em>chrooted</em>" an, welche auf ihr Home-Laufwerk beschränkt sein wird. Alle Home-Laufwerke dieser Gruppe werden standardmäßig unter "<em>/home/chrooted</em>" liegen. Für unseren Gastbenutzer legen wir darunter ein Verzeichnis "<em>upload</em>" an und ändern die Rechte entsprechend:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> upload
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #000000; font-weight: bold;">&lt;</span>uploaduser<span style="color: #000000; font-weight: bold;">&gt;</span>:<span style="color: #c20cb9; font-weight: bold;">users</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chrooted<span style="color: #000000; font-weight: bold;">/</span>upload
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chrooted<span style="color: #000000; font-weight: bold;">/</span>upload</pre></div></div>

<p>Will man Ordner außerhalb des Home-Laufwerks zugänglich machen, kann man diese mit "<em>mount -o bind</em>" temporär einbinden, bzw. über die "<em>/etc/fstab</em>" dauerhaft:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>pfad<span style="color: #000000; font-weight: bold;">/</span>zum<span style="color: #000000; font-weight: bold;">/</span>quellverzeichnis <span style="color: #000000; font-weight: bold;">/</span>pfad<span style="color: #000000; font-weight: bold;">/</span>zum<span style="color: #000000; font-weight: bold;">/</span>zielverzeichnis none rw,<span style="color: #7a0874; font-weight: bold;">bind</span> <span style="color: #000000;">0</span> <span style="color: #000000;">0</span></pre></div></div>

<p>Gruppe "<em>chrooted</em>" anlegen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">addgroup <span style="color: #660033;">--system</span> chrooted</pre></div></div>

<p>Um einen Benutzer in die Gruppe "<em>chrooted</em>" aufzunehmen, führt man folgenden Befehl aus:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser <span style="color: #000000; font-weight: bold;">&lt;</span>uploaduser<span style="color: #000000; font-weight: bold;">&gt;</span> chrooted</pre></div></div>

<p>Danach muss man die <em>sshd_config</em> anpassen, bzw. erweitern:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#Subsystem sftp /usr/lib/openssh/sftp-server</span>
Subsystem sftp internal-sftp
&nbsp;
Match group chrooted
        <span style="color: #666666; font-style: italic;"># chroot all users of these group to their homes</span>
        <span style="color: #666666; font-style: italic;"># %h will be substituted by the user's home</span>
        <span style="color: #666666; font-style: italic;"># %u will be substituted with the user's user name</span>
        ChrootDirectory <span style="color: #000000; font-weight: bold;">%</span>h
        AllowTcpForwarding no
        ForceCommand internal-sftp</pre></div></div>

<p>Wichtig ist, dass das Home-Verzeichnis des Benutzers <strong>root</strong> gehören muss ("chown root: /pfad/zu/home"). Die Unterordner sollten dann wieder dem Benutzer gehören, damit das ganze auch Sinn macht und er Dateien hoch-/runterladen kann. In unserem Beispiel bedeutet das, dass "<em>/home/chrooted</em>" root gehören muss und "<em>/home/chrooted/upload</em>" dem <uploaduser>.<br />
Zusätzlich kann man nun noch unter "/etc/passwd" die Standardkonsole des <uploadusers> auf "<em>/bin/false</em>" setzen, denn der Benutzer darf sich nur via <em>sftp</em> anmelden und nicht über die Konsole:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>uploaduser<span style="color: #000000; font-weight: bold;">&gt;</span>:x:<span style="color: #000000;">1666</span>:<span style="color: #000000;">1666</span>:Guest upload-account,,,:<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chrooted:<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">false</span></pre></div></div>

<p>Quellen:<br />
<a href="http://binblog.wordpress.com/2008/04/06/openssh-chrooted-sftp-eg-for-webhosting/" target="_blank">http://binblog.wordpress.com/2008/04/06/openssh-chrooted-sftp-eg-for-webhosting/</a><br />
<a href="http://www.debian-administration.org/articles/590" target="_blank">http://www.debian-administration.org/articles/590</a></p>
<h1>Tauschverzeichnis anlegen</h1>
<p>Da alle Konsolenbenutzer auch Mitglied in der Gruppe "<em>users</em>" sind, ist es ein leichtes ein Tausch-Verzeichnis unter "<em>/home/shared</em>" anzulegen. Darunter legen wir - der Benutzerfreundlichkeit zuliebe - einen Symlink nach "/home/chrooted/upload" an (siehe vorheriges Kapitel):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>shared
<span style="color: #c20cb9; font-weight: bold;">chown</span> root:<span style="color: #c20cb9; font-weight: bold;">users</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>shared
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>shared
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>chrooted<span style="color: #000000; font-weight: bold;">/</span>upload upload</pre></div></div>

<p>Nun können sich alle Konsolenbenutzer über dieses Verzeichnis austauschen und auf die Dateien des Gast-Accounts zugreifen, welche für ihn bereitstellen bzw. je nach Rechten auch welche löschen.</p>
<h1>vHosts-Skript</h1>
<p>Um einem die Arbeit etwas zu erleichtern habe ich schnell ein kleines <em>bash</em>-Skript runtergehackt, mit welchem man bequem vHosts unter <em>apache2</em> anlegen kann. Ist man nach <a href="http://johker.ibutho.de/2009/03/22/der-neue-server-teil-4-apache/">Der neue Server: Teil 4 apache</a> vorgegangen, so müssen im Skript normalerweise keine Änderungen vorgenommen werden, anderfalls braucht das Skript evtl. ein paar Anpassungen.</p>
<p>Hier das Skript:</p>
<p><i>createVhost.sh:</i></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># createVhost.sh - Creates an Apache2 vHost configuration</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Copyright (C) 2009 johker</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License v2 as published by the Free Software Foundation</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License v2 for more details.</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">### CHANGE ME! ###</span>
&nbsp;
<span style="color: #007800;">WWW_ROOT</span>=<span style="color: #ff0000;">&quot;/var/www&quot;</span>
<span style="color: #007800;">SITES_ROOT</span>=<span style="color: #ff0000;">&quot;/etc/apache2/sites-available&quot;</span>
&nbsp;
<span style="color: #007800;">CHANGE_PHP_INI</span>=<span style="color: #ff0000;">&quot;no&quot;</span>
&nbsp;
<span style="color: #007800;">EXAMPLE_ROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$WWW_ROOT</span>/example&quot;</span>
<span style="color: #007800;">SITES_EXAMPLE</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SITES_ROOT</span>/example&quot;</span>
<span style="color: #007800;">SITES_EXAMPLE_SSL</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SITES_EXAMPLE</span>-ssl&quot;</span>
&nbsp;
<span style="color: #007800;">SSL_PRIV_DEFAULT</span>=<span style="color: #ff0000;">&quot;/etc/ssl/private/privatekey.pem&quot;</span>
<span style="color: #007800;">SSL_PUB_DEFAULT</span>=<span style="color: #ff0000;">&quot;/etc/ssl/certs/publickey.pem&quot;</span>
&nbsp;
<span style="color: #007800;">PHP_INI_TEMPLATE</span>=<span style="color: #ff0000;">&quot;/etc/php5/cgi/php.ini&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### END CHANGE ME! ###</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#############################################################</span>
<span style="color: #666666; font-style: italic;">########## DO NOT CHANGE ANYTHING BELOW THIS LINE! ##########</span>
<span style="color: #666666; font-style: italic;">#############################################################</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Make sure only root can run our script</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$(id -u)</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;0&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ERROR: This script must be run as root!&quot;</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">2</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Query the user for some details</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Domain name: &quot;</span> SRV_NAME
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Domain aliases (leave blank if no aliases available, separated by blank): &quot;</span> SRV_ALIAS
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Admin e-mail address: &quot;</span> SRV_ADMIN
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;vHost owner (system user): &quot;</span> USER
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span>  <span style="color: #ff0000;">&quot;Use SSL (yes/no)[no]: &quot;</span> SSL
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$SSL</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #666666; font-style: italic;"># set default value</span>
	<span style="color: #007800;">SSL</span>=<span style="color: #ff0000;">&quot;no&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$SSL</span> == <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;SSL private key[<span style="color: #007800;">$SSL_PRIV_DEFAULT</span>]: &quot;</span> CERT_PRIV
	<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;SSL public key[<span style="color: #007800;">$SSL_PUB_DEFAULT</span>]: &quot;</span> CERT_PUB
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$CERT_PRIV</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #666666; font-style: italic;"># set default value</span>
		<span style="color: #007800;">CERT_PRIV</span>=<span style="color: #007800;">$SSL_PRIV_DEFAULT</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #007800;">$CERT_PUB</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #666666; font-style: italic;"># set default value</span>
		<span style="color: #007800;">CERT_PUB</span>=<span style="color: #007800;">$SSL_PUB_DEFAULT</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">VHOST_ROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$WWW_ROOT</span>/<span style="color: #007800;">$SRV_NAME</span>&quot;</span>
<span style="color: #007800;">DOC_ROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$VHOST_ROOT</span>/docs&quot;</span>
<span style="color: #007800;">CONF_ROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$VHOST_ROOT</span>/conf&quot;</span>
<span style="color: #007800;">LOG_ROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$VHOST_ROOT</span>/logs&quot;</span>
<span style="color: #007800;">TMP_ROOT</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$VHOST_ROOT</span>/tmp&quot;</span>
&nbsp;
<span style="color: #007800;">PHP_FCGI</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$CONF_ROOT</span>/php-fcgi.conf&quot;</span>
<span style="color: #007800;">PHP_INI</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$CONF_ROOT</span>/php.ini&quot;</span>
&nbsp;
<span style="color: #007800;">VHOST_CONF</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$SITES_ROOT</span>/<span style="color: #007800;">$SRV_NAME</span>&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># GROUP equals USER</span>
<span style="color: #007800;">GROUP</span>=<span style="color: #007800;">$USER</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> changeFcgiConfig <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># adjust fcgi config</span>
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{SRV_NAME}!<span style="color: #007800;">$SRV_NAME</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$PHP_FCGI</span>
	<span style="color: #666666; font-style: italic;"># ... php.ini</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CHANGE_PHP_INI</span> == <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!;upload_tmp_dir =!upload_tmp_dir = <span style="color: #007800;">$TMP_ROOT</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$PHP_INI</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!;open_basedir =!open_basedir = <span style="color: #007800;">$DOC_ROOT</span>:<span style="color: #007800;">$TMP_ROOT</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$PHP_INI</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!;session.save_path = /var/lib/php5!session.save_path = <span style="color: #007800;">$TMP_ROOT</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$PHP_INI</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> createDirs <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># create the directory structure</span>
&nbsp;
	<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$EXAMPLE_ROOT</span> <span style="color: #007800;">$VHOST_ROOT</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$CHANGE_PHP_INI</span> == <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #666666; font-style: italic;"># don't put a symlink to php.ini in $CONF_ROOT, but copy it there</span>
		<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$CONF_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>php.ini
		<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$PHP_INI_TEMPLATE</span> <span style="color: #007800;">$CONF_ROOT</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	changeFcgiConfig
&nbsp;
	<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #007800;">$USER</span>:<span style="color: #007800;">$GROUP</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$VHOST_ROOT</span>
&nbsp;
	<span style="color: #c20cb9; font-weight: bold;">chattr</span> +i <span style="color: #007800;">$CONF_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>php-fcgi.conf
	<span style="color: #666666; font-style: italic;"># as $CONF_ROOT/php.ini is just a symlink most of the time, chattr will usually fail</span>
	<span style="color: #c20cb9; font-weight: bold;">chattr</span> +i <span style="color: #007800;">$CONF_ROOT</span><span style="color: #000000; font-weight: bold;">/</span>php.ini <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> createApacheConfig <span style="color: #7a0874; font-weight: bold;">&#123;</span>
	<span style="color: #666666; font-style: italic;"># now let's adjust the apache vHost-configuration</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$SSL</span> == <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$SITES_EXAMPLE_SSL</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #000000; font-weight: bold;">else</span>
		<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #007800;">$SITES_EXAMPLE</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
	<span style="color: #666666; font-style: italic;"># now do sed operations on $VHOST_CONF</span>
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{SRV_NAME}!<span style="color: #007800;">$SRV_NAME</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$SRV_ALIAS</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{SRV_ALIAS}!!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #000000; font-weight: bold;">else</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{SRV_ALIAS}!<span style="color: #007800;">$SRV_ALIAS</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!#	ServerAlias!	ServerAlias!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{SRV_ADMIN}!<span style="color: #007800;">$SRV_ADMIN</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{USER}!<span style="color: #007800;">$USER</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{GROUP}!<span style="color: #007800;">$GROUP</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
&nbsp;
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{DOC_ROOT}!<span style="color: #007800;">$DOC_ROOT</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{CONF_ROOT}!<span style="color: #007800;">$CONF_ROOT</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{LOG_ROOT}!<span style="color: #007800;">$LOG_ROOT</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$SSL</span> == <span style="color: #ff0000;">&quot;yes&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{CERT_PUB}!<span style="color: #007800;">$CERT_PUB</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
		<span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #ff0000;">&quot;s!{CERT_PRIV}!<span style="color: #007800;">$CERT_PRIV</span>!g&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$VHOST_CONF</span>
	<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
createDirs
createApacheConfig
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>Die dazugehörenden Ordnerstruktur unter "<em>/var/www/example</em>":</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example<span style="color: #000000; font-weight: bold;">/</span>conf
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example<span style="color: #000000; font-weight: bold;">/</span>docs
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example<span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example<span style="color: #000000; font-weight: bold;">/</span>logs
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>access.log
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example<span style="color: #000000; font-weight: bold;">/</span>logs<span style="color: #000000; font-weight: bold;">/</span>error.log
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>php5<span style="color: #000000; font-weight: bold;">/</span>cgi<span style="color: #000000; font-weight: bold;">/</span>php.ini <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>example<span style="color: #000000; font-weight: bold;">/</span>conf<span style="color: #000000; font-weight: bold;">/</span>php.ini</pre></div></div>

<p>Hier noch die Datei "<em>php-fcgi.conf</em>", welche nach "<em>/var/www/example/conf/</em>" gehört: </p>
<p><i>php-fcgi.conf:</i></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">PHPRC</span>=<span style="color: #ff0000;">&quot;/var/www/{SRV_NAME}/conf&quot;</span>
<span style="color: #7a0874; font-weight: bold;">export</span> PHPRC
<span style="color: #007800;">PHP_FCGI_CHILDREN</span>=<span style="color: #000000;">3</span>
<span style="color: #7a0874; font-weight: bold;">export</span> PHP_FCGI_CHILDREN
<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php5-cgi</pre></div></div>

<p>Dazu noch die vHost-configs "example", sowie "example-ssl" unter /etc/apache2/sites-available":</p>
<ul>
<li><i>example</i>:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
        SuExecUserGroup <span style="color: #7a0874; font-weight: bold;">&#123;</span>USER<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>GROUP<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        ServerName <span style="color: #7a0874; font-weight: bold;">&#123;</span>SRV_NAME<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;">#	ServerAlias {SRV_ALIAS}</span>
        ServerAdmin <span style="color: #7a0874; font-weight: bold;">&#123;</span>SRV_ADMIN<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        DocumentRoot <span style="color: #7a0874; font-weight: bold;">&#123;</span>DOC_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span>
        AddHandler fcgid-script .php
        <span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #7a0874; font-weight: bold;">&#123;</span>DOC_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
                FCGIWrapper <span style="color: #7a0874; font-weight: bold;">&#123;</span>CONF_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>php-fcgi.conf .php
                Options +SymLinksIfOwnerMatch +MultiViews +ExecCGI <span style="color: #660033;">-Indexes</span>
                AllowOverride FileInfo AuthConfig
                Order allow,deny
                allow from all
        <span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
        ErrorLog <span style="color: #7a0874; font-weight: bold;">&#123;</span>LOG_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>error.log
        CustomLog <span style="color: #7a0874; font-weight: bold;">&#123;</span>LOG_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>access.log combined
        LogLevel warn
        ServerSignature Off
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

</li>
<li><i>example-ssl</i>:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">80</span><span style="color: #000000; font-weight: bold;">&gt;</span>
        ServerName <span style="color: #7a0874; font-weight: bold;">&#123;</span>SRV_NAME<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;">#	ServerAlias {SRV_ALIAS}</span>
        ServerAdmin <span style="color: #7a0874; font-weight: bold;">&#123;</span>SRV_ADMIN<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">&lt;</span>IfModule mod_ssl.c<span style="color: #000000; font-weight: bold;">&gt;</span>
          RewriteEngine   on
	  RewriteCond     <span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SERVER_PORT<span style="color: #7a0874; font-weight: bold;">&#125;</span> ^<span style="color: #000000;">80</span>$
          RewriteRule     ^<span style="color: #7a0874; font-weight: bold;">&#40;</span>.<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>$ https:<span style="color: #000000; font-weight: bold;">//%</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>SERVER_NAME<span style="color: #7a0874; font-weight: bold;">&#125;</span>$<span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>L,R<span style="color: #7a0874; font-weight: bold;">&#93;</span>
&nbsp;
	  RewriteLog      <span style="color: #7a0874; font-weight: bold;">&#123;</span>LOG_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>rewrite.log
          RewriteLogLevel <span style="color: #000000;">2</span>
	<span style="color: #000000; font-weight: bold;">&lt;/</span>IfModule<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
        ErrorLog <span style="color: #7a0874; font-weight: bold;">&#123;</span>LOG_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>error.log
        CustomLog <span style="color: #7a0874; font-weight: bold;">&#123;</span>LOG_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>access.log combined
        LogLevel warn
&nbsp;
        ServerSignature Off
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>VirtualHost <span style="color: #000000; font-weight: bold;">*</span>:<span style="color: #000000;">443</span><span style="color: #000000; font-weight: bold;">&gt;</span>
        SuExecUserGroup <span style="color: #7a0874; font-weight: bold;">&#123;</span>USER<span style="color: #7a0874; font-weight: bold;">&#125;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>GROUP<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        ServerName <span style="color: #7a0874; font-weight: bold;">&#123;</span>SRV_NAME<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #666666; font-style: italic;">#	ServerAlias {SRV_ALIAS}</span>
        ServerAdmin <span style="color: #7a0874; font-weight: bold;">&#123;</span>SRV_ADMIN<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
        SSLEngine on
        SSLCertificateFile <span style="color: #7a0874; font-weight: bold;">&#123;</span>CERT_PUB<span style="color: #7a0874; font-weight: bold;">&#125;</span>
        SSLCertificateKeyFile <span style="color: #7a0874; font-weight: bold;">&#123;</span>CERT_PRIV<span style="color: #7a0874; font-weight: bold;">&#125;</span>
        SSLCipherSuite HIGH
        SSLProtocol all <span style="color: #660033;">-SSLv2</span>
&nbsp;
        DocumentRoot <span style="color: #7a0874; font-weight: bold;">&#123;</span>DOC_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span>
        AddHandler fcgid-script .php
        <span style="color: #000000; font-weight: bold;">&lt;</span>Directory <span style="color: #7a0874; font-weight: bold;">&#123;</span>DOC_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
                FCGIWrapper <span style="color: #7a0874; font-weight: bold;">&#123;</span>CONF_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>php-fcgi.conf .php
                Options +SymLinksIfOwnerMatch +MultiViews +ExecCGI <span style="color: #660033;">-Indexes</span>
                AllowOverride FileInfo
                Order allow,deny
                allow from all
        <span style="color: #000000; font-weight: bold;">&lt;/</span>Directory<span style="color: #000000; font-weight: bold;">&gt;</span>
&nbsp;
        ErrorLog <span style="color: #7a0874; font-weight: bold;">&#123;</span>LOG_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>error.log
        CustomLog <span style="color: #7a0874; font-weight: bold;">&#123;</span>LOG_ROOT<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>access.log combined
        LogLevel warn
&nbsp;
        ServerSignature Off
<span style="color: #000000; font-weight: bold;">&lt;/</span>VirtualHost<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

</li>
</ul>
<p>Das Skript kann als Benutzer <strong>root</strong> ausgeführt werden. Es fragt nach ein paar Parametern (default-Werte stehen in eckigen Klammern und können durch Drücken der Eingabetaste übernommen werden) und erstellt dann den vHost und die dazugehörige Konfiguration. Nach Ausführen des Skripts muss der vHost noch mittels des "<em>a2ensite</em>"-Befehls aktiviert werden und die <em>apache</em>-Konfiguration muss neu eingelesen werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2010/01/13/der-neue-server-teil-x-sonstiges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AVI Dateien zusammenfügen</title>
		<link>http://johker.ibutho.de/2010/01/13/avi-dateien-zusammenfugen/</link>
		<comments>http://johker.ibutho.de/2010/01/13/avi-dateien-zusammenfugen/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 18:01:40 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tipps und Tricks]]></category>
		<category><![CDATA[avi]]></category>
		<category><![CDATA[avimerge]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[merge]]></category>
		<category><![CDATA[transcode]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=281</guid>
		<description><![CDATA[Das funktioniert entweder mit mencoder:

1
mencoder -forceidx -ovc copy -oac copy -o output.avi input1.avi input2.avi ...

Oder mit avimerge aus dem transcode package:

1
avimerge -o output.avi -i input1.avi input2.avi ...

]]></description>
			<content:encoded><![CDATA[<p>Das funktioniert entweder mit <i>mencoder</i>:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">mencoder <span style="color: #660033;">-forceidx</span> <span style="color: #660033;">-ovc</span> copy <span style="color: #660033;">-oac</span> copy <span style="color: #660033;">-o</span> output.avi input1.avi input2.avi ...</pre></td></tr></table></div>

<p>Oder mit <i>avimerge</i> aus dem <i>transcode</i> package:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">avimerge <span style="color: #660033;">-o</span> output.avi <span style="color: #660033;">-i</span> input1.avi input2.avi ...</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2010/01/13/avi-dateien-zusammenfugen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Seite mit Passwort schützen</title>
		<link>http://johker.ibutho.de/2009/10/29/wordpress-seite-mit-passwort-schutzen/</link>
		<comments>http://johker.ibutho.de/2009/10/29/wordpress-seite-mit-passwort-schutzen/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 13:45:26 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Tipps und Tricks]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[passwortschutz]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[protect]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=277</guid>
		<description><![CDATA[Lange habe ich nach dieser Funktion gesucht und nun habe ich sie endlich gefunden:
Rechts neben der Textbox zum Verfassen eines Beitrags gibts es einen Bereich "Publish". Dort kann man unter "Visibility" festlegen, ob eine Seite öffentlich, passwortgeschützt oder privat sein soll.
]]></description>
			<content:encoded><![CDATA[<p>Lange habe ich nach dieser Funktion gesucht und nun habe ich sie endlich gefunden:<br />
Rechts neben der Textbox zum Verfassen eines Beitrags gibts es einen Bereich "Publish". Dort kann man unter "Visibility" festlegen, ob eine Seite öffentlich, passwortgeschützt oder privat sein soll.</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/10/29/wordpress-seite-mit-passwort-schutzen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synergy</title>
		<link>http://johker.ibutho.de/2009/08/10/synergy/</link>
		<comments>http://johker.ibutho.de/2009/08/10/synergy/#comments</comments>
		<pubDate>Mon, 10 Aug 2009 09:00:14 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Tipps und Tricks]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=274</guid>
		<description><![CDATA[Ein geniales Tool, wenn man zwei Rechner hat und diese ohne teure Hardware mit der selben Maus/der selben Tastatur verwenden will. Zusätzlich steht auch noch eine gemeinsame Zwischenablage zur Verfügung.
Unter folgendem Link wird sehr einfach erklärt, wie man Synergy einrichtet:
http://gnuski.blogspot.com/2008/02/quicksynergy-quick-howto.html
]]></description>
			<content:encoded><![CDATA[<p>Ein geniales Tool, wenn man zwei Rechner hat und diese ohne teure Hardware mit der selben Maus/der selben Tastatur verwenden will. Zusätzlich steht auch noch eine gemeinsame Zwischenablage zur Verfügung.<br />
Unter folgendem Link wird sehr einfach erklärt, wie man <em>Synergy</em> einrichtet:<br />
<a href="http://gnuski.blogspot.com/2008/02/quicksynergy-quick-howto.html">http://gnuski.blogspot.com/2008/02/quicksynergy-quick-howto.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/08/10/synergy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Funambol Installation</title>
		<link>http://johker.ibutho.de/2009/08/09/funambol-installation/</link>
		<comments>http://johker.ibutho.de/2009/08/09/funambol-installation/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 15:18:46 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[funambol]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[synchronisierung]]></category>
		<category><![CDATA[synchronization]]></category>
		<category><![CDATA[syncml]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=269</guid>
		<description><![CDATA[Heute geht's um Funambol - einen Synchronisationsserver für Mobiltelefone, PIM Programme, ... Funambol bietet unter anderem auch Unterstützung für Push-Mail, Kalender-, Aufgaben- und Kontaktsynchronisation für viel Plattformen. Mehr Informationen gibts unter http://www.funambol.com/opensource.
Dieses Howto beschreibt die Installation von Funambol mit postgres als Datenbank-Backend.
Installation
Als Erstes laden wir den JDBC Treiber für postgres herunter: http://jdbc.postgresql.org/download/postgresql-8.3-605.jdbc3.jar
Danach das Funambol Installationspackage: [...]]]></description>
			<content:encoded><![CDATA[<p>Heute geht's um Funambol - einen Synchronisationsserver für Mobiltelefone, PIM Programme, ... Funambol bietet unter anderem auch Unterstützung für Push-Mail, Kalender-, Aufgaben- und Kontaktsynchronisation für viel Plattformen. Mehr Informationen gibts unter <a href="http://www.funambol.com/opensource" target="_blank">http://www.funambol.com/opensource</a>.<br />
Dieses Howto beschreibt die Installation von Funambol mit postgres als Datenbank-Backend.</p>
<h1>Installation</h1>
<p>Als Erstes laden wir den JDBC Treiber für postgres herunter: <a href="http://jdbc.postgresql.org/download/postgresql-8.3-605.jdbc3.jar">http://jdbc.postgresql.org/download/postgresql-8.3-605.jdbc3.jar</a><br />
Danach das Funambol Installationspackage: <a href="http://funambol.com/opensource/download.php?file_id=funambol-7.1.1.bin&#038;_=d">http://funambol.com/opensource/download.php?file_id=funambol-7.1.1.bin&#038;_=d</a><br />
Danach führen wir das Funambol Paket mit folgendem Befehl aus:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> funambol-7.1.1.bin</pre></td></tr></table></div>

<p>Wir wählen den Standard-Installationspfad, verneinen aber die Frage, ob wir den Server starten wollen.</p>
<h1>Konfiguration</h1>
<p>Danach kopieren wir den postgres JDBC-Treiber nach "<em>/opt/Funambol/tools/jre-1.5.0/jre/lib/ext/</em>" und legen einen postgres-Benutzer für Funambol an:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">su</span> - postgres
createuser <span style="color: #660033;">-P</span>
createdb funambol</pre></td></tr></table></div>

<p>Bei "<em>createuser</em>" geben wir als Namen "funambol" an und verneinen alle drei Fragen.<br />
Nun müssen die Datenbank-Einstellungen von Funambol geändert werden. Dazu editieren wir "<em>/opt/Funambol/ds-server/install.properties</em>":</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">jdbc.classpath=..<span style="color: #000000; font-weight: bold;">/</span>tools<span style="color: #000000; font-weight: bold;">/</span>jre-1.5.0<span style="color: #000000; font-weight: bold;">/</span>jre<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ext<span style="color: #000000; font-weight: bold;">/</span>postgresql-<span style="color: #000000;">8.3</span>-605.jdbc3.jar
jdbc.driver=org.postgresql.Driver
jdbc.url=jdbc:postgresql:funambol
jdbc.user=funambol
jdbc.password=<span style="color: #000000; font-weight: bold;">&lt;</span>PASSWORD<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Die Datei "<em>com/funambol/server/db/db.xml</em>" wird nach dem gleichen Schema bearbeitet. Danach muss "<em>/opt/Funambol/bin/install</em>" ausgeführt werden (ggf. zuvor die Umgebungsvariable JAVA_HOME setzen). Jetzt kann funambol per "<em>/opt/Funambol/bin/funambol start</em>" gestartet werden.</p>
<h2>Funambol in runlevel eintragen</h2>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>Funambol<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>funambol <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>
update-rc.d funambol defaults</pre></td></tr></table></div>

<h2>Funambol Admin-Tool</h2>
<p>Das Funambol Admin-Tool kann von der Funambol-Homepage heruntergeladen werden. Hier kann man das initiale Admin-Passwort ändern.<br />
Des Weiteren muss man im "Server Settings"-Tab die Server URI ändern. Sie sollte dieses Format haben:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">http:<span style="color: #000000; font-weight: bold;">//&lt;</span>SERVER<span style="color: #000000; font-weight: bold;">&gt;</span>:<span style="color: #000000; font-weight: bold;">&lt;</span>PORT<span style="color: #000000; font-weight: bold;">&gt;/</span>funambol<span style="color: #000000; font-weight: bold;">/</span>ds</pre></td></tr></table></div>

<h1>Testen</h1>
<p>Nun kann man sich mit URL, Benutzername und Passwort am Server anmelden und synchronisieren. Da Autoprovisioning aktiviert ist, kann man Benutzername und Passwort frei wählen. Dies sollte jedoch in einem Produktivsystem geändert werden, da sich sonst jeder am Server anmelden kann. Dazu muss man den Officer im "Server Settings"-Tab ändern.</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/08/09/funambol-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freien Speicherplatz auf ftp-Server bestimmen</title>
		<link>http://johker.ibutho.de/2009/08/03/freien-speicherplatz-auf-ftp-server-bestimmen/</link>
		<comments>http://johker.ibutho.de/2009/08/03/freien-speicherplatz-auf-ftp-server-bestimmen/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 09:07:33 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tipps und Tricks]]></category>
		<category><![CDATA[du]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[lftp]]></category>
		<category><![CDATA[space usage]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=267</guid>
		<description><![CDATA[In Zusammenhang mit meinem letzten Beitrag über Server-Backups hier noch ein kleiner Tipp wie man den freien Speicherplatz auf einem ftp-Server bestimmen kann:

1
echo du -hs . &#124; lftp -u &#60;BENUTZERNAME&#62;,&#60;PASSWORT&#62; &#60;SERVER&#62;

Sollte das Paket lftp nicht verfügbar sein, kann man es über apt nachinstallieren:

1
aptitude install lftp

Falls jemand weiß, ob und wie man den freien Speicherplatz direkt [...]]]></description>
			<content:encoded><![CDATA[<p>In Zusammenhang mit meinem letzten Beitrag über Server-Backups hier noch ein kleiner Tipp wie man den freien Speicherplatz auf einem ftp-Server bestimmen kann:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #c20cb9; font-weight: bold;">du</span> <span style="color: #660033;">-hs</span> . <span style="color: #000000; font-weight: bold;">|</span> lftp <span style="color: #660033;">-u</span> <span style="color: #000000; font-weight: bold;">&lt;</span>BENUTZERNAME<span style="color: #000000; font-weight: bold;">&gt;</span>,<span style="color: #000000; font-weight: bold;">&lt;</span>PASSWORT<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">&lt;</span>SERVER<span style="color: #000000; font-weight: bold;">&gt;</span></pre></td></tr></table></div>

<p>Sollte das Paket <strong>lftp</strong> nicht verfügbar sein, kann man es über apt nachinstallieren:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> lftp</pre></td></tr></table></div>

<p>Falls jemand weiß, ob und wie man den freien Speicherplatz direkt über <em>ncftp</em> erfragen kann, wäre ich über einen kleinen Kommentar dankbar.</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/08/03/freien-speicherplatz-auf-ftp-server-bestimmen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Der neue Server: Teil 9 Backup</title>
		<link>http://johker.ibutho.de/2009/08/02/der-neue-server-teil-9-backup/</link>
		<comments>http://johker.ibutho.de/2009/08/02/der-neue-server-teil-9-backup/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 15:05:25 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[c't]]></category>
		<category><![CDATA[duplicity]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[ftplicity]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgres]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/?p=261</guid>
		<description><![CDATA[Der Server ist zwar nicht mehr neu, aber dieser Beitrag ist evtl. dennoch für einige hilfreich. Deshalb: Viel Spaß!
Heute widme ich mich dem Thema Backup. Das habe ich viel zu stark vernachlässigt und will das jetzt nachholen. Das Tool der Wahl ist duplicity mit dem c't Wrapper-Skript ftplicity. Duplicity benutzt unter der Decke rsync zur [...]]]></description>
			<content:encoded><![CDATA[<p>Der Server ist zwar nicht mehr neu, aber dieser Beitrag ist evtl. dennoch für einige hilfreich. Deshalb: Viel Spaß!</p>
<p>Heute widme ich mich dem Thema Backup. Das habe ich viel zu stark vernachlässigt und will das jetzt nachholen. Das Tool der Wahl ist <strong><em>duplicity</em></strong> mit dem c't Wrapper-Skript <strong><em>ftplicity</em></strong>. Duplicity benutzt unter der Decke <em>rsync</em> zur Erkennung der Deltas. Das Skript wird so konfiguriert, dass es täglich ein inkrementelles Backup macht und monatlich ein volles Backup und dabei die alten Backups löscht. Während des Backup-Prozesses werden auch Backups der MySQL- und postgreSQL-Datenbanken mit den mitgelieferten Tools erstellt (nicht einfach durch Kopieren der Datenbankdateien, da man dabei einen inkonsistenten Zustand erwischen könnte und die Datenbank unbrauchbar ist).</p>
<h1>Installation</h1>
<p>Zuerst die Installation der benötigten Pakete:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> duplicity ncftp
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>ftplicity<span style="color: #000000; font-weight: bold;">/</span>ftplicity<span style="color: #000000; font-weight: bold;">/</span>1.5.0.2<span style="color: #000000; font-weight: bold;">/</span>ftplicity_1.5.0.2.tgz?<span style="color: #007800;">use_mirror</span>=switch
<span style="color: #c20cb9; font-weight: bold;">tar</span> xvfz ftplicity_1.5.0.2.tgz
<span style="color: #c20cb9; font-weight: bold;">mv</span> ftplicity_1.5.0.2<span style="color: #000000; font-weight: bold;">/</span>ftplicity <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> root: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ftplicity
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ftplicity</pre></td></tr></table></div>

<h1>Konfiguration</h1>
<h2>Erstellung eines GPG-Schlüssel für Backups</h2>
<p>Da <em>ftplicity</em> Backups automatisch verschlüsselt ablegt, ist es nötig einen GPG-Schlüssel zu erstellen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">gpg <span style="color: #660033;">--gen-key</span></pre></td></tr></table></div>

<p><code><br />
root@domain.tld:~# gpg --gen-key<br />
gpg (GnuPG) 1.4.9; Copyright (C) 2008 Free Software Foundation, Inc.<br />
This is free software: you are free to change and redistribute it.<br />
There is NO WARRANTY, to the extent permitted by law.</p>
<p>gpg: keyring `/root/.gnupg/secring.gpg' created<br />
Please select what kind of key you want:<br />
   (1) DSA and Elgamal (default)<br />
   (2) DSA (sign only)<br />
   (5) RSA (sign only)<br />
Your selection? <-- ENTER<br />
DSA keypair will have 1024 bits.<br />
ELG-E keys may be between 1024 and 4096 bits long.<br />
What keysize do you want? (2048) <-- ENTER<br />
Requested keysize is 2048 bits<br />
Please specify how long the key should be valid.<br />
         0 = key does not expire<br />
      <n>  = key expires in n days<br />
      <n>w = key expires in n weeks<br />
      <n>m = key expires in n months<br />
      <n>y = key expires in n years<br />
Key is valid for? (0) <-- ENTER<br />
Key does not expire at all<br />
Is this correct? (y/N) <-- y</p>
<p>You need a user ID to identify your key; the software constructs the user ID<br />
from the Real Name, Comment and Email Address in this form:<br />
    "Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"</p>
<p>Real name: Musterserver Backup<br />
Email address: backup@domain.tld<br />
Comment: Key for System Backups on domain.tld<br />
You selected this USER-ID:<br />
    "domain.tld Backup (Key for System Backups on domain.tld) <backup@domain.tld>"</p>
<p>Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? <-- O<br />
You need a Passphrase to protect your secret key.</p>
<p>Enter passphrase: <-- Passwort eingeben<br />
We need to generate a lot of random bytes. It is a good idea to perform<br />
some other action (type on the keyboard, move the mouse, utilize the<br />
disks) during the prime generation; this gives the random number<br />
generator a better chance to gain enough entropy.<br />
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.+++++++++++++++.+++++++++++++++.++++++++++++++++++++.+++++..+++++++++++++++>++++++++++>.+++++...........<+++++>+++++..<.+++++.....................................................>.+++++.....+++++</p>
<p>gpg: /root/.gnupg/trustdb.gpg: trustdb created<br />
gpg: key 123ABC45 marked as ultimately trusted<br />
public and secret key created and signed.</p>
<p>...<br />
</code></p>
<p>Die achtstellige ID (im Beispiel <strong>123ABC45</strong>) bitte merken, da diese später benötigt wird. Ebenso das Passwort.</p>
<p>Danach legen exportieren wir noch unsere Schlüssel (public/private), damit wir diese an einem sicheren Ort speichern können, damit unsere Daten nicht verloren gehen, sollte die Festplatte sich verabschieden:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">root<span style="color: #000000; font-weight: bold;">@</span>domain.tld:~<span style="color: #000000; font-weight: bold;">/</span>gpg-key<span style="color: #666666; font-style: italic;"># gpg --output backup_pub.gpg --armor --export 123ABC45</span>
root<span style="color: #000000; font-weight: bold;">@</span>domain.tld:~<span style="color: #000000; font-weight: bold;">/</span>gpg-key<span style="color: #666666; font-style: italic;"># gpg --output backup_sec.gpg --armor --export-secret-key 123ABC45</span></pre></td></tr></table></div>

<h2>ftplicity</h2>
<p>Nun starten wir ftplicity einmal, damit eine Standardkonfiguration angelegt wird, die wir an unsere Wünsche anpassen können:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">ftplicity system create</pre></td></tr></table></div>

<p>Nun editieren wir die Datei "<em>/root/.ftplicity/system/conf</em>":</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># gpg key data (for symmetric encryption comment out GPG_KEY)</span>
<span style="color: #007800;">GPG_KEY</span>=<span style="color: #ff0000;">'123ABC45'</span>
<span style="color: #007800;">GPG_PW</span>=<span style="color: #ff0000;">'PASSWORD'</span>
<span style="color: #666666; font-style: italic;"># gpg options passed from duplicity to gpg process (default='')</span>
<span style="color: #666666; font-style: italic;"># e.g. &quot;--trust-model pgp|classic|direct|always&quot; </span>
<span style="color: #666666; font-style: italic;">#   or &quot;--compress-algo=bzip2 --bzip2-compress-level=9&quot;</span>
<span style="color: #666666; font-style: italic;">#GPG_OPTS=''</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># credentials &amp; server address of the backup target (URL-Format)</span>
<span style="color: #666666; font-style: italic;"># syntax is</span>
<span style="color: #666666; font-style: italic;">#   scheme://user[:password]@host[:port]/[/]path</span>
<span style="color: #666666; font-style: italic;"># probably one out of</span>
<span style="color: #666666; font-style: italic;">#   file:///some_dir</span>
<span style="color: #666666; font-style: italic;">#   ftp://user[:password]@other.host[:port]/some_dir</span>
<span style="color: #666666; font-style: italic;">#   hsi://user[:password]@other.host/some_dir</span>
<span style="color: #666666; font-style: italic;">#   cf+http://container_name</span>
<span style="color: #666666; font-style: italic;">#   imap://user[:password]@host.com[/from_address_prefix]</span>
<span style="color: #666666; font-style: italic;">#   imaps://user[:password]@host.com[/from_address_prefix]</span>
<span style="color: #666666; font-style: italic;">#   rsync://user[:password]@other.host[:port]::/module/some_dir</span>
<span style="color: #666666; font-style: italic;">#   rsync://user[:password]@other.host[:port]/relative_path</span>
<span style="color: #666666; font-style: italic;">#   rsync://user[:password]@other.host[:port]//absolute_path</span>
<span style="color: #666666; font-style: italic;">#   s3://host/bucket_name[/prefix]</span>
<span style="color: #666666; font-style: italic;">#   s3+http://bucket_name[/prefix]</span>
<span style="color: #666666; font-style: italic;">#   scp://user[:password]@other.host[:port]/some_dir</span>
<span style="color: #666666; font-style: italic;">#   ssh://user[:password]@other.host[:port]/some_dir</span>
<span style="color: #666666; font-style: italic;">#   tahoe://alias/directory</span>
<span style="color: #666666; font-style: italic;">#   webdav://user[:password]@other.host/some_dir</span>
<span style="color: #666666; font-style: italic;">#   webdavs://user[:password]@other.host/some_dir </span>
<span style="color: #666666; font-style: italic;">###</span>
<span style="color: #666666; font-style: italic;"># TARGET='scheme://user[:password]@host[:port]/[/]path'</span>
<span style="color: #007800;">TARGET</span>=<span style="color: #ff0000;">'ftp://&lt;USER&gt;:&lt;PASS&gt;@&lt;HOST&gt;/&lt;DIR&gt;'</span>
<span style="color: #666666; font-style: italic;"># optionally the password can be defined as extra variable</span>
<span style="color: #666666; font-style: italic;"># if password is set already in TARGET, this setting replaces it</span>
<span style="color: #666666; font-style: italic;">#TARGET_PW='_backend_password_'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># base directory to backup</span>
<span style="color: #007800;">SOURCE</span>=<span style="color: #ff0000;">'/'</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Time frame for old backups to keep, Used for the &quot;purge&quot; command.  </span>
<span style="color: #666666; font-style: italic;"># see duplicity man page, chapter TIME_FORMATS)</span>
<span style="color: #666666; font-style: italic;"># defaults to 1M, if not set</span>
<span style="color: #666666; font-style: italic;">#MAX_AGE=1M</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Number of full backups to keep. Used for the &quot;purge-full&quot; command. </span>
<span style="color: #666666; font-style: italic;"># See duplicity man page, action &quot;remove-all-but-n-full&quot;.</span>
<span style="color: #666666; font-style: italic;"># defaults to 1, if not set </span>
<span style="color: #666666; font-style: italic;">#MAX_FULL_BACKUPS=1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># verbosity of output (5 for gpg errors, 9 for bug fixing)</span>
<span style="color: #666666; font-style: italic;"># default is 4, if not set</span>
<span style="color: #666666; font-style: italic;">#VERBOSITY=5</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># temporary file space. at least the size of the biggest file in backup</span>
<span style="color: #666666; font-style: italic;"># for a successful restoration process. (default is '/tmp', if not set)</span>
<span style="color: #666666; font-style: italic;">#TEMP_DIR=/tmp</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sets duplicity --time-separator option (since v0.4.4.RC2) to allow users </span>
<span style="color: #666666; font-style: italic;"># to change the time separator from ':' to another character that will work </span>
<span style="color: #666666; font-style: italic;"># on their system.  HINT: For Windows SMB shares, use --time-separator='_'.</span>
<span style="color: #666666; font-style: italic;"># NOTE: '-' is not valid as it conflicts with date separator.</span>
<span style="color: #666666; font-style: italic;"># ATTENTION: only use this with duplicity &lt; 0.5.10, since then default file </span>
<span style="color: #666666; font-style: italic;">#            naming is compatible and this option is pending depreciation </span>
<span style="color: #666666; font-style: italic;">#DUPL_PARAMS=&quot;$DUPL_PARAMS --time-separator _ &quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># activates duplicity --short-filenames option, when uploading to a file</span>
<span style="color: #666666; font-style: italic;"># system that can't have filenames longer than 30 characters (e.g. Mac OS 8)</span>
<span style="color: #666666; font-style: italic;"># or have problems with ':' as part of the filename (e.g. Microsoft Windows)</span>
<span style="color: #666666; font-style: italic;"># ATTENTION: only use this with duplicity &lt; 0.5.10, since then default file </span>
<span style="color: #666666; font-style: italic;">#            naming is compatible and this option is pending depreciation  </span>
<span style="color: #666666; font-style: italic;">#DUPL_PARAMS=&quot;$DUPL_PARAMS --short-filenames &quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># activates duplicity --full-if-older-than option (since duplicity v0.4.4.RC3) </span>
<span style="color: #666666; font-style: italic;"># forces a full backup if last full backup reaches a specified age, for the </span>
<span style="color: #666666; font-style: italic;"># format of MAX_FULLBKP_AGE see duplicity man page, chapter TIME_FORMATS</span>
<span style="color: #666666; font-style: italic;">#MAX_FULLBKP_AGE=1M</span>
<span style="color: #666666; font-style: italic;">#DUPL_PARAMS=&quot;$DUPL_PARAMS --full-if-older-than $MAX_FULLBKP_AGE &quot; </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># sets duplicity --volsize option (available since v0.4.3.RC7)</span>
<span style="color: #666666; font-style: italic;"># set the size of backup chunks to VOLSIZE MB instead of the default 5MB.</span>
<span style="color: #666666; font-style: italic;"># VOLSIZE must be number of MB's to set the volume size to. </span>
<span style="color: #666666; font-style: italic;">#VOLSIZE=50</span>
<span style="color: #666666; font-style: italic;">#DUPL_PARAMS=&quot;$DUPL_PARAMS --volsize $VOLSIZE &quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># more duplicity command line options can be added in the following way</span>
<span style="color: #666666; font-style: italic;"># don't forget to leave a separating space char at the end</span>
<span style="color: #666666; font-style: italic;">#DUPL_PARAMS=&quot;$DUPL_PARAMS --put_your_options_here &quot;</span></pre></td></tr></table></div>

<p>Und nun noch die Datei "<em>/root/.ftplicity/system/exclude</em>":</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>dev
<span style="color: #000000; font-weight: bold;">/</span>proc
<span style="color: #000000; font-weight: bold;">/</span>sys
<span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache
<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run</pre></td></tr></table></div>

<p>Danach erstellen wir unter "<em>/usr/local/sbin/</em>" die Datei <strong>db_backup</strong> mit Rechten "700":</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Script to backup MySQL and postgreSQL databases</span>
<span style="color: #666666; font-style: italic;"># author: johker</span>
&nbsp;
<span style="color: #666666; font-style: italic;">############### CHANGE THESE VARIABLE IF NECESSARY ####################</span>
&nbsp;
<span style="color: #007800;">MYSQL_USER</span>=<span style="color: #ff0000;">&quot;MYSQL_USER&quot;</span>
<span style="color: #007800;">MYSQL_PW</span>=<span style="color: #ff0000;">&quot;MYSQL_PASSWORD&quot;</span>
<span style="color: #007800;">POSTGRES_USER</span>=<span style="color: #ff0000;">&quot;POSTGRES_USER&quot;</span>
<span style="color: #007800;">POSTGRES_PW</span>=<span style="color: #ff0000;">&quot;POSTGRES_PASSWORD&quot;</span>
<span style="color: #007800;">TMP</span>=<span style="color: #ff0000;">&quot;/tmp/&quot;</span>
<span style="color: #007800;">FINAL_LOC</span>=<span style="color: #ff0000;">&quot;/var/backups/&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">################ DON'T CHANGE ANYTHING BELOW THIS LINE ################</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Creating backup of MySQL databases&quot;</span>
mysqldump -u<span style="color: #007800;">$MYSQL_USER</span> -p<span style="color: #007800;">$MYSQL_PW</span> <span style="color: #660033;">--all-databases</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$FINAL_LOC</span><span style="color: #ff0000;">&quot;mysql.sql&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$FINAL_LOC</span><span style="color: #ff0000;">&quot;mysql.sql&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Creating backup of postgreSQL databases&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;cd <span style="color: #007800;">$TMP</span> &amp;&amp; pg_dumpall &gt; <span style="color: #007800;">$TMP</span>'postgres.out'&quot;</span> <span style="color: #007800;">$POSTGRES_USER</span>
<span style="color: #c20cb9; font-weight: bold;">gzip</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$TMP</span><span style="color: #ff0000;">'postgres.out'</span> 
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$TMP</span><span style="color: #ff0000;">'postgres.out.gz'</span> <span style="color: #007800;">$FINAL_LOC</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">640</span> <span style="color: #007800;">$FINAL_LOC</span><span style="color: #ff0000;">&quot;mysql.sql.gz&quot;</span> <span style="color: #007800;">$FINAL_LOC</span><span style="color: #ff0000;">&quot;postgres.out.gz&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">chown</span> root: <span style="color: #007800;">$FINAL_LOC</span><span style="color: #ff0000;">&quot;mysql.sql.gz&quot;</span> <span style="color: #007800;">$FINAL_LOC</span><span style="color: #ff0000;">&quot;postgres.out.gz&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<p>Und in die Datei "<em>/root/.ftplicity/system/pre</em>" fügen wir folgende Zeile ein:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>db_backup</pre></td></tr></table></div>

<h2>Testen</h2>
<p>Mit folgendem Befehl kann man die ftplicity-Konfiguration testen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ftplicity system status</pre></div></div>

<p>Wenn alles o.k. ist, kann man mit folgedem Befehl ein initiales Backup anlegen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ftplicity system backup</pre></div></div>

<h2>Erstellen eines Cronjobs</h2>
<p>Da wir das Backup nicht jedes mal händisch anstoßen wollen, hier einträge für die crontab von root (editierbar per "<em>crontab -e</em>" als Benutzer <em>root</em>):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># run the (incremental) backup each night at 03:23h</span>
<span style="color: #000000;">23</span> <span style="color: #000000;">3</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ftplicity system backup
<span style="color: #666666; font-style: italic;"># do a full backup once per month &amp; delete old backups at 04:47h</span>
<span style="color: #000000;">47</span> <span style="color: #000000;">4</span> <span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ftplicity system purge <span style="color: #660033;">--force</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ftplicity system purge-full <span style="color: #660033;">--force</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ftplicity system full</pre></td></tr></table></div>

<h1>Quellen</h1>
<p>http://www.howtoforge.com/ftp-backups-with-duplicity-ftplicity-debian-etch</p>
<p>http://maff.ailoo.net/2009/07/backup-virtual-machines-lvm-snapshots-ftplicity-duplicity/</p>
<p>http://robert.penz.name/161/howto-backup-your-dedicated-server-to-a-foreign-ftp-server/</p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/08/02/der-neue-server-teil-9-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Update</title>
		<link>http://johker.ibutho.de/2009/08/01/wordpress-update/</link>
		<comments>http://johker.ibutho.de/2009/08/01/wordpress-update/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 11:05:15 +0000</pubDate>
		<dc:creator>johker</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[reibungslos]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://johker.ibutho.de/2009/08/01/wordpress-update/</guid>
		<description><![CDATA[Habe gerade eben ein automatisches Upgrade von Version 2.7.1 auf Version 2.8.2 durchgeführt. Hat wunderbar funktioniert. Ich muss mir ganz ehrlich eingestehen, dass ich nicht gedacht hätte, dass das reibungslos funktioniert. Naja, bin ich vielleicht etwas zu sehr an Linux gewöhnt  
]]></description>
			<content:encoded><![CDATA[<p>Habe gerade eben ein automatisches Upgrade von Version 2.7.1 auf Version 2.8.2 durchgeführt. Hat wunderbar funktioniert. Ich muss mir ganz ehrlich eingestehen, dass ich nicht gedacht hätte, dass das reibungslos funktioniert. Naja, bin ich vielleicht etwas zu sehr an Linux gewöhnt <img src='http://johker.ibutho.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://johker.ibutho.de/2009/08/01/wordpress-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
