<?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>WEBPIRATEN &#187; Lighttpd</title>
	<atom:link href="http://webpiraten.de/index.php/category/server/lighttpd/feed/" rel="self" type="application/rss+xml" />
	<link>http://webpiraten.de</link>
	<description>TECHNOLOGIE-BLOG</description>
	<lastBuildDate>Sun, 20 Jun 2010 19:00:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>HTTP Authentifizierung mit Lighttpd</title>
		<link>http://webpiraten.de/index.php/2009/10/http-authentifizierung-mit-lighttpd/</link>
		<comments>http://webpiraten.de/index.php/2009/10/http-authentifizierung-mit-lighttpd/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 21:19:06 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[authentifizierung]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[lighty]]></category>
		<category><![CDATA[passwort]]></category>
		<category><![CDATA[passwortschutz]]></category>
		<category><![CDATA[verzeichnis]]></category>
		<category><![CDATA[vhost]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=122</guid>
		<description><![CDATA[Um im schlanken Webserver Lighty eine HTTP Authentifizierung für bestimmte Verzeichnisse zu erzeugen, ist es notwendig, in der /etc/lighttpd/lighttpd.conf das Server-Modul mod_access und mod_auth zu aktivieren. server.modules = ( &#34;mod_access&#34;, &#34;mod_auth&#34;, &#34;mod_alias&#34;, &#34;mod_accesslog&#34;, &#34;mod_compress&#34;, &#34;mod_cgi&#34;, &#34;mod_fastcgi&#34;, &#34;mod_rewrite&#34;, &#34;mod_magnet&#34;, &#34;mod_redirect&#34;, &#34;mod_status&#34;, ) Um ein Verzeichnis unterhalb eines bestehenden Webroots nun mit einer Authentifizierung zu schützen, tragen [...]]]></description>
			<content:encoded><![CDATA[<p>Um im schlanken Webserver Lighty eine HTTP Authentifizierung für bestimmte Verzeichnisse zu erzeugen, ist es notwendig, in der <strong>/etc/lighttpd/lighttpd.conf</strong> das Server-Modul <strong>mod_access</strong> und <strong>mod_auth</strong> zu aktivieren.</p>
<pre class="brush: bash;">

server.modules = (
                    &quot;mod_access&quot;,
                    &quot;mod_auth&quot;,
                    &quot;mod_alias&quot;,
                    &quot;mod_accesslog&quot;,
                    &quot;mod_compress&quot;,
                    &quot;mod_cgi&quot;,
                    &quot;mod_fastcgi&quot;,
                    &quot;mod_rewrite&quot;,
                    &quot;mod_magnet&quot;,
                    &quot;mod_redirect&quot;,
                    &quot;mod_status&quot;,
                    )
</pre>
<p>Um ein Verzeichnis unterhalb eines bestehenden Webroots nun mit einer Authentifizierung zu schützen, tragen wir das in der <strong>/etc/lighttpd/vhosts.conf</strong> ein.</p>
<pre class="brush: bash;">

$HTTP[&quot;host&quot;] =~ &quot;(^|\.)domain\.tld$&quot; {
        server.document-root = &quot;/home/user/pages/&quot;
        auth.backend = &quot;htpasswd&quot;
        auth.backend.htpasswd.userfile = &quot;/home/user/passwd.txt&quot;
        auth.require = (&quot;/&quot; =&gt; (
                                 &quot;method&quot; =&gt; &quot;basic&quot;,
                                 &quot;realm&quot; =&gt; &quot;admin&quot;,
                                 &quot;require&quot; =&gt; &quot;valid-user&quot;
                                 )
                         )
}
</pre>
<p>Zu guter Letzt benötigen wir noch die <strong>/home/user/passwd.txt</strong> die die betreffenden Authentifizierungsinfos bereit hält.</p>
<pre class="brush: bash;">

user:basic_encoded_password
</pre>
<p>Fortan ist der Ordner <strong>/home/user/pages/</strong> passwortgeschützt.<br />
Möchte man einen Unterordner passwortschützen, trägt man diesen statt des Slashes ein:</p>
<pre class="brush: bash;">

auth.require = (&quot;/subdir/&quot; =&gt; (
                                  &quot;method&quot;  =&gt; &quot;basic&quot;,
                                  &quot;realm&quot;   =&gt; &quot;admin&quot;,
                                  &quot;require&quot; =&gt; &quot;valid-user&quot;
                                  )
            )
</pre>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/2009/10/http-authentifizierung-mit-lighttpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
