<?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 &#187; chrooted</title>
	<atom:link href="http://johker.ibutho.de/tag/chrooted/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>Sat, 29 May 2010 10:00:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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>
	</channel>
</rss>
