authentifizierung_htaccess
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende ÜberarbeitungNächste Überarbeitung | Vorhergehende Überarbeitung | ||
| authentifizierung_htaccess [2021/01/09 13:51] – mho | authentifizierung_htaccess [2021/01/12 20:51] (aktuell) – mho | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | __false__ | ||
| + | ====== Apache2: Zugriffsschutz Basic ====== | ||
| + | |||
| + | In der entsprechenden / | ||
| + | im Berech < | ||
| + | AuthName " | ||
| + | AuthType Basic | ||
| + | AuthUserFile berechtigte_User.sec | ||
| + | Require valid-user | ||
| + | |||
| + | Beispieldatei: | ||
| + | < | ||
| + | < | ||
| + | # The ServerName directive sets the request scheme, hostname and port that | ||
| + | # the server uses to identify itself. This is used when creating | ||
| + | # redirection URLs. In the context of virtual hosts, the ServerName | ||
| + | # specifies what hostname must appear in the request' | ||
| + | # match this virtual host. For the default virtual host (this file) this | ||
| + | # value is not decisive as it is used as a last resort host regardless. | ||
| + | # However, you must set it for any further virtual host explicitly. | ||
| + | # | ||
| + | |||
| + | ServerName www.meinwebserver.de | ||
| + | Serveralias meinwebserver.de | ||
| + | ServerAdmin meinemailadresse@gmx.de | ||
| + | DocumentRoot / | ||
| + | |||
| + | < | ||
| + | order deny,allow | ||
| + | allow from all | ||
| + | |||
| + | AuthName " | ||
| + | AuthType Basic | ||
| + | AuthUserFile Eingangskontrolle.list | ||
| + | Require valid-user | ||
| + | </ | ||
| + | |||
| + | # bestimmte Verzeichnisse über Web nicht ansprechbar machen, soll nur über die Webapp funktionieren | ||
| + | < | ||
| + | Order allow,deny | ||
| + | Deny from all | ||
| + | Satisfy All | ||
| + | </ | ||
| + | |||
| + | # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, | ||
| + | # error, crit, alert, emerg. | ||
| + | # It is also possible to configure the loglevel for particular | ||
| + | # modules, e.g. | ||
| + | #LogLevel info ssl:warn | ||
| + | |||
| + | ErrorLog ${APACHE_LOG_DIR}/ | ||
| + | CustomLog ${APACHE_LOG_DIR}/ | ||
| + | |||
| + | # For most configuration files from conf-available/, | ||
| + | # enabled or disabled at a global level, it is possible to | ||
| + | # include a line for only one particular virtual host. For example the | ||
| + | # following line enables the CGI configuration for this host only | ||
| + | # after it has been globally disabled with " | ||
| + | #Include conf-available/ | ||
| + | </ | ||
| + | |||
| + | # vim: syntax=apache ts=4 sw=4 sts=4 sr noet | ||
| + | |||
| + | </ | ||
| + | |||
| + | Die Datei berechtigte_User anlegen: | ||
| + | |||
| + | Für die Anlage der Datei einmalig mit der Option -c, weitere User ohne Option -c anlegen: | ||
| + | htpasswd -c / | ||
| + | |||
| + | |||
| + | ===== Apache2: Zugriffsschutz über .htaccess ===== | ||
| + | Datei im DocumnetenRoot: | ||
| + | AuthName " | ||
| + | AuthType Basic | ||
| + | AuthUserFile berechtigte_User.sec | ||
| + | Require valid-user | ||
| + | | ||
| + | | ||
| + | Für die Anlage der Datei einmalig mit der Option -c, weitere User ohne Option -c anlegen: | ||
| + | htpasswd -c / | ||
| + | | ||
| + | ===== Zugriffssteuerung über .htgroup: ===== | ||
| + | |||
| + | .htgroup anlegen im DokumentenRoot anlegen: | ||
| + | |||
| + | cd / | ||
| + | vi .htgroup | ||
| + | |||
| + | Inhalt der Datei / | ||
| + | all: | ||
| + | agents: | ||
| + | |||
| + | Zum aktivieren die / | ||
| + | < | ||
| + | #AuthName " | ||
| + | → AuthName " | ||
| + | AuthType Basic | ||
| + | AuthUserFile password.list | ||
| + | → AuthGroupFile htdocs/ | ||
| + | → Require group agents | ||
| + | #Require valid-user | ||
| + | </ | ||
| + | | ||
| + | ==== Apache2 Zugriff für bestimmte IPs, Netze oder Domain-Mitglieder ===== | ||
| + | |||
| + | Hier zu in der Datei etc/ | ||
| + | < | ||
| + | ... | ||
| + | Allow from beispiel.com | ||
| + | Allow from 192.168 | ||
| + | Allow 192.168.0.0/ | ||
| + | Allow 192.168.0.0/ | ||
| + | Allow from 2001: | ||
| + | ... | ||
| + | </ | ||
authentifizierung_htaccess.1610196688.txt.gz · Zuletzt geändert: 2021/01/09 13:51 von mho