Apache2 Workshop Konfigurationsdateien: Unterschied zwischen den Versionen
(Die Seite wurde neu angelegt: „=Konfigurationsdateibaum= *tree /etc/apache2 <pre> tree /etc/apache2/ /etc/apache2/ ├── apache2.conf ├── conf-available │ ├── charset.c…“) |
|||
| (Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt) | |||
| Zeile 199: | Zeile 199: | ||
</pre> | </pre> | ||
| + | |||
| + | = Apache-Konfigurationsstruktur = | ||
| + | |||
| + | == Hauptkonfigurationsdatei == | ||
| + | Zentrale Konfigurationsdatei, definiert globale Einstellungen. | ||
| + | ; /etc/apache2/apache2.conf | ||
| + | |||
| + | == Ports-Konfiguration == | ||
| + | Legt fest, auf welchen Ports Apache lauscht. | ||
| + | ; /etc/apache2/ports.conf | ||
| + | |||
| + | == Virtuelle Hosts == | ||
| + | Enthält Konfigurationsdateien für einzelne Websites. | ||
| + | ; /etc/apache2/sites-available/ | ||
| + | Enthält aktivierte Sites als Symlinks zu ''sites-available/''. | ||
| + | ; /etc/apache2/sites-enabled/ | ||
| + | |||
| + | == Module == | ||
| + | Liste aller installierten Apache-Module. | ||
| + | ; /etc/apache2/mods-available/ | ||
| + | Enthält aktivierte Module als Symlinks zu ''mods-available/''. | ||
| + | ; /etc/apache2/mods-enabled/ | ||
| + | |||
| + | == Globale Konfigurationen == | ||
| + | Weitere optionale Konfigurationsdateien. | ||
| + | ; /etc/apache2/conf-available/ | ||
| + | Enthält aktivierte Konfigurationen als Symlinks zu ''conf-available/''. | ||
| + | ; /etc/apache2/conf-enabled/ | ||
| + | |||
| + | == Umgebungsvariablen == | ||
| + | Definiert Umgebungsvariablen für Apache, z. B. Benutzer und Gruppen. | ||
| + | ; /etc/apache2/envvars | ||
| + | |||
| + | == Konzept der Symlinks in Apache == | ||
| + | Apache unter Debian nutzt symbolische Links, um Konfigurationen zu aktivieren oder zu deaktivieren. Dabei gibt es drei Hauptmechanismen: | ||
| + | |||
| + | === Virtuelle Hosts === | ||
| + | Eine Datei in ''sites-available/'' ist standardmäßig nicht aktiv. Durch das Erstellen eines Symlinks in ''sites-enabled/'' wird sie aktiviert. | ||
| + | |||
| + | * '''a2ensite meine-seite.conf''' | ||
| + | → Erstellt einen Symlink in ''sites-enabled/'' | ||
| + | * '''a2dissite meine-seite.conf''' | ||
| + | → Entfernt den Symlink aus ''sites-enabled/'' | ||
| + | |||
| + | Apache muss nach Änderungen neu geladen werden: | ||
| + | * '''systemctl reload apache2''' | ||
| + | |||
| + | === Module === | ||
| + | Alle verfügbaren Apache-Module liegen in ''mods-available/''. Aktivierte Module sind als Symlink in ''mods-enabled/'' hinterlegt. | ||
| + | |||
| + | * '''a2enmod rewrite''' | ||
| + | → Erstellt einen Symlink in ''mods-enabled/'' | ||
| + | * '''a2dismod rewrite''' | ||
| + | → Entfernt den Symlink aus ''mods-enabled/'' | ||
| + | |||
| + | Apache muss nach Änderungen neu gestartet werden: | ||
| + | * '''systemctl restart apache2''' | ||
| + | |||
| + | === Globale Konfigurationen === | ||
| + | Allgemeine Einstellungen befinden sich in ''conf-available/''. Aktivierte Konfigurationen sind in ''conf-enabled/'' als Symlink hinterlegt. | ||
| + | |||
| + | * '''a2enconf security''' | ||
| + | → Erstellt einen Symlink in ''conf-enabled/'' | ||
| + | * '''a2disconf security''' | ||
| + | → Entfernt den Symlink aus ''conf-enabled/'' | ||
| + | |||
| + | Apache muss nach Änderungen neu geladen werden: | ||
| + | * '''systemctl reload apache2''' | ||
Aktuelle Version vom 14. März 2025, 14:44 Uhr
Konfigurationsdateibaum
- tree /etc/apache2
tree /etc/apache2/
/etc/apache2/
├── apache2.conf
├── conf-available
│ ├── charset.conf
│ ├── localized-error-pages.conf
│ ├── other-vhosts-access-log.conf
│ ├── security.conf
│ └── serve-cgi-bin.conf
├── conf-enabled
│ ├── charset.conf -> ../conf-available/charset.conf
│ ├── localized-error-pages.conf -> ../conf-available/localized-error-pages.conf
│ ├── other-vhosts-access-log.conf -> ../conf-available/other-vhosts-access-log.conf
│ ├── security.conf -> ../conf-available/security.conf
│ └── serve-cgi-bin.conf -> ../conf-available/serve-cgi-bin.conf
├── envvars
├── magic
├── mods-available
│ ├── access_compat.load
│ ├── actions.conf
│ ├── actions.load
│ ├── alias.conf
│ ├── alias.load
│ ├── allowmethods.load
│ ├── asis.load
│ ├── auth_basic.load
│ ├── auth_digest.load
│ ├── auth_form.load
│ ├── authn_anon.load
│ ├── authn_core.load
│ ├── authn_dbd.load
│ ├── authn_dbm.load
│ ├── authn_file.load
│ ├── authn_socache.load
│ ├── authnz_fcgi.load
│ ├── authnz_ldap.load
│ ├── authz_core.load
│ ├── authz_dbd.load
│ ├── authz_dbm.load
│ ├── authz_groupfile.load
│ ├── authz_host.load
│ ├── authz_owner.load
│ ├── authz_user.load
│ ├── autoindex.conf
│ ├── autoindex.load
│ ├── brotli.load
│ ├── buffer.load
│ ├── cache_disk.conf
│ ├── cache_disk.load
│ ├── cache.load
│ ├── cache_socache.load
│ ├── cern_meta.load
│ ├── cgid.conf
│ ├── cgid.load
│ ├── cgi.load
│ ├── charset_lite.load
│ ├── data.load
│ ├── dav_fs.conf
│ ├── dav_fs.load
│ ├── dav.load
│ ├── dav_lock.load
│ ├── dbd.load
│ ├── deflate.conf
│ ├── deflate.load
│ ├── dialup.load
│ ├── dir.conf
│ ├── dir.load
│ ├── dump_io.load
│ ├── echo.load
│ ├── env.load
│ ├── expires.load
│ ├── ext_filter.load
│ ├── file_cache.load
│ ├── filter.load
│ ├── headers.load
│ ├── heartbeat.load
│ ├── heartmonitor.load
│ ├── http2.conf
│ ├── http2.load
│ ├── ident.load
│ ├── imagemap.load
│ ├── include.load
│ ├── info.conf
│ ├── info.load
│ ├── lbmethod_bybusyness.load
│ ├── lbmethod_byrequests.load
│ ├── lbmethod_bytraffic.load
│ ├── lbmethod_heartbeat.load
│ ├── ldap.conf
│ ├── ldap.load
│ ├── log_debug.load
│ ├── log_forensic.load
│ ├── lua.load
│ ├── macro.load
│ ├── md.load
│ ├── mime.conf
│ ├── mime.load
│ ├── mime_magic.conf
│ ├── mime_magic.load
│ ├── mpm_event.conf
│ ├── mpm_event.load
│ ├── mpm_prefork.conf
│ ├── mpm_prefork.load
│ ├── mpm_worker.conf
│ ├── mpm_worker.load
│ ├── negotiation.conf
│ ├── negotiation.load
│ ├── proxy_ajp.load
│ ├── proxy_balancer.conf
│ ├── proxy_balancer.load
│ ├── proxy.conf
│ ├── proxy_connect.load
│ ├── proxy_express.load
│ ├── proxy_fcgi.load
│ ├── proxy_fdpass.load
│ ├── proxy_ftp.conf
│ ├── proxy_ftp.load
│ ├── proxy_hcheck.load
│ ├── proxy_html.conf
│ ├── proxy_html.load
│ ├── proxy_http2.load
│ ├── proxy_http.load
│ ├── proxy.load
│ ├── proxy_scgi.load
│ ├── proxy_uwsgi.load
│ ├── proxy_wstunnel.load
│ ├── ratelimit.load
│ ├── reflector.load
│ ├── remoteip.load
│ ├── reqtimeout.conf
│ ├── reqtimeout.load
│ ├── request.load
│ ├── rewrite.load
│ ├── sed.load
│ ├── session_cookie.load
│ ├── session_crypto.load
│ ├── session_dbd.load
│ ├── session.load
│ ├── setenvif.conf
│ ├── setenvif.load
│ ├── slotmem_plain.load
│ ├── slotmem_shm.load
│ ├── socache_dbm.load
│ ├── socache_memcache.load
│ ├── socache_redis.load
│ ├── socache_shmcb.load
│ ├── speling.load
│ ├── ssl.conf
│ ├── ssl.load
│ ├── status.conf
│ ├── status.load
│ ├── substitute.load
│ ├── suexec.load
│ ├── unique_id.load
│ ├── userdir.conf
│ ├── userdir.load
│ ├── usertrack.load
│ ├── vhost_alias.load
│ └── xml2enc.load
├── mods-enabled
│ ├── access_compat.load -> ../mods-available/access_compat.load
│ ├── alias.conf -> ../mods-available/alias.conf
│ ├── alias.load -> ../mods-available/alias.load
│ ├── auth_basic.load -> ../mods-available/auth_basic.load
│ ├── authn_core.load -> ../mods-available/authn_core.load
│ ├── authn_file.load -> ../mods-available/authn_file.load
│ ├── authz_core.load -> ../mods-available/authz_core.load
│ ├── authz_host.load -> ../mods-available/authz_host.load
│ ├── authz_user.load -> ../mods-available/authz_user.load
│ ├── autoindex.conf -> ../mods-available/autoindex.conf
│ ├── autoindex.load -> ../mods-available/autoindex.load
│ ├── deflate.conf -> ../mods-available/deflate.conf
│ ├── deflate.load -> ../mods-available/deflate.load
│ ├── dir.conf -> ../mods-available/dir.conf
│ ├── dir.load -> ../mods-available/dir.load
│ ├── env.load -> ../mods-available/env.load
│ ├── filter.load -> ../mods-available/filter.load
│ ├── mime.conf -> ../mods-available/mime.conf
│ ├── mime.load -> ../mods-available/mime.load
│ ├── mpm_event.conf -> ../mods-available/mpm_event.conf
│ ├── mpm_event.load -> ../mods-available/mpm_event.load
│ ├── negotiation.conf -> ../mods-available/negotiation.conf
│ ├── negotiation.load -> ../mods-available/negotiation.load
│ ├── reqtimeout.conf -> ../mods-available/reqtimeout.conf
│ ├── reqtimeout.load -> ../mods-available/reqtimeout.load
│ ├── setenvif.conf -> ../mods-available/setenvif.conf
│ ├── setenvif.load -> ../mods-available/setenvif.load
│ ├── status.conf -> ../mods-available/status.conf
│ └── status.load -> ../mods-available/status.load
├── ports.conf
├── sites-available
│ ├── 000-default.conf
│ └── default-ssl.conf
└── sites-enabled
└── 000-default.conf -> ../sites-available/000-default.conf
Apache-Konfigurationsstruktur
Hauptkonfigurationsdatei
Zentrale Konfigurationsdatei, definiert globale Einstellungen.
- /etc/apache2/apache2.conf
Ports-Konfiguration
Legt fest, auf welchen Ports Apache lauscht.
- /etc/apache2/ports.conf
Virtuelle Hosts
Enthält Konfigurationsdateien für einzelne Websites.
- /etc/apache2/sites-available/
Enthält aktivierte Sites als Symlinks zu sites-available/.
- /etc/apache2/sites-enabled/
Module
Liste aller installierten Apache-Module.
- /etc/apache2/mods-available/
Enthält aktivierte Module als Symlinks zu mods-available/.
- /etc/apache2/mods-enabled/
Globale Konfigurationen
Weitere optionale Konfigurationsdateien.
- /etc/apache2/conf-available/
Enthält aktivierte Konfigurationen als Symlinks zu conf-available/.
- /etc/apache2/conf-enabled/
Umgebungsvariablen
Definiert Umgebungsvariablen für Apache, z. B. Benutzer und Gruppen.
- /etc/apache2/envvars
Konzept der Symlinks in Apache
Apache unter Debian nutzt symbolische Links, um Konfigurationen zu aktivieren oder zu deaktivieren. Dabei gibt es drei Hauptmechanismen:
Virtuelle Hosts
Eine Datei in sites-available/ ist standardmäßig nicht aktiv. Durch das Erstellen eines Symlinks in sites-enabled/ wird sie aktiviert.
- a2ensite meine-seite.conf
→ Erstellt einen Symlink in sites-enabled/
- a2dissite meine-seite.conf
→ Entfernt den Symlink aus sites-enabled/
Apache muss nach Änderungen neu geladen werden:
- systemctl reload apache2
Module
Alle verfügbaren Apache-Module liegen in mods-available/. Aktivierte Module sind als Symlink in mods-enabled/ hinterlegt.
- a2enmod rewrite
→ Erstellt einen Symlink in mods-enabled/
- a2dismod rewrite
→ Entfernt den Symlink aus mods-enabled/
Apache muss nach Änderungen neu gestartet werden:
- systemctl restart apache2
Globale Konfigurationen
Allgemeine Einstellungen befinden sich in conf-available/. Aktivierte Konfigurationen sind in conf-enabled/ als Symlink hinterlegt.
- a2enconf security
→ Erstellt einen Symlink in conf-enabled/
- a2disconf security
→ Entfernt den Symlink aus conf-enabled/
Apache muss nach Änderungen neu geladen werden:
- systemctl reload apache2