Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Aphorismen
Applications
Business Economics & Admin.
My Computers
Cooking
Devices
Folders
Food
Hardware
Infos
Software Development
Sports
Operation Instructions
Todos
Test
Help
Glossary
Community portal
adaptions
Sidebar anpassen
Wiki RB4
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Apache
(section)
Page
Discussion
English
Read
Edit
View history
Toolbox
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Zugriffsschutz== Apache has three distinct ways of dealing with the question of whether a particular request for a resource will result in that resource actually be returned. These criteria are called Authorization, Authentication, and Access control. '''Authentication''' is any process by which you verify that someone is who they claim they are. This usually involves a username and a password, but can include any other method of demonstrating identity, such as a smart card, retina scan, voice recognition, or fingerprints. Authentication is equivalent to showing your drivers license at the ticket counter at the airport. '''Authorization''' is finding out if the person, once identified, is permitted to have the resource. This is usually determined by finding out if that person is a part of a particular group, if that person has paid admission, or has a particular level of security clearance. Authorization is equivalent to checking the guest list at an exclusive party, or checking for your ticket when you go to the opera. Finally, '''access control''' is a much more general way of talking about controlling access to a web resource. Access can be granted or denied based on a wide variety of criteria, such as the network address of the client, the time of day, the phase of the moon, or the browser which the visitor is using. Access control is analogous to locking the gate at closing time, or only letting people onto the ride who are more than 48 inches tall - it's controlling entrance by some arbitrary condition which may or may not have anything to do with the attributes of the particular visitor. Die weitaus häufigste Umsetzung des Zugriffsschutz basiert auf den Dateien .htaccess (Standardname, der per Apache-Einstellung geändert werden kann) und .htpasswd basierende Passwortschutz. An .htaccess file is simply a text file containing Apache directives. Those directives apply to the documents in the directory where the .htaccess file is located, and to all subdirectories under it as well. Other .htaccess files in subdirectories may change or nullify the effects of those in parent directories. Die Einstellungen, die in der Datei .htaccess vorgenommen werden müssen, lassen sich ebenso in den Apache-Konfigurationsdateien httpd.conf oder access.conf bewerkstelligen. Der Weg per .htaccess reichlich in der Literatur und im Web dokumentiert ist, die Methode per httpd.conf ist einfach und komfortabel. Damit .htaccess funktioniert muss AllowOverride in http.conf entsprechend gesetzt sein. Die Einrichtung des Schutzes passiert nach folgendem Prinzip: in einer Datei (.htaccess, access.conf, oder httpd.conf), die normalerweise wird das Verzeichnis angegeben, das geschützt werden soll sowie der Pfad der Passwort-Datei. In der wiederum stehen die Usernamen und deren verschlüsselte Passwörter. Im Folgenden wird als Dateiname .passwort gewählt. Mit dem (unter Linux und anderen Unixen) standardmäßig installierten Programm htpasswd wird die Passwort-Datei erzeugt und editiert (vorher als root anmelden): '''htpasswd -c''' <Pfad>'''/.passwort tux''' '''htpasswd''' <Pfad>'''/.passwort geeko''' Im ersten Schritt wird die Datei erzeugt (-c für create) und der Benutzer Tux angelegt. Im zweiten der Benutzer Geeko hinzugefügt. Jedes mal wird man nach Eingabe eines Passwortes mit anschließender Wiederholung gefragt. Zu beachten ist, daß der Pfad der Passwortdatei über dem Document root-Pfad liegt, damit die Datei von außen nicht erreichbar ist. Die Verschlüsselung (durch die Unix-Funktion crypt()) ist zwar sicher. Trotzdem soll der User ja auch nicht die Zugangsnamen der berechtigten User sehen, die unverschlüsselt in der Datei auftauchen. Die Datei .passwort sieht nämlich jetzt ungefähr so aus: '''tux:nxvWrU1S95NnU''' '''geeko:nxvWrU1S95NnU''' Anschießend wird die Datei /etc/httpd/httpd.conf, die Konfigurationsdatei für den Apache-Server, editiert und der Apache anschließend neu gestartet (beides als root). Möglicherweise sind Zugangsanweisungen auch in der Datei /etc/httpd/access.conf eingetragen. Dann sollte man die Änderungen dort vornehmen. Im folgenden wird davon ausgegangen, dass die komplette Apache-Konfiguration in httpd.conf realisiert ist. Falls schon Verzeichnisse geschützt sind, schreibe man günstigerweise die neuen Anweisungen in die Nähe der schon bestehenden. Dazu suche man nach dem String "<Directory". Folgender Abschnitt ist dann einzufügen: # hier steht das Verzeichnis, das samt den Dokumenten geschützt werden soll <Directory /usr/local/httpd/htdocs/myhomepage/vip> # frei wählbarer Name des Bereiches, der bei der Anmeldung angezeigt wird AuthName "VIPs region" # die Art der Identifizierung, i.d.R. "Basic" eintragen AuthType Basic # der Pfad der Passwort-Datei, hier im gleichen Verzeichnis wie httpd.conf AuthUserFile /etc/httpd/.passwort # die Zugangsberechtigten require user geeko tux </Directory> Möglich ist auch die Angabe require valid-user, wodurch alle in der Passwort-Datei aufgelisteten User zugangsberechtigt sind. Danach muß der Apache neu gestartet werden. Zusätzlich besteht die Möglichkeit, eine ganze Gruppe zu definieren. Dazu muß eine Gruppen-Datei angelegt werden, die wiederum in der httpd.conf festgelegt wird. Dann kommen folgende Zeilen hinzu (bzw. kann dann auch die Zeile mit AuthUserFile... wegfallen): '''AuthGroupFile /etc/httpd/.group''' '''require group vips''' Die Datei .group hat dann folgenden Inhalt: '''vips: tux geeko''' Die Passwort-Datei mus im gleichen Verzeichnis stehen wie die Gruppen-Datei. Die Dateien .passwort und .group müssen für alle lesbar sein, also müssen folgende Rechte gesetzt werden: '''chmod 644 .passwort''' '''chmod 644 .group''' Zwei weitere Möglichkeiten des Zugriffsschutzes bestehen noch: Der limitierte Zugriff für bestimmte hosts, die in der httpd.conf definiert werden müssen und YP-basierter Zugriffsschutz.
Summary:
Please note that all contributions to Wiki RB4 may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Uwe Heuer Wiki New:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width