{"id":122,"date":"2009-10-27T22:19:06","date_gmt":"2009-10-27T21:19:06","guid":{"rendered":"http:\/\/webpiraten.de\/?p=122"},"modified":"2009-10-28T20:00:06","modified_gmt":"2009-10-28T19:00:06","slug":"http-authentifizierung-mit-lighttpd","status":"publish","type":"post","link":"https:\/\/webpiraten.de\/index.php\/server\/http-authentifizierung-mit-lighttpd\/","title":{"rendered":"HTTP Authentifizierung mit Lighttpd"},"content":{"rendered":"<p>Um im schlanken Webserver Lighty eine HTTP Authentifizierung f\u00fcr 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>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\r\nserver.modules = (\r\n                    &quot;mod_access&quot;,\r\n                    &quot;mod_auth&quot;,\r\n                    &quot;mod_alias&quot;,\r\n                    &quot;mod_accesslog&quot;,\r\n                    &quot;mod_compress&quot;,\r\n                    &quot;mod_cgi&quot;,\r\n                    &quot;mod_fastcgi&quot;,\r\n                    &quot;mod_rewrite&quot;,\r\n                    &quot;mod_magnet&quot;,\r\n                    &quot;mod_redirect&quot;,\r\n                    &quot;mod_status&quot;,\r\n                    )\r\n\r\n<\/pre>\n<p>Um ein Verzeichnis unterhalb eines bestehenden Webroots nun mit einer Authentifizierung zu sch\u00fctzen, tragen wir das in der <strong>\/etc\/lighttpd\/vhosts.conf<\/strong> ein.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\r\n$HTTP&#x5B;&quot;host&quot;] =~ &quot;(^|\\.)domain\\.tld$&quot; {\r\n        server.document-root = &quot;\/home\/user\/pages\/&quot;\r\n        auth.backend = &quot;htpasswd&quot;\r\n        auth.backend.htpasswd.userfile = &quot;\/home\/user\/passwd.txt&quot;\r\n        auth.require = (&quot;\/&quot; =&gt; (\r\n                                 &quot;method&quot; =&gt; &quot;basic&quot;,\r\n                                 &quot;realm&quot; =&gt; &quot;admin&quot;,\r\n                                 &quot;require&quot; =&gt; &quot;valid-user&quot;\r\n                                 )\r\n                         )\r\n}\r\n\r\n<\/pre>\n<p>Zu guter Letzt ben\u00f6tigen wir noch die <strong>\/home\/user\/passwd.txt<\/strong> die die betreffenden Authentifizierungsinfos bereit h\u00e4lt.<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\r\nuser:basic_encoded_password\r\n\r\n<\/pre>\n<p>Fortan ist der Ordner <strong>\/home\/user\/pages\/<\/strong> passwortgesch\u00fctzt.<br \/>\nM\u00f6chte man einen Unterordner passwortsch\u00fctzen, tr\u00e4gt man diesen statt des Slashes ein:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n\r\nauth.require = (&quot;\/subdir\/&quot; =&gt; (\r\n                                  &quot;method&quot;  =&gt; &quot;basic&quot;,\r\n                                  &quot;realm&quot;   =&gt; &quot;admin&quot;,\r\n                                  &quot;require&quot; =&gt; &quot;valid-user&quot;\r\n                                  )\r\n            )\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Um im schlanken Webserver Lighty eine HTTP Authentifizierung f\u00fcr 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 = ( &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;, ) Um ein Verzeichnis unterhalb eines bestehenden Webroots nun mit einer Authentifizierung zu sch\u00fctzen, tragen [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,75,54,76],"tags":[87,85,86,642,83,88,89,90,84],"class_list":["post-122","post","type-post","status-publish","format-standard","hentry","category-lighttpd","category-linux","category-server","category-shell","tag-authentifizierung","tag-htaccess","tag-http","tag-lighttpd","tag-lighty","tag-passwort","tag-passwortschutz","tag-verzeichnis","tag-vhost"],"_links":{"self":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/122","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/comments?post=122"}],"version-history":[{"count":13,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/122\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/posts\/122\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/media?parent=122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/categories?post=122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webpiraten.de\/index.php\/wp-json\/wp\/v2\/tags?post=122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}