Apache HTTP Server ArchLinux
Der Apache HTTP Server ist ein Open Source Webserver und der seit 1996 am meisten im Internet eingesetzte Webserver weltweit. Der freie und quell offenen Webserver wird von der Apache Software Foundation zur Verfügung gestellt und weiterentwickelt.
* Quellen: Buch: Sascha Kersken - Apache 2.4 Das umfassende Handbuch
Ab hier werden zur Ausführung nachfolgender Befehle root
-Rechte benötigt. Um der Benutzer root
zu werden, melden Sie sich bitte als root
-Benutzer am System an, oder wechseln mit nachfolgendem Befehl zum Benutzer root
:
$ su -
Password:
Installation
Zur Installation des Apache HTTP Servers wird nachfolgendes Paket benötigt:
apache
- ist im
extra
-Repository von
ArchLinux enthalten.
Mit nachfolgendem Befehl, wird das Pakete apache
installiert:
# pacman -S --noconfirm apache
Installationsverlauf
# pacman -S --noconfirm apache
resolving dependencies...
looking for conflicting packages...
Package (3) New Version Net Change Download Size
extra/apr 1.7.0-3 1.15 MiB 0.27 MiB
extra/apr-util 1.6.1-9 0.67 MiB 0.16 MiB
extra/apache 2.4.53-1 6.44 MiB 1.68 MiB
Total Download Size: 2.11 MiB
Total Installed Size: 8.26 MiB
:: Proceed with installation? [Y/n]
:: Retrieving packages...
apache-2.4.53-1-... 1715.6 KiB 5.98 MiB/s 00:00 [######################] 100%
apr-1.7.0-3-x86_64 279.5 KiB 2.73 MiB/s 00:00 [######################] 100%
apr-util-1.6.1-9... 168.6 KiB 2.35 MiB/s 00:00 [######################] 100%
Total (3/3) 2.1 MiB 3.52 MiB/s 00:01 [######################] 100%
(3/3) checking keys in keyring [######################] 100%
(3/3) checking package integrity [######################] 100%
(3/3) loading package files [######################] 100%
(3/3) checking for file conflicts [######################] 100%
(3/3) checking available disk space [######################] 100%
:: Running pre-transaction hooks...
(1/1) Performing snapper pre snapshots for the following configurations...
==> root: 12
:: Processing package changes...
(1/3) installing apr [######################] 100%
(2/3) installing apr-util [######################] 100%
Optional dependencies for apr-util
gdbm: enable gdbm support [installed]
libldap: enable ldap support [installed]
unixodbc: enable odbc support [installed]
mariadb-libs: enable mysql/mariadb support
postgresql-libs: enable postgres support
db: enable berkley db support [installed]
sqlite: enable sqlite support [installed]
nss: enable nss crypto support
openssl: enable openssl crypto support [installed]
(3/3) installing apache [######################] 100%
Optional dependencies for apache
lua: for mod_lua module
libxml2: for mod_proxy_html, mod_xml2enc modules [installed]
curl: for mod_md module [installed]
jansson: for mod_md module
brotli: for mod_brotli module [installed]
uwsgi: for mod_proxy_uwsgi module
lynx: apachectl status
perl: for apxs and dbmmanage [installed]
:: Running post-transaction hooks...
(1/4) Reloading system manager configuration...
(2/4) Creating temporary files...
(3/4) Arming ConditionNeedsUpdate...
(4/4) Performing snapper post snapshots for the following configurations...
==> root: 13
Mit nachfolgendem Befehl kann überprüft werden, welche Inhalte mit den Paket apache
installiert wurden:
# pacman -Qil apache
Installierte Dateien
# pacman -Qil apache
Name : apache
Version : 2.4.53-1
Description : A high performance Unix-based HTTP server
Architecture : x86_64
URL : https://www.apache.org/dist/httpd
Licenses : APACHE
Groups : None
Provides : mod_proxy_uwsgi
Depends On : zlib apr-util pcre libnghttp2 openssl libxcrypt
Optional Deps : lua: for mod_lua module
libxml2: for mod_proxy_html, mod_xml2enc modules [installed]
curl: for mod_md module [installed]
jansson: for mod_md module
brotli: for mod_brotli module [installed]
uwsgi: for mod_proxy_uwsgi module
lynx: apachectl status
perl: for apxs and dbmmanage [installed]
Required By : None
Optional For : None
Conflicts With : mod_proxy_uwsgi
Replaces : mod_proxy_uwsgi
Installed Size : 6.44 MiB
Packager : Anatol Pomozov <anatol.pomozov@gmail.com>
Build Date : Tue 15 Mar 2022 02:43:41 AM CET
Install Date : Thu 31 Mar 2022 10:05:10 AM CEST
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
apache /etc/
apache /etc/httpd/
apache /etc/httpd/conf/
apache /etc/httpd/conf/extra/
apache /etc/httpd/conf/extra/httpd-autoindex.conf
apache /etc/httpd/conf/extra/httpd-dav.conf
apache /etc/httpd/conf/extra/httpd-default.conf
apache /etc/httpd/conf/extra/httpd-info.conf
apache /etc/httpd/conf/extra/httpd-languages.conf
apache /etc/httpd/conf/extra/httpd-manual.conf
apache /etc/httpd/conf/extra/httpd-mpm.conf
apache /etc/httpd/conf/extra/httpd-multilang-errordoc.conf
apache /etc/httpd/conf/extra/httpd-ssl.conf
apache /etc/httpd/conf/extra/httpd-userdir.conf
apache /etc/httpd/conf/extra/httpd-vhosts.conf
apache /etc/httpd/conf/extra/proxy-html.conf
apache /etc/httpd/conf/httpd.conf
apache /etc/httpd/conf/magic
apache /etc/httpd/conf/mime.types
apache /etc/httpd/modules
apache /etc/logrotate.d/
apache /etc/logrotate.d/httpd
apache /usr/
apache /usr/bin/
apache /usr/bin/ab
apache /usr/bin/apachectl
apache /usr/bin/apxs
apache /usr/bin/checkgid
apache /usr/bin/dbmmanage
apache /usr/bin/envvars
apache /usr/bin/envvars-std
apache /usr/bin/fcgistarter
apache /usr/bin/htcacheclean
apache /usr/bin/htdbm
apache /usr/bin/htdigest
apache /usr/bin/htpasswd
apache /usr/bin/httpd
apache /usr/bin/httxt2dbm
apache /usr/bin/logresolve
apache /usr/bin/rotatelogs
apache /usr/bin/suexec
apache /usr/include/
apache /usr/include/httpd/
apache /usr/include/httpd/ap_compat.h
apache /usr/include/httpd/ap_config.h
apache /usr/include/httpd/ap_config_auto.h
apache /usr/include/httpd/ap_config_layout.h
apache /usr/include/httpd/ap_expr.h
apache /usr/include/httpd/ap_hooks.h
apache /usr/include/httpd/ap_listen.h
apache /usr/include/httpd/ap_mmn.h
apache /usr/include/httpd/ap_mpm.h
apache /usr/include/httpd/ap_provider.h
apache /usr/include/httpd/ap_regex.h
apache /usr/include/httpd/ap_regkey.h
apache /usr/include/httpd/ap_release.h
apache /usr/include/httpd/ap_slotmem.h
apache /usr/include/httpd/ap_socache.h
apache /usr/include/httpd/apache_noprobes.h
apache /usr/include/httpd/cache_common.h
apache /usr/include/httpd/heartbeat.h
apache /usr/include/httpd/http_config.h
apache /usr/include/httpd/http_connection.h
apache /usr/include/httpd/http_core.h
apache /usr/include/httpd/http_log.h
apache /usr/include/httpd/http_main.h
apache /usr/include/httpd/http_protocol.h
apache /usr/include/httpd/http_request.h
apache /usr/include/httpd/http_ssl.h
apache /usr/include/httpd/http_vhost.h
apache /usr/include/httpd/httpd.h
apache /usr/include/httpd/mod_auth.h
apache /usr/include/httpd/mod_cache.h
apache /usr/include/httpd/mod_cgi.h
apache /usr/include/httpd/mod_core.h
apache /usr/include/httpd/mod_dav.h
apache /usr/include/httpd/mod_dbd.h
apache /usr/include/httpd/mod_include.h
apache /usr/include/httpd/mod_log_config.h
apache /usr/include/httpd/mod_proxy.h
apache /usr/include/httpd/mod_request.h
apache /usr/include/httpd/mod_rewrite.h
apache /usr/include/httpd/mod_session.h
apache /usr/include/httpd/mod_so.h
apache /usr/include/httpd/mod_ssl.h
apache /usr/include/httpd/mod_ssl_openssl.h
apache /usr/include/httpd/mod_status.h
apache /usr/include/httpd/mod_unixd.h
apache /usr/include/httpd/mod_watchdog.h
apache /usr/include/httpd/mod_xml2enc.h
apache /usr/include/httpd/mpm_common.h
apache /usr/include/httpd/os.h
apache /usr/include/httpd/scoreboard.h
apache /usr/include/httpd/unixd.h
apache /usr/include/httpd/util_cfgtree.h
apache /usr/include/httpd/util_charset.h
apache /usr/include/httpd/util_cookies.h
apache /usr/include/httpd/util_ebcdic.h
apache /usr/include/httpd/util_fcgi.h
apache /usr/include/httpd/util_filter.h
apache /usr/include/httpd/util_ldap.h
apache /usr/include/httpd/util_md5.h
apache /usr/include/httpd/util_mutex.h
apache /usr/include/httpd/util_script.h
apache /usr/include/httpd/util_time.h
apache /usr/include/httpd/util_varbuf.h
apache /usr/include/httpd/util_xml.h
apache /usr/lib/
apache /usr/lib/httpd/
apache /usr/lib/httpd/build/
apache /usr/lib/httpd/build/config.nice
apache /usr/lib/httpd/build/config_vars.mk
apache /usr/lib/httpd/build/instdso.sh
apache /usr/lib/httpd/build/library.mk
apache /usr/lib/httpd/build/ltlib.mk
apache /usr/lib/httpd/build/mkdir.sh
apache /usr/lib/httpd/build/program.mk
apache /usr/lib/httpd/build/rules.mk
apache /usr/lib/httpd/build/special.mk
apache /usr/lib/httpd/modules/
apache /usr/lib/httpd/modules/httpd.exp
apache /usr/lib/httpd/modules/mod_access_compat.so
apache /usr/lib/httpd/modules/mod_actions.so
apache /usr/lib/httpd/modules/mod_alias.so
apache /usr/lib/httpd/modules/mod_allowmethods.so
apache /usr/lib/httpd/modules/mod_asis.so
apache /usr/lib/httpd/modules/mod_auth_basic.so
apache /usr/lib/httpd/modules/mod_auth_digest.so
apache /usr/lib/httpd/modules/mod_auth_form.so
apache /usr/lib/httpd/modules/mod_authn_anon.so
apache /usr/lib/httpd/modules/mod_authn_core.so
apache /usr/lib/httpd/modules/mod_authn_dbd.so
apache /usr/lib/httpd/modules/mod_authn_dbm.so
apache /usr/lib/httpd/modules/mod_authn_file.so
apache /usr/lib/httpd/modules/mod_authn_socache.so
apache /usr/lib/httpd/modules/mod_authnz_fcgi.so
apache /usr/lib/httpd/modules/mod_authnz_ldap.so
apache /usr/lib/httpd/modules/mod_authz_core.so
apache /usr/lib/httpd/modules/mod_authz_dbd.so
apache /usr/lib/httpd/modules/mod_authz_dbm.so
apache /usr/lib/httpd/modules/mod_authz_groupfile.so
apache /usr/lib/httpd/modules/mod_authz_host.so
apache /usr/lib/httpd/modules/mod_authz_owner.so
apache /usr/lib/httpd/modules/mod_authz_user.so
apache /usr/lib/httpd/modules/mod_autoindex.so
apache /usr/lib/httpd/modules/mod_brotli.so
apache /usr/lib/httpd/modules/mod_buffer.so
apache /usr/lib/httpd/modules/mod_cache.so
apache /usr/lib/httpd/modules/mod_cache_disk.so
apache /usr/lib/httpd/modules/mod_cache_socache.so
apache /usr/lib/httpd/modules/mod_cern_meta.so
apache /usr/lib/httpd/modules/mod_cgi.so
apache /usr/lib/httpd/modules/mod_cgid.so
apache /usr/lib/httpd/modules/mod_charset_lite.so
apache /usr/lib/httpd/modules/mod_data.so
apache /usr/lib/httpd/modules/mod_dav.so
apache /usr/lib/httpd/modules/mod_dav_fs.so
apache /usr/lib/httpd/modules/mod_dav_lock.so
apache /usr/lib/httpd/modules/mod_dbd.so
apache /usr/lib/httpd/modules/mod_deflate.so
apache /usr/lib/httpd/modules/mod_dialup.so
apache /usr/lib/httpd/modules/mod_dir.so
apache /usr/lib/httpd/modules/mod_dumpio.so
apache /usr/lib/httpd/modules/mod_echo.so
apache /usr/lib/httpd/modules/mod_env.so
apache /usr/lib/httpd/modules/mod_expires.so
apache /usr/lib/httpd/modules/mod_ext_filter.so
apache /usr/lib/httpd/modules/mod_file_cache.so
apache /usr/lib/httpd/modules/mod_filter.so
apache /usr/lib/httpd/modules/mod_headers.so
apache /usr/lib/httpd/modules/mod_heartbeat.so
apache /usr/lib/httpd/modules/mod_heartmonitor.so
apache /usr/lib/httpd/modules/mod_http2.so
apache /usr/lib/httpd/modules/mod_ident.so
apache /usr/lib/httpd/modules/mod_imagemap.so
apache /usr/lib/httpd/modules/mod_include.so
apache /usr/lib/httpd/modules/mod_info.so
apache /usr/lib/httpd/modules/mod_lbmethod_bybusyness.so
apache /usr/lib/httpd/modules/mod_lbmethod_byrequests.so
apache /usr/lib/httpd/modules/mod_lbmethod_bytraffic.so
apache /usr/lib/httpd/modules/mod_lbmethod_heartbeat.so
apache /usr/lib/httpd/modules/mod_ldap.so
apache /usr/lib/httpd/modules/mod_log_config.so
apache /usr/lib/httpd/modules/mod_log_debug.so
apache /usr/lib/httpd/modules/mod_log_forensic.so
apache /usr/lib/httpd/modules/mod_logio.so
apache /usr/lib/httpd/modules/mod_lua.so
apache /usr/lib/httpd/modules/mod_macro.so
apache /usr/lib/httpd/modules/mod_md.so
apache /usr/lib/httpd/modules/mod_mime.so
apache /usr/lib/httpd/modules/mod_mime_magic.so
apache /usr/lib/httpd/modules/mod_mpm_event.so
apache /usr/lib/httpd/modules/mod_mpm_prefork.so
apache /usr/lib/httpd/modules/mod_mpm_worker.so
apache /usr/lib/httpd/modules/mod_negotiation.so
apache /usr/lib/httpd/modules/mod_proxy.so
apache /usr/lib/httpd/modules/mod_proxy_ajp.so
apache /usr/lib/httpd/modules/mod_proxy_balancer.so
apache /usr/lib/httpd/modules/mod_proxy_connect.so
apache /usr/lib/httpd/modules/mod_proxy_express.so
apache /usr/lib/httpd/modules/mod_proxy_fcgi.so
apache /usr/lib/httpd/modules/mod_proxy_fdpass.so
apache /usr/lib/httpd/modules/mod_proxy_ftp.so
apache /usr/lib/httpd/modules/mod_proxy_hcheck.so
apache /usr/lib/httpd/modules/mod_proxy_html.so
apache /usr/lib/httpd/modules/mod_proxy_http.so
apache /usr/lib/httpd/modules/mod_proxy_http2.so
apache /usr/lib/httpd/modules/mod_proxy_scgi.so
apache /usr/lib/httpd/modules/mod_proxy_uwsgi.so
apache /usr/lib/httpd/modules/mod_proxy_wstunnel.so
apache /usr/lib/httpd/modules/mod_ratelimit.so
apache /usr/lib/httpd/modules/mod_reflector.so
apache /usr/lib/httpd/modules/mod_remoteip.so
apache /usr/lib/httpd/modules/mod_reqtimeout.so
apache /usr/lib/httpd/modules/mod_request.so
apache /usr/lib/httpd/modules/mod_rewrite.so
apache /usr/lib/httpd/modules/mod_sed.so
apache /usr/lib/httpd/modules/mod_session.so
apache /usr/lib/httpd/modules/mod_session_cookie.so
apache /usr/lib/httpd/modules/mod_session_crypto.so
apache /usr/lib/httpd/modules/mod_session_dbd.so
apache /usr/lib/httpd/modules/mod_setenvif.so
apache /usr/lib/httpd/modules/mod_slotmem_plain.so
apache /usr/lib/httpd/modules/mod_slotmem_shm.so
apache /usr/lib/httpd/modules/mod_socache_dbm.so
apache /usr/lib/httpd/modules/mod_socache_memcache.so
apache /usr/lib/httpd/modules/mod_socache_redis.so
apache /usr/lib/httpd/modules/mod_socache_shmcb.so
apache /usr/lib/httpd/modules/mod_speling.so
apache /usr/lib/httpd/modules/mod_ssl.so
apache /usr/lib/httpd/modules/mod_status.so
apache /usr/lib/httpd/modules/mod_substitute.so
apache /usr/lib/httpd/modules/mod_suexec.so
apache /usr/lib/httpd/modules/mod_unique_id.so
apache /usr/lib/httpd/modules/mod_unixd.so
apache /usr/lib/httpd/modules/mod_userdir.so
apache /usr/lib/httpd/modules/mod_usertrack.so
apache /usr/lib/httpd/modules/mod_version.so
apache /usr/lib/httpd/modules/mod_vhost_alias.so
apache /usr/lib/httpd/modules/mod_watchdog.so
apache /usr/lib/httpd/modules/mod_xml2enc.so
apache /usr/lib/systemd/
apache /usr/lib/systemd/system/
apache /usr/lib/systemd/system/httpd.service
apache /usr/lib/tmpfiles.d/
apache /usr/lib/tmpfiles.d/apache.conf
apache /usr/share/
apache /usr/share/httpd/
apache /usr/share/httpd/error/
apache /usr/share/httpd/error/HTTP_BAD_GATEWAY.html.var
apache /usr/share/httpd/error/HTTP_BAD_REQUEST.html.var
apache /usr/share/httpd/error/HTTP_FORBIDDEN.html.var
apache /usr/share/httpd/error/HTTP_GONE.html.var
apache /usr/share/httpd/error/HTTP_INTERNAL_SERVER_ERROR.html.var
apache /usr/share/httpd/error/HTTP_LENGTH_REQUIRED.html.var
apache /usr/share/httpd/error/HTTP_METHOD_NOT_ALLOWED.html.var
apache /usr/share/httpd/error/HTTP_NOT_FOUND.html.var
apache /usr/share/httpd/error/HTTP_NOT_IMPLEMENTED.html.var
apache /usr/share/httpd/error/HTTP_PRECONDITION_FAILED.html.var
apache /usr/share/httpd/error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
apache /usr/share/httpd/error/HTTP_REQUEST_TIME_OUT.html.var
apache /usr/share/httpd/error/HTTP_REQUEST_URI_TOO_LARGE.html.var
apache /usr/share/httpd/error/HTTP_SERVICE_UNAVAILABLE.html.var
apache /usr/share/httpd/error/HTTP_UNAUTHORIZED.html.var
apache /usr/share/httpd/error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
apache /usr/share/httpd/error/HTTP_VARIANT_ALSO_VARIES.html.var
apache /usr/share/httpd/error/README
apache /usr/share/httpd/error/contact.html.var
apache /usr/share/httpd/error/include/
apache /usr/share/httpd/error/include/bottom.html
apache /usr/share/httpd/error/include/spacer.html
apache /usr/share/httpd/error/include/top.html
apache /usr/share/httpd/icons/
apache /usr/share/httpd/icons/README
apache /usr/share/httpd/icons/README.html
apache /usr/share/httpd/icons/a.gif
apache /usr/share/httpd/icons/a.png
apache /usr/share/httpd/icons/alert.black.gif
apache /usr/share/httpd/icons/alert.black.png
apache /usr/share/httpd/icons/alert.red.gif
apache /usr/share/httpd/icons/alert.red.png
apache /usr/share/httpd/icons/apache_pb.gif
apache /usr/share/httpd/icons/apache_pb.png
apache /usr/share/httpd/icons/apache_pb.svg
apache /usr/share/httpd/icons/apache_pb2.gif
apache /usr/share/httpd/icons/apache_pb2.png
apache /usr/share/httpd/icons/back.gif
apache /usr/share/httpd/icons/back.png
apache /usr/share/httpd/icons/ball.gray.gif
apache /usr/share/httpd/icons/ball.gray.png
apache /usr/share/httpd/icons/ball.red.gif
apache /usr/share/httpd/icons/ball.red.png
apache /usr/share/httpd/icons/binary.gif
apache /usr/share/httpd/icons/binary.png
apache /usr/share/httpd/icons/binhex.gif
apache /usr/share/httpd/icons/binhex.png
apache /usr/share/httpd/icons/blank.gif
apache /usr/share/httpd/icons/blank.png
apache /usr/share/httpd/icons/bomb.gif
apache /usr/share/httpd/icons/bomb.png
apache /usr/share/httpd/icons/box1.gif
apache /usr/share/httpd/icons/box1.png
apache /usr/share/httpd/icons/box2.gif
apache /usr/share/httpd/icons/box2.png
apache /usr/share/httpd/icons/broken.gif
apache /usr/share/httpd/icons/broken.png
apache /usr/share/httpd/icons/burst.gif
apache /usr/share/httpd/icons/burst.png
apache /usr/share/httpd/icons/c.gif
apache /usr/share/httpd/icons/c.png
apache /usr/share/httpd/icons/comp.blue.gif
apache /usr/share/httpd/icons/comp.blue.png
apache /usr/share/httpd/icons/comp.gray.gif
apache /usr/share/httpd/icons/comp.gray.png
apache /usr/share/httpd/icons/compressed.gif
apache /usr/share/httpd/icons/compressed.png
apache /usr/share/httpd/icons/continued.gif
apache /usr/share/httpd/icons/continued.png
apache /usr/share/httpd/icons/dir.gif
apache /usr/share/httpd/icons/dir.png
apache /usr/share/httpd/icons/diskimg.gif
apache /usr/share/httpd/icons/diskimg.png
apache /usr/share/httpd/icons/down.gif
apache /usr/share/httpd/icons/down.png
apache /usr/share/httpd/icons/dvi.gif
apache /usr/share/httpd/icons/dvi.png
apache /usr/share/httpd/icons/f.gif
apache /usr/share/httpd/icons/f.png
apache /usr/share/httpd/icons/folder.gif
apache /usr/share/httpd/icons/folder.open.gif
apache /usr/share/httpd/icons/folder.open.png
apache /usr/share/httpd/icons/folder.png
apache /usr/share/httpd/icons/folder.sec.gif
apache /usr/share/httpd/icons/folder.sec.png
apache /usr/share/httpd/icons/forward.gif
apache /usr/share/httpd/icons/forward.png
apache /usr/share/httpd/icons/generic.gif
apache /usr/share/httpd/icons/generic.png
apache /usr/share/httpd/icons/generic.red.gif
apache /usr/share/httpd/icons/generic.red.png
apache /usr/share/httpd/icons/generic.sec.gif
apache /usr/share/httpd/icons/generic.sec.png
apache /usr/share/httpd/icons/hand.right.gif
apache /usr/share/httpd/icons/hand.right.png
apache /usr/share/httpd/icons/hand.up.gif
apache /usr/share/httpd/icons/hand.up.png
apache /usr/share/httpd/icons/icon.sheet.gif
apache /usr/share/httpd/icons/icon.sheet.png
apache /usr/share/httpd/icons/image1.gif
apache /usr/share/httpd/icons/image1.png
apache /usr/share/httpd/icons/image2.gif
apache /usr/share/httpd/icons/image2.png
apache /usr/share/httpd/icons/image3.gif
apache /usr/share/httpd/icons/image3.png
apache /usr/share/httpd/icons/index.gif
apache /usr/share/httpd/icons/index.png
apache /usr/share/httpd/icons/layout.gif
apache /usr/share/httpd/icons/layout.png
apache /usr/share/httpd/icons/left.gif
apache /usr/share/httpd/icons/left.png
apache /usr/share/httpd/icons/link.gif
apache /usr/share/httpd/icons/link.png
apache /usr/share/httpd/icons/movie.gif
apache /usr/share/httpd/icons/movie.png
apache /usr/share/httpd/icons/odf6odb.png
apache /usr/share/httpd/icons/odf6odc.png
apache /usr/share/httpd/icons/odf6odf.png
apache /usr/share/httpd/icons/odf6odg.png
apache /usr/share/httpd/icons/odf6odi.png
apache /usr/share/httpd/icons/odf6odm.png
apache /usr/share/httpd/icons/odf6odp.png
apache /usr/share/httpd/icons/odf6ods.png
apache /usr/share/httpd/icons/odf6odt.png
apache /usr/share/httpd/icons/odf6otc.png
apache /usr/share/httpd/icons/odf6otf.png
apache /usr/share/httpd/icons/odf6otg.png
apache /usr/share/httpd/icons/odf6oth.png
apache /usr/share/httpd/icons/odf6oti.png
apache /usr/share/httpd/icons/odf6otp.png
apache /usr/share/httpd/icons/odf6ots.png
apache /usr/share/httpd/icons/odf6ott.png
apache /usr/share/httpd/icons/p.gif
apache /usr/share/httpd/icons/p.png
apache /usr/share/httpd/icons/patch.gif
apache /usr/share/httpd/icons/patch.png
apache /usr/share/httpd/icons/pdf.gif
apache /usr/share/httpd/icons/pdf.png
apache /usr/share/httpd/icons/pie0.gif
apache /usr/share/httpd/icons/pie0.png
apache /usr/share/httpd/icons/pie1.gif
apache /usr/share/httpd/icons/pie1.png
apache /usr/share/httpd/icons/pie2.gif
apache /usr/share/httpd/icons/pie2.png
apache /usr/share/httpd/icons/pie3.gif
apache /usr/share/httpd/icons/pie3.png
apache /usr/share/httpd/icons/pie4.gif
apache /usr/share/httpd/icons/pie4.png
apache /usr/share/httpd/icons/pie5.gif
apache /usr/share/httpd/icons/pie5.png
apache /usr/share/httpd/icons/pie6.gif
apache /usr/share/httpd/icons/pie6.png
apache /usr/share/httpd/icons/pie7.gif
apache /usr/share/httpd/icons/pie7.png
apache /usr/share/httpd/icons/pie8.gif
apache /usr/share/httpd/icons/pie8.png
apache /usr/share/httpd/icons/portal.gif
apache /usr/share/httpd/icons/portal.png
apache /usr/share/httpd/icons/ps.gif
apache /usr/share/httpd/icons/ps.png
apache /usr/share/httpd/icons/quill.gif
apache /usr/share/httpd/icons/quill.png
apache /usr/share/httpd/icons/right.gif
apache /usr/share/httpd/icons/right.png
apache /usr/share/httpd/icons/screw1.gif
apache /usr/share/httpd/icons/screw1.png
apache /usr/share/httpd/icons/screw2.gif
apache /usr/share/httpd/icons/screw2.png
apache /usr/share/httpd/icons/script.gif
apache /usr/share/httpd/icons/script.png
apache /usr/share/httpd/icons/small/
apache /usr/share/httpd/icons/small/back.gif
apache /usr/share/httpd/icons/small/back.png
apache /usr/share/httpd/icons/small/binary.gif
apache /usr/share/httpd/icons/small/binary.png
apache /usr/share/httpd/icons/small/binhex.gif
apache /usr/share/httpd/icons/small/binhex.png
apache /usr/share/httpd/icons/small/blank.gif
apache /usr/share/httpd/icons/small/blank.png
apache /usr/share/httpd/icons/small/broken.gif
apache /usr/share/httpd/icons/small/broken.png
apache /usr/share/httpd/icons/small/burst.gif
apache /usr/share/httpd/icons/small/burst.png
apache /usr/share/httpd/icons/small/comp1.gif
apache /usr/share/httpd/icons/small/comp1.png
apache /usr/share/httpd/icons/small/comp2.gif
apache /usr/share/httpd/icons/small/comp2.png
apache /usr/share/httpd/icons/small/compressed.gif
apache /usr/share/httpd/icons/small/compressed.png
apache /usr/share/httpd/icons/small/continued.gif
apache /usr/share/httpd/icons/small/continued.png
apache /usr/share/httpd/icons/small/doc.gif
apache /usr/share/httpd/icons/small/doc.png
apache /usr/share/httpd/icons/small/folder.gif
apache /usr/share/httpd/icons/small/folder.png
apache /usr/share/httpd/icons/small/folder2.gif
apache /usr/share/httpd/icons/small/folder2.png
apache /usr/share/httpd/icons/small/forward.gif
apache /usr/share/httpd/icons/small/forward.png
apache /usr/share/httpd/icons/small/generic.gif
apache /usr/share/httpd/icons/small/generic.png
apache /usr/share/httpd/icons/small/generic2.gif
apache /usr/share/httpd/icons/small/generic2.png
apache /usr/share/httpd/icons/small/generic3.gif
apache /usr/share/httpd/icons/small/generic3.png
apache /usr/share/httpd/icons/small/image.gif
apache /usr/share/httpd/icons/small/image.png
apache /usr/share/httpd/icons/small/image2.gif
apache /usr/share/httpd/icons/small/image2.png
apache /usr/share/httpd/icons/small/index.gif
apache /usr/share/httpd/icons/small/index.png
apache /usr/share/httpd/icons/small/key.gif
apache /usr/share/httpd/icons/small/key.png
apache /usr/share/httpd/icons/small/movie.gif
apache /usr/share/httpd/icons/small/movie.png
apache /usr/share/httpd/icons/small/patch.gif
apache /usr/share/httpd/icons/small/patch.png
apache /usr/share/httpd/icons/small/ps.gif
apache /usr/share/httpd/icons/small/ps.png
apache /usr/share/httpd/icons/small/rainbow.gif
apache /usr/share/httpd/icons/small/rainbow.png
apache /usr/share/httpd/icons/small/sound.gif
apache /usr/share/httpd/icons/small/sound.png
apache /usr/share/httpd/icons/small/sound2.gif
apache /usr/share/httpd/icons/small/sound2.png
apache /usr/share/httpd/icons/small/tar.gif
apache /usr/share/httpd/icons/small/tar.png
apache /usr/share/httpd/icons/small/text.gif
apache /usr/share/httpd/icons/small/text.png
apache /usr/share/httpd/icons/small/transfer.gif
apache /usr/share/httpd/icons/small/transfer.png
apache /usr/share/httpd/icons/small/unknown.gif
apache /usr/share/httpd/icons/small/unknown.png
apache /usr/share/httpd/icons/small/uu.gif
apache /usr/share/httpd/icons/small/uu.png
apache /usr/share/httpd/icons/sound1.gif
apache /usr/share/httpd/icons/sound1.png
apache /usr/share/httpd/icons/sound2.gif
apache /usr/share/httpd/icons/sound2.png
apache /usr/share/httpd/icons/sphere1.gif
apache /usr/share/httpd/icons/sphere1.png
apache /usr/share/httpd/icons/sphere2.gif
apache /usr/share/httpd/icons/sphere2.png
apache /usr/share/httpd/icons/svg.png
apache /usr/share/httpd/icons/tar.gif
apache /usr/share/httpd/icons/tar.png
apache /usr/share/httpd/icons/tex.gif
apache /usr/share/httpd/icons/tex.png
apache /usr/share/httpd/icons/text.gif
apache /usr/share/httpd/icons/text.png
apache /usr/share/httpd/icons/transfer.gif
apache /usr/share/httpd/icons/transfer.png
apache /usr/share/httpd/icons/unknown.gif
apache /usr/share/httpd/icons/unknown.png
apache /usr/share/httpd/icons/up.gif
apache /usr/share/httpd/icons/up.png
apache /usr/share/httpd/icons/uu.gif
apache /usr/share/httpd/icons/uu.png
apache /usr/share/httpd/icons/uuencoded.gif
apache /usr/share/httpd/icons/uuencoded.png
apache /usr/share/httpd/icons/world1.gif
apache /usr/share/httpd/icons/world1.png
apache /usr/share/httpd/icons/world2.gif
apache /usr/share/httpd/icons/world2.png
apache /usr/share/httpd/icons/xml.png
apache /usr/share/licenses/
apache /usr/share/licenses/apache/
apache /usr/share/licenses/apache/LICENSE
apache /usr/share/man/
apache /usr/share/man/man1/
apache /usr/share/man/man1/ab.1.gz
apache /usr/share/man/man1/apxs.1.gz
apache /usr/share/man/man1/dbmmanage.1.gz
apache /usr/share/man/man1/htdbm.1.gz
apache /usr/share/man/man1/htdigest.1.gz
apache /usr/share/man/man1/htpasswd.1.gz
apache /usr/share/man/man1/httxt2dbm.1.gz
apache /usr/share/man/man1/logresolve.1.gz
apache /usr/share/man/man8/
apache /usr/share/man/man8/apachectl.8.gz
apache /usr/share/man/man8/fcgistarter.8.gz
apache /usr/share/man/man8/htcacheclean.8.gz
apache /usr/share/man/man8/httpd.8.gz
apache /usr/share/man/man8/rotatelogs.8.gz
apache /usr/share/man/man8/suexec.8.gz
apache /var/
apache /var/log/
apache /var/log/httpd/
Dienst/Daemon-Start einrichten
Um einen Apache HTTP Server, welcher als Dienst/Daemon als Hintergrundprozess läuft, auch nach einem Neustart des Servers zur Verfügung zu haben, soll der Dienst/Daemon mit dem Server mit gestartet werden, was mit nachfolgendem Befehl realisiert werden kann:
systemctl enable httpd.service
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Eine Überprüfung, ob beim Neustart des Server der httpd
-Dienst/Daemon wirklich mit gestartet wird, kann mit nachfolgendem Befehl erfolgen und sollte eine Anzeige, wie ebenfalls nachfolgend dargestellt ausgeben:
# systemctl list-unit-files --type=service | grep -e httpd.service
httpd.service enabled disabled
bzw.
# systemctl is-enabled httpd.service
enabled
iptables/ip6tables Regeln
Damit der Apache HTTP Server auch erreichbar ist und nicht die Webseiten-Anfragen vom Paketfilter iptables
blockiert werden, müssen nachfolgende Regeln zum iptables
-Regelwerk hinzugefügt werden.
Um die aktuellen iptables
-Regeln erweitern zu können, sollten diese erst einmal aufgelistet werden, was mit nachfolgendem Befehl durchgeführt werden kann:
# iptables -L -nv --line-numbers
Chain INPUT (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 1169 2101K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
2 0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
3 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
4 1 60 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
5 0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 5 prefix "REC-INP Defend "
6 0 0 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with tcp-reset
7 0 0 REJECT udp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
8 0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-proto-unreachable
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 917 packets, 84944 bytes)
num pkts bytes target prot opt in out source destination
Nachfolgende Befehle, fügen folgende iptables
-Regeln dem iptables
-Regelwerk nach der Position 4 hinzu, ohne das der Paketfilter angehalten werden muss:
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
und hier die Befehle:
# iptables -I INPUT 5 -p tcp --dport 80 -j ACCEPT
# iptables -I INPUT 5 -p tcp --dport 443 -j ACCEPT
Ein erneute Abfrage des iptables
-Regelwerts, sollte dann nachfolgend dargestellte Ausgabe ergeben, was mit folgendem Befehl durchgeführt werden kann:
# iptables -L -nv --line-numbers
Chain INPUT (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 1202 2103K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
2 0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0
3 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
4 1 60 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
5 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
6 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
7 0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 LOG flags 0 level 5 prefix "REC-INP Defend "
8 0 0 REJECT tcp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with tcp-reset
9 0 0 REJECT udp -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable
10 0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-proto-unreachable
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 7 packets, 936 bytes)
num pkts bytes target prot opt in out source destination
Die neuen Zeilen sind an Position 5 (INPUT) und Position 6 (INPUT) zu sehen, hier nachfolgend zur Verdeutlichung noch einmal dargestellt (nur relevanter Ausschnitt):
...
5 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
6 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
...
Um diese iptables
-Regel dauerhaft, auch nach einem Neustart des Server, weiterhin im iptables
-Regelwerk zu speichern, muss nachfolgend dargestellter Befehl abschließend noch ausgeführt werden:
# /usr/sbin/iptables-save > /etc/iptables/iptables.rules
Nachfolgender Befehl kann dazu verwendet werden, um zu überprüfen, ob das iptables-Regelwerk auch korrekt gespeichert wurde:
# cat /etc/iptables/iptables.rules
# Generated by iptables-save v1.8.7 on Wed Mar 31 10:13:23 2022
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [13:3332]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -j LOG --log-prefix "REC-INP Defend " --log-level 5
-A INPUT -p tcp -j REJECT --reject-with tcp-reset
-A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable
-A INPUT -j REJECT --reject-with icmp-proto-unreachable
COMMIT
# Completed on Wed Mar 31 10:13:23 2022
# Generated by iptables-save v1.8.7 on Wed Mar 31 10:13:23 2022
*nat
:PREROUTING ACCEPT [5:352]
:INPUT ACCEPT [1:60]
:OUTPUT ACCEPT [8:577]
:POSTROUTING ACCEPT [8:577]
COMMIT
# Completed on Wed Mar 31 10:13:23 2022
# Generated by iptables-save v1.8.7 on Wed Mar 31 10:13:23 2022
*mangle
:PREROUTING ACCEPT [1216:2104461]
:INPUT ACCEPT [1212:2104169]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [944:91396]
:POSTROUTING ACCEPT [944:91396]
COMMIT
# Completed on Wed Mar 31 10:13:23 2022
Um die aktuellen ip6tables
-Regeln erweitern zu können, sollten diese erst einmal aufgelistet werden, was mit nachfolgendem Befehl durchgeführt werden kann:
# ip6tables -nvL --line-numbers
Chain INPUT (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT all * * ::/0 ::/0 ctstate RELATED,ESTABLISHED
2 0 0 ACCEPT icmp * * ::/0 ::/0
3 0 0 ACCEPT all lo * ::/0 ::/0
4 0 0 ACCEPT tcp * * ::/0 ::/0 tcp dpt:22
5 0 0 LOG all * * ::/0 ::/0 LOG flags 0 level 5 prefix "REC-INP Defend "
6 0 0 REJECT tcp * * ::/0 ::/0 reject-with tcp-reset
7 0 0 REJECT udp * * ::/0 ::/0 reject-with icmp6-port-unreachable
8 0 0 REJECT all * * ::/0 ::/0 reject-with icmp6-addr-unreachable
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 LOG all * * ::/0 ::/0 LOG flags 0 level 5 prefix "REC-FWD Defend "
2 0 0 REJECT tcp * * ::/0 ::/0 reject-with tcp-reset
3 0 0 REJECT udp * * ::/0 ::/0 reject-with icmp6-port-unreachable
4 0 0 REJECT all * * ::/0 ::/0 reject-with icmp6-addr-unreachable
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
Nachfolgende Befehle, fügen folgende ip6tables
-Regeln dem ip6tables
-Regelwerk nach der Position 4 hinzu, ohne das der Paketfilter angehalten werden muss:
-A INPUT -p tcp --dport 80 -j ACCEPT
-A INPUT -p tcp --dport 443 -j ACCEPT
und hier die Befehle:
# ip6tables -I INPUT 5 -p tcp --dport 80 -j ACCEPT
# ip6tables -I INPUT 6 -p tcp --dport 443 -j ACCEPT
Ein erneute Abfrage des ip6tables
-Regelwerts, sollte dann nachfolgend dargestellte Ausgabe ergeben, was mit folgendem Befehl durchgeführt werden kann:
# ip6tables -nvL --line-numbers
Chain INPUT (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 ACCEPT all * * ::/0 ::/0 ctstate RELATED,ESTABLISHED
2 0 0 ACCEPT icmp * * ::/0 ::/0
3 0 0 ACCEPT all lo * ::/0 ::/0
4 0 0 ACCEPT tcp * * ::/0 ::/0 tcp dpt:22
5 0 0 ACCEPT tcp * * ::/0 ::/0 tcp dpt:80
6 0 0 ACCEPT tcp * * ::/0 ::/0 tcp dpt:443
7 0 0 LOG all * * ::/0 ::/0 LOG flags 0 level 5 prefix "REC-INP Defend "
8 0 0 REJECT tcp * * ::/0 ::/0 reject-with tcp-reset
9 0 0 REJECT udp * * ::/0 ::/0 reject-with icmp6-port-unreachable
10 0 0 REJECT all * * ::/0 ::/0 reject-with icmp6-addr-unreachable
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 LOG all * * ::/0 ::/0 LOG flags 0 level 5 prefix "REC-FWD Defend "
2 0 0 REJECT tcp * * ::/0 ::/0 reject-with tcp-reset
3 0 0 REJECT udp * * ::/0 ::/0 reject-with icmp6-port-unreachable
4 0 0 REJECT all * * ::/0 ::/0 reject-with icmp6-addr-unreachable
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
Die neuen Zeilen sind an Position 5 (INPUT) und Postition 6 (INTPUT) zu sehen, hier nachfolgend zur Verdeutlichung noch einmal dargestellt (nur relevanter Ausschnitt):
...
5 0 0 ACCEPT tcp * * ::/0 ::/0 tcp dpt:80
6 0 0 ACCEPT tcp * * ::/0 ::/0 tcp dpt:443
...
Um diese ip6tables
-Regel dauerhaft, auch nach einem Neustart des Server, weiterhin im ip6tables
-Regelwerk zu speichern, muss nachfolgend dargestellter Befehl abschließend noch ausgeführt werden:
# /usr/sbin/ip6tables-save > /etc/iptables/ip6tables.rules
Nachfolgender Befehl kann dazu verwendet werden, um zu überprüfen, ob das ip6tables
-Regelwerk auch korrekt gespeichert wurde:
# cat /etc/iptables/ip6tables.rules
# Generated by ip6tables-save v1.8.7 on Wed Mar 31 10:15:10 2022
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Wed Mar 31 10:15:10 2022
# Generated by ip6tables-save v1.8.7 on Wed Mar 31 10:15:10 2022
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -j LOG --log-prefix "REC-INP Defend " --log-level 5
-A INPUT -p tcp -j REJECT --reject-with tcp-reset
-A INPUT -p udp -j REJECT --reject-with icmp6-port-unreachable
-A INPUT -j REJECT --reject-with icmp6-addr-unreachable
-A FORWARD -j LOG --log-prefix "REC-FWD Defend " --log-level 5
-A FORWARD -p tcp -j REJECT --reject-with tcp-reset
-A FORWARD -p udp -j REJECT --reject-with icmp6-port-unreachable
-A FORWARD -j REJECT --reject-with icmp6-addr-unreachable
COMMIT
# Completed on Wed Mar 31 10:15:10 2022
# Generated by ip6tables-save v1.8.7 on Wed Mar 31 10:15:10 2022
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
COMMIT
# Completed on Wed Mar 31 10:15:10 2022
IPv4: Port Forwarding
Falls sich der Apache HTTP Server NICHT auf dem Server befinden sollte, welcher z.B. die offizielle IP-Adresse verwaltet und auf diesem Server, welche die offizielle IP-Adresse inne hat, kein Apache HTTP Server läuft, können auf z.B. Port 80 ankommende TCP/IP-Pakete mit Hilfe von iptables
-Regeln auf einen anderen Server umgeleitet werden.
Beispiel:
Nachfolgende Regel muss dazu auf dem Server, welche die IP-Adresse 192.168.0.1 inne hat, zum iptables
-Regelwerk hinzugefügt werden. Das Ergänzen erfolgt in der iptables
-Kette:
Um die aktuellen iptables
-Regeln erweitern zu können, sollten diese erst einmal aufgelistet werden, was mit nachfolgendem Befehl durchgeführt werden kann:
# iptables -t nat -nvL --line-numbers
Chain PREROUTING (policy ACCEPT 4 packets, 339 bytes)
num pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 1 packets, 60 bytes)
num pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 8 packets, 573 bytes)
num pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 8 packets, 573 bytes)
num pkts bytes target prot opt in out source destination
WICHTIG - Bei der MASQUERADE-Regel darf NICHT das Interface enthalten sein, an dessen geFORWARDED wird !!!
Nachfolgender Befehl, fügen folgende iptables
-Regel dem iptables
-Regelwerk hinzu, ohne das der Paketfilter angehalten werden muss:
-A PREROUTING -t nat -d 192.168.0.1 -p tcp --dport 80 -j DNAT --to-dest 192.168.0.90:80
und hier der Befehl:
# iptables -A PREROUTING -t nat -d 192.168.0.1 -p tcp --dport 80 -j DNAT --to-dest 192.168.0.90:80
Ein erneute Abfrage des iptables
-Regelwerts, sollte dann nachfolgend dargestellte Ausgabe ergeben, was mit folgendem Befehl durchgeführt werden kann:
# iptables -t nat -nvL --line-numbers
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
1 0 0 DNAT tcp -- * * 0.0.0.0/0 192.168.0.1 tcp dpt:80 to:192.168.0.90:80
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
WICHTIG - Bei der MASQUERADE-Regel darf NICHT das Interface enthalten sein, an dessen geFORWARDED wird !!!
Die neue Zeile ist an Position 1 (PREROUTING) zu sehen, hier nachfolgend zur Verdeutlichung noch einmal dargestellt (nur relevanter Ausschnitt):
...
1 0 0 DNAT tcp -- * * 0.0.0.0/0 192.168.0.1 tcp dpt:80 to:192.168.0.90:80
...
Um diese iptables
-Regel dauerhaft, auch nach einem Neustart des Server, weiterhin im iptables
-Regelwerk zu speichern, muss nachfolgend dargestellter Befehl abschließend noch ausgeführt werden:
# /usr/sbin/iptables-save > /etc/sysconfig/iptables
/etc/hosts
Falls keine DNS-Auflösung des Namens möglich ist, muss in der Konfigurationsdatei
nachfolgende Ergänzung hinzugefügt werden:
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost
192.168.0.30 apache.tachtler.net apache
fe80::192.168:0:30 apache.tachtler.net apache
HINWEIS - Die Ergänzungen sind in der 3 Zeile und 4 Zeile in oben gezeigter Konfigurationsdatei!
Somit kann gewährleistet werden, dass die Verwendung des DNS-Namens möglich ist.
Erster Start
Bevor weitere Konfigurationsschritte erfolgen, sollte dem ersten Start nichts im Wege stehen, da bereits hier Konfigurationseinstellungen durchgeführt werden, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl start httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
Webserver Überprüfung
Ob der Apache HTTP Server, sprich der httpd
-Dienst/Deamon auch tatsächlich als Hintergrundprozess läuft, kann mit nachfolgendem Befehl überprüft werden:
# systemctl status httpd.service
● httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor pre>
Active: active (running) since Thu 2022-03-31 10:31:49 CEST; 5s ago
Main PID: 1240 (httpd)
Tasks: 82 (limit: 2340)
Memory: 6.2M
CPU: 15ms
CGroup: /system.slice/httpd.service
├─1240 /usr/bin/httpd -k start -DFOREGROUND
├─1241 /usr/bin/httpd -k start -DFOREGROUND
├─1242 /usr/bin/httpd -k start -DFOREGROUND
└─1243 /usr/bin/httpd -k start -DFOREGROUND
Mar 31 10:31:49 vml030 systemd[1]: Started Apache Web Server.
bzw.
# ps auxwf | grep httpd
root 1328 0.0 0.1 6992 2584 pts/0 S+ 10:32 0:00 \_ grep httpd
root 1240 0.0 0.3 8596 6232 ? Ss 10:31 0:00 /usr/bin/httpd -k start -DFOREGROUND
http 1241 0.0 0.2 1212928 4132 ? Sl 10:31 0:00 \_ /usr/bin/httpd -k start -DFOREGROUND
http 1242 0.0 0.2 1212928 4132 ? Sl 10:31 0:00 \_ /usr/bin/httpd -k start -DFOREGROUND
http 1243 0.0 0.2 1212928 4132 ? Sl 10:31 0:00 \_ /usr/bin/httpd -k start -DFOREGROUND
Eine weitere Überprüfung, ob der erste Start erfolgreich war, kann durch Einsicht der LOG-Dateien
durchgeführt werden.
Ausgabe der LOG-Datei /var/log/httpd/error
mit nachfolgendem Befehl, die Ausgabe sollte wie nachfolgend dargestellt aussehen:
[Thu Mar 31 10:31:49.143831 2022] [mpm_event:notice] [pid 1240:tid 139832443657152] AH00489: Apache/2.4.53 (Unix) configured -- resuming normal operations
[Thu Mar 31 10:31:49.143895 2022] [core:notice] [pid 1240:tid 139832443657152] AH00094: Command line: '/usr/bin/httpd -D FOREGROUND'
Interface Überprüfung
Ob und an welchen Interface der Apache HTTP Server „lauscht“, bzw. Web-Anfragen beantwortet, kann mit nachfolgendem Befehl überprüft werden:
# ss -tulpen | grep httpd
tcp LISTEN 0 511 *:80 *:* users:(("httpd",pid=1243,fd=4),("httpd",pid=1242,fd=4),("httpd",pid=1241,fd=4),("httpd",pid=1240,fd=4)) ino:22350 sk:7 cgroup:/system.slice/httpd.service v6only:0 <->
Erster Browser-Test
Wenn der Start des Apache HTTP Server erfolgreich durchgeführt wurde, kann die Abfrage mittels eines Browsers erfolgen, wie im nachfolgenden Bild dargestellt:
Konfigurationsdateien
Nachfolgende Aufstellung stellt die Konfigurationsdateien des Apache HTTP Server vor.
Verzeichnis |
Name | Beschreibung |
/etc/httpd/conf/ |
httpd.conf | Haupt- und Standardkonfigurationsdatei des Apache HTTP Server |
magic | Das Apache HTTP Server-Modul mod_mime_magic bestimmt den MIME-Typ von Dateien auf dieselbe Weise wie der Unix-Befehl file : Es werden dabei die ersten paar Bytes der Datei betrachtet. Es ist als „zweite Verteidigungslinie“ für Fälle gedacht, die mod_mime nicht auflösen kann ACHTUNG - Die Datei magic sollte nicht bearbeitet werden, da diese bei einem Upgrade des Apache HTTP Server überschrieben werden könnte bzw. würde |
mime.types | Medientypen-Konfigurationsdatei mit MIME-Dokumenttypen ACHTUNG - Die Datei mime.types sollte nicht bearbeitet werden, da diese bei einem Upgrade des Apache HTTP Server überschrieben werden könnte bzw. würde |
/etc/httpd/conf/extra/ |
httpd-autoindex.conf | Beinhaltet Optionen für automatisch generierte Verzeichnis-Indizes |
httpd-dav.conf | WebDAV-Einstellungen |
httpd-default.conf | Beinhaltet zusätzliche Einstellungen für den Hauptserver |
httpd-info.conf | Beinhaltet Einstellungen zu Statusmeldungen und Informationen des Servers, abrufbar unter speziellen URL-Ergänzungen /server-status und /server-info |
httpd-languages.conf | Einstellungen für die Zuordnung zwischen zusätzlichen Dateiendungen und Dokumentsprachen |
httpd-manual.conf | Einbindung der Apache HTTP Server-Dokumentation, abrufbar unter der URL-Ergänzung /manual |
httpd-mpm.conf | MPM-spezifische Einstellungen, die vor allem die Performance betreffen |
httpd-multilang-errordoc.conf | Beinhaltet Einstellungen für Mehrsprachige Fehlermeldungsseiten |
httpd-ssl.conf | Beinhaltet die Einstellungen zur SSL-Konfiguration |
httpd-userdir.conf | Beinhaltet die Einstellungen zur Veröffentlichung von benutzerdefinierter Web-Seiten unter dem z.B. HOME-Verzeichnis eines UNIX-Benutzers (~/user-URL-Pfade) |
httpd-vhosts.conf | Beinhaltet die Einstellungen für virtuelle Hosts |
proxy-html.conf | Beinhaltet Einstellungen für das Apache HTTP Server-Modul mod_proxy_html |
WICHTIG - Fett gedruckte Konfigurationsdateien sind standardmässig aktiv bzw. inkludiert!
HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!
Die nachfolgenden Anpassungen werden mit einem vorangestellten Kommentar in der Form
# Tachtler
gekennzeichnet.
Basis-Konfiguration
Nachfolgend sollen zuerst die Direktiven behandelt werden, welche für einen grundlegenden Betrieb eines Apache HTTP Server mit z.B. einer einfachen statischen Web-Seite wichtig sind. Es werden vorerst nur Konfigurationsanweisungen, welche mit dem Kern (core
) des Apache HTTP Server behandelt werden können, bzw. in MPM-Modulen oder solchen Apache HTTP Server-Modulen verankert sind, welche standardmässig mit dem Apache HTTP Server ausgeliefert und aktiviert sind.
Basis-Konfiguration: /etc/httpd/conf/httpd.conf
Verzeichnis/Name | Beschreibung |
/etc/httpd/conf/httpd.conf | Haupt- und Standardkonfigurationsdatei des Apache HTTP Server |
/etc/httpd/conf/httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
# will be interpreted as '/logs/access_log'.
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# Do not add a slash at the end of the directory path. If you point
# ServerRoot at a non-local disk, be sure to specify a local disk on the
# Mutex directive, if file-based mutexes are used. If you wish to share the
# same ServerRoot for multiple httpd daemons, you will need to change at
# least PidFile.
#
ServerRoot "/etc/httpd"
#
# Mutex: Allows you to set the mutex mechanism and mutex file directory
# for individual mutexes, or change the global defaults
#
# Uncomment and change the directory if mutexes are file-based and the default
# mutex file directory is not on a local disk or is not appropriate for some
# other reason.
#
# Mutex default:/run/httpd
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Statically compiled modules (those listed by `httpd -l') do not need
# to be loaded here.
#
# Example:
# LoadModule foo_module modules/mod_foo.so
#
LoadModule mpm_event_module modules/mod_mpm_event.so
#LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
LoadModule authn_file_module modules/mod_authn_file.so
#LoadModule authn_dbm_module modules/mod_authn_dbm.so
#LoadModule authn_anon_module modules/mod_authn_anon.so
#LoadModule authn_dbd_module modules/mod_authn_dbd.so
#LoadModule authn_socache_module modules/mod_authn_socache.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_user_module modules/mod_authz_user.so
#LoadModule authz_dbm_module modules/mod_authz_dbm.so
#LoadModule authz_owner_module modules/mod_authz_owner.so
#LoadModule authz_dbd_module modules/mod_authz_dbd.so
LoadModule authz_core_module modules/mod_authz_core.so
#LoadModule authnz_ldap_module modules/mod_authnz_ldap.so
#LoadModule authnz_fcgi_module modules/mod_authnz_fcgi.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule auth_basic_module modules/mod_auth_basic.so
#LoadModule auth_form_module modules/mod_auth_form.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
#LoadModule allowmethods_module modules/mod_allowmethods.so
#LoadModule file_cache_module modules/mod_file_cache.so
#LoadModule cache_module modules/mod_cache.so
#LoadModule cache_disk_module modules/mod_cache_disk.so
#LoadModule cache_socache_module modules/mod_cache_socache.so
#LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
#LoadModule socache_dbm_module modules/mod_socache_dbm.so
#LoadModule socache_memcache_module modules/mod_socache_memcache.so
#LoadModule socache_redis_module modules/mod_socache_redis.so
#LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule macro_module modules/mod_macro.so
#LoadModule dbd_module modules/mod_dbd.so
#LoadModule dumpio_module modules/mod_dumpio.so
#LoadModule echo_module modules/mod_echo.so
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule data_module modules/mod_data.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
#LoadModule ext_filter_module modules/mod_ext_filter.so
#LoadModule request_module modules/mod_request.so
LoadModule include_module modules/mod_include.so
LoadModule filter_module modules/mod_filter.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule substitute_module modules/mod_substitute.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule deflate_module modules/mod_deflate.so
#LoadModule xml2enc_module modules/mod_xml2enc.so
#LoadModule proxy_html_module modules/mod_proxy_html.so
#LoadModule brotli_module modules/mod_brotli.so
LoadModule mime_module modules/mod_mime.so
#LoadModule ldap_module modules/mod_ldap.so
LoadModule log_config_module modules/mod_log_config.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule log_forensic_module modules/mod_log_forensic.so
#LoadModule logio_module modules/mod_logio.so
#LoadModule lua_module modules/mod_lua.so
LoadModule env_module modules/mod_env.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
#LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule unique_id_module modules/mod_unique_id.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule version_module modules/mod_version.so
#LoadModule remoteip_module modules/mod_remoteip.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
#LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
#LoadModule proxy_uwsgi_module modules/mod_proxy_uwsgi.so
#LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
#LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
#LoadModule proxy_express_module modules/mod_proxy_express.so
#LoadModule proxy_hcheck_module modules/mod_proxy_hcheck.so
#LoadModule session_module modules/mod_session.so
#LoadModule session_cookie_module modules/mod_session_cookie.so
#LoadModule session_crypto_module modules/mod_session_crypto.so
#LoadModule session_dbd_module modules/mod_session_dbd.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
#LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
#LoadModule ssl_module modules/mod_ssl.so
#LoadModule dialup_module modules/mod_dialup.so
#LoadModule http2_module modules/mod_http2.so
#LoadModule proxy_http2_module modules/mod_proxy_http2.so
#LoadModule md_module modules/mod_md.so
#LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
#LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
#LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
#LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
LoadModule unixd_module modules/mod_unixd.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
#LoadModule dav_module modules/mod_dav.so
LoadModule status_module modules/mod_status.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule asis_module modules/mod_asis.so
# Tachtler
# default: #LoadModule info_module modules/mod_info.so
LoadModule info_module modules/mod_info.so
#LoadModule suexec_module modules/mod_suexec.so
<IfModule !mpm_prefork_module>
#LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
#LoadModule cgi_module modules/mod_cgi.so
</IfModule>
#LoadModule dav_fs_module modules/mod_dav_fs.so
#LoadModule dav_lock_module modules/mod_dav_lock.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule dir_module modules/mod_dir.so
#LoadModule imagemap_module modules/mod_imagemap.so
#LoadModule actions_module modules/mod_actions.so
#LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
#LoadModule rewrite_module modules/mod_rewrite.so
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User http
Group http
</IfModule>
# 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition. These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed. This address appears on some server-generated pages, such
# as error documents. e.g. admin@your-domain.com
#
# Tachtler
# default: ServerAdmin you@example.com
ServerAdmin webmaster@tachtler.net
#
# ServerName gives the name and port that the server uses to identify itself.
# This can often be determined automatically, but we recommend you specify
# it explicitly to prevent problems during startup.
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
# Tachtler
# default: #ServerName www.example.com:80
ServerName apache.tachtler.net:80
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride none
Require all denied
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/srv/http"
<Directory "/srv/http">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
# Tachtler
# default: Options Indexes FollowSymLinks
Options -Indexes +FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
# Tachtler
# default: DirectoryIndex index.html
DirectoryIndex index.html index.htm
</IfModule>
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ".ht*">
Require all denied
</Files>
#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog "/var/log/httpd/error_log"
#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn
<IfModule log_config_module>
#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
#
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
#
# The location and format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#
CustomLog "/var/log/httpd/access_log" common
#
# If you prefer a logfile with access, agent, and referer information
# (Combined Logfile Format) you can use the following directive.
#
#CustomLog "/var/log/httpd/access_log" combined
</IfModule>
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "/srv/http/cgi-bin/"
</IfModule>
<IfModule cgid_module>
#
# ScriptSock: On threaded servers, designate the path to the UNIX
# socket used to communicate with the CGI daemon of mod_cgid.
#
#Scriptsock cgisock
</IfModule>
#
# "/srv/http/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/srv/http/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule headers_module>
#
# Avoid passing HTTP_PROXY environment to CGI's on this or any proxied
# backend servers which have lingering "httpoxy" defects.
# 'Proxy' request header is undefined by the IETF, not listed by IANA
#
RequestHeader unset Proxy early
</IfModule>
<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types
#
# AddType allows you to add to or override the MIME configuration
# file specified in TypesConfig for specific file types.
#
#AddType application/x-gzip .tgz
#
# AddEncoding allows you to have certain browsers uncompress
# information on the fly. Note: Not all browsers support this.
#
#AddEncoding x-compress .Z
#AddEncoding x-gzip .gz .tgz
#
# If the AddEncoding directives above are commented-out, then you
# probably should define those extensions to indicate media types:
#
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
#
# AddHandler allows you to map certain file extensions to "handlers":
# actions unrelated to filetype. These can be either built into the server
# or added with the Action directive (see below)
#
# To use CGI scripts outside of ScriptAliased directories:
# (You will also need to add "ExecCGI" to the "Options" directive.)
#
#AddHandler cgi-script .cgi
# For type maps (negotiated resources):
#AddHandler type-map var
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
</IfModule>
#
# The mod_mime_magic module allows the server to use various hints from the
# contents of the file itself to determine its type. The MIMEMagicFile
# directive tells the module where the hint definitions are located.
#
#MIMEMagicFile conf/magic
#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#
#
# MaxRanges: Maximum number of Ranges in a request before
# returning the entire resource, or one of the special
# values 'default', 'none' or 'unlimited'.
# Default setting is to accept 200 Ranges.
#MaxRanges unlimited
#
# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall may be used to deliver
# files. This usually improves server performance, but must
# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
#
#EnableMMAP off
#EnableSendfile on
# Supplemental configuration
#
# The configuration files in the conf/extra/ directory can be
# included to add extra features or to modify the default configuration of
# the server, or you may simply copy their contents here and change as
# necessary.
# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf
# Multi-language error messages
Include conf/extra/httpd-multilang-errordoc.conf
# Fancy directory listings
Include conf/extra/httpd-autoindex.conf
# Language settings
Include conf/extra/httpd-languages.conf
# User home directories
# Tachtler
# default: Include conf/extra/httpd-userdir.conf
#Include conf/extra/httpd-userdir.conf
# Real-time info on requests and configuration
#Include conf/extra/httpd-info.conf
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
# Local access to the Apache HTTP Server Manual
#Include conf/extra/httpd-manual.conf
# Distributed authoring and versioning (WebDAV)
#Include conf/extra/httpd-dav.conf
# Various default settings
Include conf/extra/httpd-default.conf
# Configure mod_proxy_html to understand HTML4/XHTML1
<IfModule proxy_html_module>
Include conf/extra/proxy-html.conf
</IfModule>
# Secure (SSL/TLS) connections
#Include conf/extra/httpd-ssl.conf
#
# Note: The following must must be present to support
# starting without SSL on platforms with no /dev/random equivalent
# but a statically compiled-in mod_ssl.
#
<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>
Erklärungen:
LoadModule info_module modules/mod_info.so
Die Einbindung des Moduls mod_info
ist erforderlich, wenn über eine URL-Erweiterung Informationen über die Konfiguration des Apache HTTP Servers im HTML-Format angezeigt werden sollen.
Siehe auch nachfolgenden internen Link: Apache HTTP Server ArchLinux - info-Konfiguration
ServerAdmin webmaster@tachtler.net
E-Mail-Adresse des Apache HTTP Server-Administrators für automatisch generierte Fehlermeldungensseiten. Wenn der Apache HTTP Server bei der Beantwortung von Client-Anfragen auf Probleme stösst, wird eine angepasste Fehlermeldungsseite erzeugt, welche unter Umständen auch die zusätzliche Ausgabe eines Links mit der E-Mail-Adresse des Apache HTTP Server-Administrators enthalten kann.
Siehe auch nachfolgenden externen Link: ServerSignature
ServerName apache.tachtler.net:80
Hostname und TCP-Port des Apache HTTP Servers. Der hier angegeben Name dient ausschliesslich und nur der Selbstindentifikation des Apache HTTP Servers. Ob dieser auch für selbst referenzierende URLs benutzt werden soll, regelt nachfolgende Direktive:
Siehe nachfolgenden externen Link: UseCanonicalName
Options -Indexes +FollowSymLinks
Definiert, welche Eigenschaften oder Funktionen in einem bestimmten Verzeichnis verfügbar sind.
Options kann auf None
gesetzt werden, wobei dann keine der besonderen Eigenschaften verfügbar wäre, oder auf eines oder mehrere der nachfolgenden Tabelle:
Eigenschaft | Beschreibung |
All | Alle Optionen außer MultiViews. Dies ist die Voreinstellung. |
ExecCGI | Die Ausführung von CGI-Skripten, welche mod_cgi verwenden, ist erlaubt. |
FollowSymLinks | Der Server folgt symbolischen Links in diesem Verzeichnis. Auch wenn der Server symbolischen Links folgt, bedeutet dies nicht, dass der zum Abgleich gegen <Directory> -Abschnitte verwendete Pfadname wechselt. Es ist auch zu beachten, dass diese Option innerhalb eines <Location> -Abschnitts ignoriert wird. |
Includes | Server Side Includes, die von mod_include bereitgestellt werden, sind erlaubt. |
IncludesNOEXEC | Server Side Includes sind erlaubt, #exec cmd und #exec cgi sind jedoch deaktiviert. Es ist aber noch möglich, CGI-Skripte aus ScriptAlias-Verzeichnissen mittels #include virtual einzubinden. |
Indexes | Wenn eine URL, die auf ein Verzeichnis zeigt, in dem sich keine durch DirectoryIndex definierte Indexdatei (z.B. index.html) befindet, dann liefert mod_autoindex eine formatierte Auflistung des Verzeichnisses zurück. |
MultiViews | „MultiViews“ sind bei der Verwendung von mod_negotiation erlaubt (siehe Content-Negotiation). |
SymLinksIfOwnerMatch | Der Server folgt nur symbolischen Links, bei denen die Zieldatei bzw. das Zielverzeichnis der gleichen Benutzerkennung gehört, wie der Link. |
ACHTUNG - Die Vermischung von Optionen mit + oder - mit Optionen ohne diese (Zeichen) ist keine gültige Syntax und führt mit hoher Wahrscheinlichkeit zu unerwarteten Effekten. |
Siehe nachfolgenden externen Link: Options-Direktive
DirectoryIndex index.html index.htm
Name(n) der Index
-Seiten. Hier werden die Namen definiert, die der Apache HTTP Server automatisch ergänzt und ausliefert, wenn anstelle einer expliziten Datei, ein Verzeichnis vom Client angefordert wurde. Dies ist zwingend erforderlich, damit Benutzer einer Web-Seite wie z.B. http://www.tachtler.net anfragen können, ohne einen Namen der gewünschten Datei selbst angeben zu müssen. Der Apache HTTP Server wird die Reihenfolge von links nach rechts durchgehen und die Datei ausliefern, welche zuerst gefunden wurde.
#Include conf/extra/httpd-userdir.conf
Excludieren durch Auskommentierung der Konfigurationsdatei /etc/httpd/conf/extra/httpd-userdir.conf
. Diese Beinhaltet die Einstellungen zur Veröffentlichung von benutzerdefinierter Web-Seiten unter dem z.B. HOME-Verzeichnis eines UNIX-Benutzers (~/user-URL-Pfade) und soll hier nicht zur Anwendung kommen, da sonst z.B. Benutezr mit einem shell
-Account eigene Web-Inhalte unkontrolliert zur Verfügung stellen könnten.
Include conf/extra/httpd-info.conf
Includieren durch Einkommentierung der Konfigurationsdatei /etc/httpd/conf/extra/httpd-info.conf
. Diese Konfigurationsdatei beinhaltet Einstellungen zu Statusmeldungen und Informationen des Servers, abrufbar unter speziellen URL-Ergänzungen /server-status
und /server-info
.
Siehe auch nachfolgenden internen Link: Apache HTTP Server ArchLinux - info-Konfiguration
Basis-Konfiguration: /srv/http/index.html
Durch Neuanlage einer HTML-Datei in nachfolgendem Verzeichnis mit nachfolgendem Inhalt und nachfolgendem Befehl, kann die Auslieferung einer minimalistischen statischen Web-Seite durch den Apache HTTP Server erreicht werden:
# vim /srv/http/index.html
Nachfolgend der Inahlt:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>It works! Apache httpd</title>
</head>
<body>
<p>It works!</p>
</body>
</html>
Basis-Konfiguration: Neustart
Bevor weitere Konfigurationsschritte erfolgen, sollte ein Neustart erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl restart httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
Basis-Konfiguration: Tests
Wenn der Neustart des Apache HTTP Server erfolgreich durchgeführt wurde, kann die Abfrage mittels eines Browsers erfolgen, wie im nachfolgenden Bild dargestellt:
Durch anhängen nachfolgenden Zusatzes an die URL, wie z.B. /NotFound
kann - sofern keine Datei mit diesem Namen im Verzeichnis /srv/http
vorhanden ist, eine Fehlermeldung - hier Code: 404 erzeugt werden, wie nachfolgender Aufruf zeigt:
Wie zu sehen ist, ist die Fehlermeldung in
da dies im Browser als die bevorzugte Sprache eingestellt wurde.
Weiterhin ist auch das Ergebnis der Konfiguration der E-Mail-Adresse mittels der Direktive
ServerAdmin webmaster@tachtler.net
zu sehen, wenn eine Fehlermeldung generiert wird und der Mauszeiger über den Link - Webmaster bewegt wird.
default-Konfiguration
Verzeichnis/Name | Beschreibung |
/etc/httpd/conf/extra/httpd-default.conf | Beinhaltet zusätzliche Einstellungen für den Hauptserver |
/etc/httpd/conf/extra/httpd-default.conf
#
# This configuration file reflects default settings for Apache HTTP Server.
#
# You may change these, but chances are that you may not need to.
#
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 60
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 5
#
# UseCanonicalName: Determines how Apache constructs self-referencing
# URLs and the SERVER_NAME and SERVER_PORT variables.
# When set "Off", Apache will use the Hostname and Port supplied
# by the client. When set "On", Apache will use the value of the
# ServerName directive.
#
UseCanonicalName Off
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# ServerTokens
# This directive configures what you return as the Server HTTP response
# Header. The default is 'Full' which sends information about the OS-Type
# and compiled in modules.
# Set to one of: Full | OS | Minor | Minimal | Major | Prod
# where Full conveys the most information, and Prod the least.
#
ServerTokens Full
#
# Optionally add a line containing the server version and virtual host
# name to server-generated pages (internal error documents, FTP directory
# listings, mod_status and mod_info output etc., but not CGI generated
# documents or custom error documents).
# Set to "EMail" to also include a mailto: link to the ServerAdmin.
# Set to one of: On | Off | EMail
#
ServerSignature Off
#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off
#
# Set a timeout for how long the client may take to send the request header
# and body.
# The default for the headers is header=20-40,MinRate=500, which means wait
# for the first byte of headers for 20 seconds. If some data arrives,
# increase the timeout corresponding to a data rate of 500 bytes/s, but not
# above 40 seconds.
# The default for the request body is body=20,MinRate=500, which is the same
# but has no upper limit for the timeout.
# To disable, set to header=0 body=0
#
<IfModule reqtimeout_module>
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
</IfModule>
Erklärungen:
Ausführlichkeitseinstellung für die Ausgabe der Verionsangabe des für den HTTP-Antwort-Header: Server
. Diese Direktive legt fest, wie ausführlich der Apache HTTP Server dessen Versionsinformationen im HTTP-Antwort-Header: Server
und in der durch ServerSignature
definierten Fußzeile von automatisch generierten Dokumenten ausgibt und die INformationen die an den Client zurückgesendet werden, die eine Beschreibung des allgemeinen Betriesbsystemtyps des Servers wie auch Informationen über einkompilierte Module enthält.
Einstellung | Beschreibung |
ServerTokens Prod[uctOnly] | Der Server sendet (z.B.): Server: Apache |
ServerTokens Major | Der Server sendet (z.B.): Server: Apache/2 |
ServerTokens Minor | Der Server sendet (z.B.): Server: Apache/2.4 |
ServerTokens Min[imal] | Der Server sendet (z.B.): Server: Apache/2.4.53 |
ServerTokens OS | Der Server sendet (z.B.): Server: Apache/2.4.53 (Unix) |
ServerTokens Full | Standard wenn nicht angegeben - Der Server sendet (z.B.): Server: Apache/2.4.53 (Unix) PHP/7.4.28 |
HINWEIS - Diese Einstellung gilt für den gesamten Server und kann nicht auf Virtual-Host-Basis aktiviert oder deaktiviert werden.
Siehe nachfolgende externe Links: ServerTokens und ServerSignature
default-Konfiguration: Neustart
Bevor weitere Konfigurationsschritte erfolgen, sollte ein Neustart erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl restart httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
default-Konfiguration: Tests
Wenn ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt wurde, kann die Abfrage mittels eines Browsers erfolgen, wie im nachfolgenden Bild dargestellt:
Durch erneutes anhängen nachfolgenden Zusatzes an die URL, wie z.B. /NotFound
kann erneut - sofern immer noch keine Datei mit diesem Namen im Verzeichnis /srv/http
vorhanden ist, eine Fehlermeldung - hier Code: 404 erzeugt werden, wie nachfolgender Aufruf zeigt:
Wie zu sehen ist, ist auch das Ergebnis der Konfiguration der Apache HTTP Server-Versionsinformationsanzeige mittels der Direktive
wenn eine Fehlermeldung generiert wird, nun weniger gesprächig.
/usr/share/httpd/error/include/bottom.html
Wenn eine Fehlerseite ausgegeben wird, wird aktuell keine Datum und keine Uhrzeit mit der Fehlerseite mehr angezeigt, wie nachfolgendes Beispiel demonstriert:
Der Aufruf der URL:
sollte nachfolgende Anzeige zum Vorschein bringen:
Falls das Datum und die Uhrzeit der Fehlermeldung mit angezeigt werden sollen, kann die Konfigurationsdatei
wie folgt erweitert werden.
Die Anpassungen werden mit einem vorangestellten Kommentar in der Form
<!-- # Tachtler - new -->
...
<!-- # Tachtler - end -->
gekennzeichnet.
(Komplette Konfigurationsdatei)
</p>
<p>
<!--#include virtual="../contact.html.var" -->
</p>
<h2>Error <!--#echo encoding="none" var="REDIRECT_STATUS" --></h2>
<address>
<a href="/"><!--#echo var="SERVER_NAME" --></a><br />
<!-- # Tachtler - new -->
<!--#config timefmt="%A, %d-%b-%Y %H:%M:%S %Z" -->
<span><!--#echo var="DATE_LOCAL" --></span><br />
<!-- # Tachtler - end -->
<span><!--#echo var="SERVER_SOFTWARE" --></span>
</address>
</body>
</html>
Es müssen effektiv die nachfolgenden Zeilen an der entsprechenden Stelle eingefügt werden:
<!-- # Tachtler - new -->
<!--#config timefmt="%A, %d-%b-%Y %H:%M:%S %Z" -->
<span><!--#echo var="DATE_LOCAL" --></span><br />
<!-- # Tachtler - end -->
Nachfolgende Tabelle zeigt die gebräuchlichsten Argumente für (timefmt
):
Eine vollständige Liste aller Argumente kann unter nachfolgendem externen Link aufgerufen werden:
Argument | Beschreibung |
%a | kurzer Wochentagname |
%A | langer Wochentagname |
%b | kurzer Monatsname |
%B | langer Monatsname |
%c | bevorzugte Datum und Zeit Anzeige |
%d | Tag des Monats als Nummer |
%H | Stunden (24-Stunden Format) |
%I | Stunden (12-Stunden Format) |
%j | Tag im Jahr |
%m | Stunden des Monats als Nummer |
%M | Minute als Nummer |
%p | AM oder PM anzeigen |
%S | Sekunden als Nummer |
%U | Wochentag als Nummer (0-7) |
%w | Wochennummer |
%x | bevorzugtes Datum ohne Zeit Anzeige |
%X | bevorzugte Zeit ohne Datum Anzeige |
%y | zweistellige Jahreszahl |
%Y | vierstellige Jahreszahl |
%Z | Zeitzone |
Wenn nach der vorangestellten Konfiguration eine Fehlerseite ausgegeben wird, wird das aktuelle Datum und die aktuelle Uhrzeit mit der Fehlerseite angezeigt, wie nachfolgendes Beispiel demonstriert:
ACHTUNG - Leider muss die Anpassung der Konfigurationsdatei /usr/share/httpd/error/include/bottom.html nach jedem Apache HTTP Server-Update erneut vorgenommen werden! |
info-Konfiguration
Nachfolgende Konfiguration ermöglicht es zwei URL-Erweiterungen zu implementieren, welche unter
/server-status
- Statusinformationen zum Server bzw. virtuellen Host
/server-info
- Informationen zu Modulnamen, Konfigurationen, Hooks, Modulen und dem Server selbst
?Modulname
- Beschränkung der Ausgabe von Informationen zu einem Modul mit dem angegeben Namen
?config
- Ausgabe der Konfiguration inklusive aller inkludierten Konfigurationsdateien
?hooks
- Ausgabe nur der einzelnen Hooks, mit denen die Module verknüpft sind
?list
- Ausgabe einer einfachen Liste aller geladenen Module
-
abgerufen werden können.
Verzeichnis/Name | Beschreibung |
/etc/httpd/conf/extra/httpd-info.conf | Beinhaltet Einstellungen zu Statusmeldungen und Informationen des Servers, abrufbar unter speziellen URL-Ergänzungen /server-status und /server-info |
/etc/httpd/conf/extra/httpd-info.conf
#
# Get information about the requests being processed by the server
# and the configuration of the server.
#
# Required modules: mod_authz_core, mod_authz_host,
# mod_info (for the server-info handler),
# mod_status (for the server-status handler)
#
# Allow server status reports generated by mod_status,
# with the URL of http://servername/server-status
# Change the ".example.com" to match your domain to enable.
<Location /server-status>
SetHandler server-status
# Tachtler
# default: Require host .example.com
# default: Require ip 127
Require all granted
</Location>
#
# ExtendedStatus controls whether Apache will generate "full" status
# information (ExtendedStatus On) or just basic information (ExtendedStatus
# Off) when the "server-status" handler is called. The default is Off.
#
# Tachtler
# default: #ExtendedStatus On
ExtendedStatus On
# Tachtler - NEW -
SeeRequestTail On
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
<Location /server-info>
SetHandler server-info
# Tachtler
# default: Require host .example.com
# default: Require ip 127
Require all granted
</Location>
Erklärungen:
Zugriff auf die URL-Erweiterung /server-status
, ohne Beschränkungen.
Siehe auch nachfolgenden externen Link: Require
HINWEIS - Der Zugriff auf diese URL-Erweiterung sollte durch eine Zugriffsbeschränkung eingeschränkt werden
Siehe auch nachfolgende internen Links:
Statusinformationen für jede einzelne Abfrage aktivieren. Beim setzen auf On
werden auch zusätzlich Informationen über jede einzelne Abfrage angezeigt.
Anzeige der letzten 63 Zeichen aller Statusinformationen für jede einzelne Abfrage und nicht der ersten 63 Zeichen, was der Standard wäre
Zugriff auf die URL-Erweiterung /server-info
, ohne Beschränkungen.
Siehe auch nachfolgenden externen Link: Require
HINWEIS - Der Zugriff auf diese URL-Erweiterung sollte durch eine Zugriffsbeschränkung eingeschränkt werden
Siehe auch nachfolgende internen Links:
info-Konfiguration: Neustart
Bevor weitere Konfigurationsschritte erfolgen, sollte ein Neustart erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl restart httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
info-Konfiguration: Tests
Wenn ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt wurde, können nachfolgende Abfragen mittels eines Browsers erfolgen, wie in nachfolgenden Bildern dargestellt durchgeführt werden:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-status
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-status?auto
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-status?refresh=5
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-info
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL, z.B. hier /server-info?mod_info.c
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-info?config
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-info?hooks
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-info?list
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
Durch anhängen nachfolgenden Zusatzes an die URL: /server-info?server
kommt eine Ansicht in etwa wie nachfolgende zur Ansicht:
languages-Konfiguration
Verzeichnis/Name | Beschreibung |
/etc/httpd/conf/extra/httpd-language.conf | Einstellungen für die Zuordnung zwischen zusätzlichen Dateiendungen und Dokumentsprachen |
/etc/httpd/conf/extra/httpd-language.conf
#
# Settings for hosting different languages.
#
# Required modules: mod_mime, mod_negotiation
# DefaultLanguage and AddLanguage allows you to specify the language of
# a document. You can then use content negotiation to give a browser a
# file in a language the user can understand.
#
# Specify a default language. This means that all data
# going out without a specific language tag (see below) will
# be marked with this one. You probably do NOT want to set
# this unless you are sure it is correct for all cases.
#
# * It is generally better to not mark a page as
# * being a certain language than marking it with the wrong
# * language!
#
# DefaultLanguage nl
#
# Note 1: The suffix does not have to be the same as the language
# keyword --- those with documents in Polish (whose net-standard
# language code is pl) may wish to use "AddLanguage pl .po" to
# avoid the ambiguity with the common suffix for perl scripts.
#
# Note 2: The example entries below illustrate that in some cases
# the two character 'Language' abbreviation is not identical to
# the two character 'Country' code for its country,
# E.g. 'Danmark/dk' versus 'Danish/da'.
#
# Note 3: In the case of 'ltz' we violate the RFC by using a three char
# specifier. There is 'work in progress' to fix this and get
# the reference data for rfc1766 cleaned up.
#
# Catalan (ca) - Croatian (hr) - Czech (cs) - Danish (da) - Dutch (nl)
# English (en) - Esperanto (eo) - Estonian (et) - French (fr) - German (de)
# Greek-Modern (el) - Hebrew (he) - Italian (it) - Japanese (ja)
# Korean (ko) - Luxembourgeois* (ltz) - Norwegian Nynorsk (nn)
# Norwegian (no) - Polish (pl) - Portugese (pt)
# Brazilian Portuguese (pt-BR) - Russian (ru) - Swedish (sv)
# Turkish (tr) - Simplified Chinese (zh-CN) - Spanish (es)
# Traditional Chinese (zh-TW)
#
AddLanguage ca .ca
AddLanguage cs .cz .cs
AddLanguage da .dk
AddLanguage de .de
AddLanguage el .el
AddLanguage en .en
AddLanguage eo .eo
AddLanguage es .es
AddLanguage et .et
AddLanguage fr .fr
AddLanguage he .he
AddLanguage hr .hr
AddLanguage it .it
AddLanguage ja .ja
AddLanguage ko .ko
AddLanguage ltz .ltz
AddLanguage nl .nl
AddLanguage nn .nn
AddLanguage no .no
AddLanguage pl .po
AddLanguage pt .pt
AddLanguage pt-BR .pt-br
AddLanguage ru .ru
AddLanguage sv .sv
AddLanguage tr .tr
AddLanguage zh-CN .zh-cn
AddLanguage zh-TW .zh-tw
# LanguagePriority allows you to give precedence to some languages
# in case of a tie during content negotiation.
#
# Just list the languages in decreasing order of preference. We have
# more or less alphabetized them here. You probably want to change this.
#
# Tachtler
# default: LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW
LanguagePriority de en ca cs da el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW
#
# ForceLanguagePriority allows you to serve a result page rather than
# MULTIPLE CHOICES (Prefer) [in case of a tie] or NOT ACCEPTABLE (Fallback)
# [in case no accepted languages matched the available variants]
#
ForceLanguagePriority Prefer Fallback
#
# Commonly used filename extensions to character sets. You probably
# want to avoid clashes with the language extensions, unless you
# are good at carefully testing your setup after each change.
# See http://www.iana.org/assignments/character-sets for the
# official list of charset names and their respective RFCs.
#
AddCharset us-ascii.ascii .us-ascii
AddCharset ISO-8859-1 .iso8859-1 .latin1
AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen
AddCharset ISO-8859-3 .iso8859-3 .latin3
AddCharset ISO-8859-4 .iso8859-4 .latin4
AddCharset ISO-8859-5 .iso8859-5 .cyr .iso-ru
AddCharset ISO-8859-6 .iso8859-6 .arb .arabic
AddCharset ISO-8859-7 .iso8859-7 .grk .greek
AddCharset ISO-8859-8 .iso8859-8 .heb .hebrew
AddCharset ISO-8859-9 .iso8859-9 .latin5 .trk
AddCharset ISO-8859-10 .iso8859-10 .latin6
AddCharset ISO-8859-13 .iso8859-13
AddCharset ISO-8859-14 .iso8859-14 .latin8
AddCharset ISO-8859-15 .iso8859-15 .latin9
AddCharset ISO-8859-16 .iso8859-16 .latin10
AddCharset ISO-2022-JP .iso2022-jp .jis
AddCharset ISO-2022-KR .iso2022-kr .kis
AddCharset ISO-2022-CN .iso2022-cn .cis
AddCharset Big5.Big5 .big5 .b5
AddCharset cn-Big5 .cn-big5
# For russian, more than one charset is used (depends on client, mostly):
AddCharset WINDOWS-1251 .cp-1251 .win-1251
AddCharset CP866 .cp866
AddCharset KOI8 .koi8
AddCharset KOI8-E .koi8-e
AddCharset KOI8-r .koi8-r .koi8-ru
AddCharset KOI8-U .koi8-u
AddCharset KOI8-ru .koi8-uk .ua
AddCharset ISO-10646-UCS-2 .ucs2
AddCharset ISO-10646-UCS-4 .ucs4
AddCharset UTF-7 .utf7
AddCharset UTF-8 .utf8
AddCharset UTF-16 .utf16
AddCharset UTF-16BE .utf16be
AddCharset UTF-16LE .utf16le
AddCharset UTF-32 .utf32
AddCharset UTF-32BE .utf32be
AddCharset UTF-32LE .utf32le
AddCharset euc-cn .euc-cn
AddCharset euc-gb .euc-gb
AddCharset euc-jp .euc-jp
AddCharset euc-kr .euc-kr
#Not sure how euc-tw got in - IANA doesn't list it???
AddCharset EUC-TW .euc-tw
AddCharset gb2312 .gb2312 .gb
AddCharset iso-10646-ucs-2 .ucs-2 .iso-10646-ucs-2
AddCharset iso-10646-ucs-4 .ucs-4 .iso-10646-ucs-4
AddCharset shift_jis .shift_jis .sjis
Erklärungen:
LanguagePriority de en ca cs da el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-CN zh-TW
Änderung der Reihenfolge des zu verwendenden Sprache, wenn der anfragende Clinet, keine Sprachpräferenzen mit angefordert hat.
languages-Konfiguration: /etc/httpd/conf/httpd.conf
Bevor ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt werden soll, ist es erforderlich für den nachfolgenden Test die Konfigurationsdatei /etc/httpd/conf/httpd.conf
erneut zu verändern.
Nachfolgende die Ergänzung, welche vorgenommen werden soll:
(Nur relevanter Ausschnitt):
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/srv/http"
<Directory "/srv/http">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
# Tachtler
# default: Options Indexes FollowSymLinks
Options -Indexes +FollowSymLinks +MultiViews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
Erklärungen:
Options -Indexes +FollowSymLinks +MultiViews
Das hinzufügen der Option +MultiViews
, generiert anhand der Dateiendungen und anhand der Standard MIME-Grundeinstellungen automatisch eine Type-Map. Die Multiview-Suche funktioniert nach nachfolgendem Schema. Es wir eine Datei vom Client angefordert, da diese aber mit genau diesem Dateinamen nicht vorhanden ist, hier index.html
, wird eine Content-Negotiation durchgeführt und nach dieser Datei mit einer Sprachendung, wie hier z.B. .de
oder .en
gesucht und diese dann versucht auszuliefern.
languages-Konfiguration: /srv/http/index.html.de und /srv/http/index.html.en
Bevor ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt werden soll, soll zuerst nachfolgende Datei, falls diese bereits vorhanden sein sollte, wie folgt gelöscht werden:
# rm /srv/http/index.html
Anschließend sollten zwei neue Dateien
/srv/http/index.html.de
/srv/http/index.html.en
mit nachfolgenden Befehelen und Inhalt wie nachfolgend dargestellt angelegt werden:
(Komplette HTML-Dateien):
# vim /srv/http/index.html.de
Nachfolgend der Inhalt:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Es funktioniert! Apache httpd</title>
</head>
<body>
<p>Es funktioniert!</p>
</body>
</html>
# vim /srv/http/index.html.en
Nachfolgend der Inhalt:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>It works! Apache httpd</title>
</head>
<body>
<p>It works!</p>
</body>
</html>
languages-Konfiguration: Neustart
Bevor weitere Konfigurationsschritte erfolgen, sollte ein Neustart erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl restart httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
languages-Konfiguration: Tests
Wenn ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt wurde, können nachfolgende Abfragen mittels des shell
-Werkzeuges - telnet
- wie folgt durchgeführt werden:
Nachfolgende drei Zeilen sind einzugeben und dann muss zwei mal die [Enter/Return]-Taste gedrückt werden, um nachfolgende Ausgabe zu erzeugen:
# telnet apache.tachtler.net 80
GET / HTTP/1.0
Host: apache.tachtler.net
(Nachfolgend die tatsächliche Ausführung):
# telnet apache.tachtler.net 80
Trying 192.168.0.30...
Connected to apache.tachtler.net.
Escape character is '^]'.
GET / HTTP/1.0
Host: apache.tachtler.net
HTTP/1.1 200 OK
Date: Sun, 10 Apr 2022 05:17:15 GMT
Server: Apache
Content-Location: index.html.de
Vary: negotiate,accept-language
TCN: choice
Last-Modified: Mon, 04 Apr 2022 18:54:46 GMT
ETag: "cd-5dbd8a97fc84d"
Accept-Ranges: bytes
Content-Length: 205
Connection: close
Content-Type: text/html
Content-Language: de
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Es funktioniert! Apache httpd</title>
</head>
<body>
<p>Es funktioniert!</p>
</body>
</html>
Connection closed by foreign host.
HINWEIS - Falls die LanguagePriority
entsprechend angepasst wurde und der Client keine Sprachpräferenz sendet, wird Eine Sprache nach der Anderen der Reihenfolge nach angewendet, die z.B. de
, an die angeforderte Datei angehängt und falls die so neu entstandene Datei gefunden wird, ausgeliefert!
Nachfolgend eine ähnliches Beispiel, nur mit Angabe einer Sprachpräferenz, hier z.B. en
Nachfolgende vier Zeilen sind einzugeben und dann muss zwei mal die [Enter/Return]-Taste gedrückt werden, um nachfolgende Ausgabe zu erzeugen:
# telnet apache.tachtler.net 80
GET / HTTP/1.0
Host: apache.tachtler.net
Accept-Language: en
(Nachfolgend die tatsächliche Ausführung):
# telnet apache.tachtler.net 80
Trying 192.168.0.30...
Connected to apache.tachtler.net.
Escape character is '^]'.
GET / HTTP/1.0
Host: apache.tachtler.net
Accept-Language: en
HTTP/1.1 200 OK
Date: Sun, 10 Apr 2022 05:23:12 GMT
Server: Apache
Content-Location: index.html.en
Vary: negotiate,accept-language
TCN: choice
Last-Modified: Sun, 03 Apr 2022 15:49:41 GMT
ETag: "bf-5dbc1f5c29f80"
Accept-Ranges: bytes
Content-Length: 191
Connection: close
Content-Type: text/html
Content-Language: en
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>It works! Apache httpd</title>
</head>
<body>
<p>It works!</p>
</body>
</html>
Connection closed by foreign host.
multilang-errordoc-Konfiguration
Verzeichnis/Name | Beschreibung |
/etc/httpd/conf/extra/httpd-multilang-errordoc.conf | Beinhaltet Einstellungen für Mehrsprachige Fehlermeldungsseiten |
/etc/httpd/conf/extra/httpd-multilang-errordoc.conf
#
# The configuration below implements multi-language error documents through
# content-negotiation.
#
# Required modules: mod_alias, mod_authz_core, mod_authz_host,
# mod_include, mod_negotiation
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections. We use
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
# Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /usr/share/httpd/error/include/ files and copying them to /your/include/path/,
# even on a per-VirtualHost basis. The default include files will display
# your Apache version number and your ServerAdmin email address regardless
# of the setting of ServerSignature.
Alias /error/ "/usr/share/httpd/error/"
<Directory "/usr/share/httpd/error">
AllowOverride None
Options IncludesNoExec
AddOutputFilter Includes html
AddHandler type-map var
Require all granted
# Tachtler
# default: LanguagePriority en cs de es fr it ja ko nl pl pt-br ro sv tr
LanguagePriority de en cs es fr it ja ko nl pl pt-br ro sv tr
ForceLanguagePriority Prefer Fallback
</Directory>
ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
ErrorDocument 410 /error/HTTP_GONE.html.var
ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var
Erklärungen:
LanguagePriority de en cs es fr it ja ko nl pl pt-br ro sv tr
Änderung der Reihenfolge des zu verwendenden Sprache, wenn der anfragende Clinet, keine Sprachpräferenzen mit angefordert hat und eine Fehlermeldung erzeugt wird, da eine Anfrage nicht, aus welchem Grund auch immer, beantwortet werden kann.
multilang-errordoc-Konfiguration: Neustart
Bevor weitere Konfigurationsschritte erfolgen, sollte ein Neustart erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl restart httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
multilang-errordoc-Konfiguration: Test
Wenn ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt wurde, können nachfolgende Abfragen mittels des shell
-Werkzeuges - telnet
- wie folgt durchgeführt werden:
Nachfolgende drei Zeilen sind einzugeben und dann muss zwei mal die [Enter/Return]-Taste gedrückt werden, um nachfolgende Ausgabe zu erzeugen:
# telnet apache.tachtler.net 80
GET /NotFound HTTP/1.0
Host: apache.tachtler.net
(Nachfolgend die tatsächliche Ausführung):
# telnet apache.tachtler.net 80
Trying 192.168.0.30...
Connected to apache.tachtler.net.
Escape character is '^]'.
GET /NotFound HTTP/1.0
Host: apache.tachtler.net
HTTP/1.1 404 Not Found
Date: Sun, 10 Apr 2022 05:52:46 GMT
Server: Apache
Vary: accept-language,accept-charset
Accept-Ranges: bytes
Connection: close
Content-Type: text/html; charset=utf-8
Content-Language: de
Expires: Sun, 10 Apr 2022 05:52:46 GMT
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="de" xml:lang="de">
<head>
<title>Objekt nicht gefunden!</title>
<link rev="made" href="mailto:webmaster@tachtler.net" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
body { color: #000000; background-color: #FFFFFF; }
a:link { color: #0000CC; }
p, address {margin-left: 3em;}
span {font-size: smaller;}
/*]]>*/--></style>
</head>
<body>
<h1>Objekt nicht gefunden!</h1>
<p>
Der angeforderte URL konnte auf dem Server nicht gefunden werden.
Sofern Sie den URL manuell eingegeben haben,
überprüfen Sie bitte die Schreibweise und versuchen Sie es erneut.
</p>
<p>
Sofern Sie dies für eine Fehlfunktion des Servers halten,
informieren Sie bitte den
<a href="mailto:webmaster@tachtler.net">Webmaster</a>
hierüber.
</p>
<h2>Error 404</h2>
<address>
<a href="/">apache.tachtler.net</a><br />
<!-- # Tachtler - new -->
<span>Sunday, 10-Apr-2022 07:52:46 CEST</span><br />
<!-- # Tachtler - end -->
<span>Apache</span>
</address>
</body>
</html>
Connection closed by foreign host.
HINWEIS - Falls die LanguagePriority
entsprechend angepasst wurde und der Client keine Sprachpräferenz sendet, wird Eine Sprache nach der Anderen der Reihenfolge nach angewendet und ausgeliefert!
Basic Authentifizierung
Die einfachste Art der Authentifizierung mittels basic
Authentifizierung in Kombination mit einfachen Text-Dateien.
Basic Authentifizierung: htpasswd
Mit nachfolgendem Befehl kann eine neue Passwortdatei innerhalb eines Verzeichnisses, hier z.B.
wie folgt erzeugt werden:
# htpasswd -c -B -C 6 /etc/httpd/conf/.htpasswd klaus
New password:
Re-type new password:
Adding password for user klaus
Erklärungen:
Die verwendeten Parameter haben nachfolgende Bedeutung:
Parameter | Erklärung |
-c | Erstellt eine neue Passwortdatei mit dem angegebenen Dateinamen |
-B | Erzwingen Sie die bcrypt-Verschlüsselung des Passworts (sehr sicher). |
-C 6 | Legen die für den bcrypt-Algorithmus verwendete Berechnungszeit fest
(höher ist sicherer, aber langsamer, Standard: 5, gültig: 4 bis 17). |
/etc/httpd/conf/.htpasswd | Pfad und Dateiname für die Passwortdatei - hier .htpasswd |
klaus | Benutzername, welcher der Passwortdatei hinzugefügt werden soll |
HINWEIS - Der Befehl ohne die Option -c
fügt einen weiteren Benutzer hinzu!
Mit nachfolgendem Befehl kann eine bestehende Passwortdatei innerhalb eines Verzeichnisses, hier z.B.
wie folgt um einen weiteren Benutzernamen erweitert werden:
# htpasswd -B -C 6 /etc/httpd/conf/.htpasswd petra
New password:
Re-type new password:
Adding password for user petra
HINWEIS - Benutzer können durch einfaches entfernen der jeweiligen Zeile aus der Passwortdatei entfernt werden!
Nachfolgende Befehle setzen noch die richtigen Besitz- und Dateirechte für die soeben neu erstellt Passwortdatei - /etc/httpd/conf/.htpasswd
:
Besitzrechte:
# chown root.http /etc/httpd/conf/.htpasswd
Dateirechte:
# chmod 640 /etc/httpd/conf/.htpasswd
Mit nachfolgendem Befehl kann überprüft werden, ob die Erstellung und das Setzen der Besitz- und Dateirechte wie gewünscht durchgeführt wurde
# ls -la /etc/httpd/conf/.htpasswd
-rw-r----- 1 root http 134 Apr 11 18:31 /etc/httpd/conf/.htpasswd
Nachfolgender Befehl zeigt den Inhalt der Passwortdatei - /etc/httpd/conf/.htpasswd
:
# cat /etc/httpd/conf/.htpasswd
klaus:$2y$06$mhZ6mz8rVfvRTooKl6VCmejxLkC1jH/ckxAyyOs/5lbUHTVP8AvhG
petra:$2y$06$MNhcUbOIFYef92sYC1S8/.l/sHPTbGVWJAKlwgFPZEOLRreULiXvi
/etc/httpd/conf/httpd.conf
Anschliessend sind nachfolgende minimale Änderungen, hier an der Konfigurationsdatei
im Bereich DocumentRoot
durchzuführen:
(Nur relevanter Ausschnitt):
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/srv/http"
<Directory "/srv/http">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
# Tachtler
# default: Options Indexes FollowSymLinks
Options -Indexes +FollowSymLinks +MultiViews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
# Tachtler
# default: Require all granted
AuthType Basic
AuthName "Password protected area!"
AuthUserFile conf/.htpasswd
Require valid-user
</Directory>
Erklärungen:
# Tachtler
# default: Require all granted
AuthType Basic
AuthName "Password protected area!"
AuthUserFile conf/.htpasswd
Require valid-user
Anstelle der Standard Zugriffsrechte - Require all granted
ist es erforderlich die vorhergehend gezeigt Konfiguration, welche minimal aus den Komponenten:
AuthType
- Art der Authentifizierung
AuthName
- Text der vom Client angezeigt werden kann, welcher bei der Authentifizierung präsentiert werden soll
AuthUserFile
- Relativer Pfad zur Direktive ServerRoot
″/etc/httpd″
Require valid-user
- Zugriffsformulierung, hier „gültige Benutzer“
Basic Authentifizierung: htpasswd - Neustart
Bevor weitere Konfigurationsschritte erfolgen, sollte ein Neustart erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl restart httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
Basic Authentifizierung: htpasswd - Test
Wenn ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt wurde, kann die Abfrage mittels eines Browsers erfolgen, wie im nachfolgenden Bild dargestellt:
Digest Authentifizierung
Die einfachste und etwas sicherere Art der Authentifizierung mittels digest
Authentifizierung in Kombination mit einfachen Text-Dateien.
Digest Authentifizierung: htdigest
Eine erheblich sicherere Methode, gegenüber der Apache HTTP Server ArchLinux - Basic Authentifizierung - Basic Authentifizierung: htpasswd , stellt die Apache HTTP Server ArchLinux - Digest Authentifizierung - Digest Authentifizierung: htdigest dar.
Bei der Apache HTTP Server ArchLinux - Digest Authentifizierung - Digest Authentifizierung: htdigest werden keine Klartextpasswörter übertragen, sondern ein MD5-Hash, der aus den Anmeldedaten erzeugt wird.
Mit nachfolgendem Befehl kann eine neue Passwortdatei innerhalb eines Verzeichnisses, hier z.B.
wie folgt erzeugt werden:
# htdigest -c /etc/httpd/conf/.htdigest "Password protected area!" klaus
Adding password for klaus in realm Password protected area!.
New password:
Re-type new password:
Erklärungen:
Die verwendeten Parameter haben nachfolgende Bedeutung:
Parameter | Erklärung |
-c | Erstellt eine neue Passwortdatei mit dem angegebenen Dateinamen |
/etc/httpd/conf/.htdigest | Pfad und Dateiname für die Passwortdatei - hier .htdigest |
“Password protected area!” | Der Realm-Name, zu dem der Benutzername gehört |
klaus | Benutzername, welcher der Passwortdatei hinzugefügt werden soll |
HINWEIS - Der Befehl ohne die Option -c
fügt einen weiteren Benutzer hinzu!
Mit nachfolgendem Befehl kann eine bestehende Passwortdatei innerhalb eines Verzeichnisses, hier z.B.
wie folgt um einen weiteren Benutzernamen erweitert werden:
# htdigest /etc/httpd/conf/.htdigest "Password protected area!" petra
Adding user petra in realm Password protected area!
New password:
Re-type new password:
HINWEIS - Benutzer können durch einfaches entfernen der jeweiligen Zeile aus der Passwortdatei entfernt werden!
Nachfolgende Befehle setzen noch die richtigen Besitz- und Dateirechte für die soeben neu erstellt Passwortdatei - /etc/httpd/conf/.htdigest
:
Besitzrechte:
# chown root.http /etc/httpd/conf/.htdigest
Dateirechte:
# chmod 640 /etc/httpd/conf/.htdigest
Mit nachfolgendem Befehl kann überprüft werden, ob die Erstellung und das Setzen der Besitz- und Dateirechte wie gewünscht durchgeführt wurde
# ls -la /etc/httpd/conf/.htdigest
-rw-r----- 1 root http 128 Apr 11 20:20 /etc/httpd/conf/.htdigest
Nachfolgender Befehl zeigt den Inhalt der Passwortdatei - /etc/httpd/conf/.htdigest
:
# cat /etc/httpd/conf/.htdigest
klaus:Password protected area!:31e5e4076b3e3519318b7611f8fb0eb5
petra:Password protected area!:b2313b18ddfd181c49f321002356a68a
/etc/httpd/conf/httpd.conf - Teil 1
Anschliessend sind nachfolgende minimale Änderungen, hier an der Konfigurationsdatei
durchzuführen:
(Nur relevanter Ausschnitt):
# Tachtler
# default: #LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule auth_digest_module modules/mod_auth_digest.so
Erklärungen:
# Tachtler
# default: #LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule auth_digest_module modules/mod_auth_digest.so
Um die Apache HTTP Server ArchLinux - Digest Authentifizierung nutzen zu können, muss das Apache HTTP Server-Modul - mod_auth_digest
geladen werden.
/etc/httpd/conf/httpd.conf - Teil 2
Anschliessend sind nachfolgende minimale Änderungen, hier an der Konfigurationsdatei
im Bereich DocumentRoot
durchzuführen:
(Nur relevanter Ausschnitt):
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/srv/http"
<Directory "/srv/http">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
# Tachtler
# default: Options Indexes FollowSymLinks
Options -Indexes +FollowSymLinks +MultiViews
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
# Tachtler
# default: Require all granted
AuthType Digest
AuthName "Password protected area!"
AuthDigestDomain "/" "http://apache.tachtler.net/"
AuthDigestProvider file
AuthUserFile conf/.htdigest
Require valid-user
</Directory>
Erklärungen:
# Tachtler
# default: Require all granted
AuthType Digest
AuthName "Password protected area!"
AuthDigestDomain "/" "http://apache.tachtler.net/"
AuthDigestProvider file
AuthUserFile conf/.htdigest
Require valid-user
Anstelle der Standard Zugriffsrechte - Require all granted
ist es erforderlich die vorhergehend gezeigt Konfiguration, welche minimal aus den Komponenten:
AuthType
- Art der Authentifizierung
AuthName
- Muss der definierte Realm sein !*
AuthDigestDomain
- URIs, die sich im gleichen Schutzraum für die Digest-Authentifizierung befinden
AuthDigestProvider
- Legt den/die Authentifizierungsanbieter für diesen Schutzraum fest
AuthUserFile
- Relativer Pfad zur Direktive ServerRoot
″/etc/httpd″
Require valid-user
- Zugriffsformulierung, hier „gültige Benutzer“
Digest Authentifizierung: htdigest - Neustart
Bevor weitere Konfigurationsschritte erfolgen, sollte ein Neustart erfolgen, was mit nachfolgendem Befehl durchgeführt werden kann:
# systemctl restart httpd.service
HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !
Digest Authentifizierung: htdigest - Test
Wenn ein erneuter Neustart des Apache HTTP Server erfolgreich durchgeführt wurde, kann die Abfrage mittels eines Browsers erfolgen, wie im nachfolgenden Bild dargestellt:
Nützliche Befehle
Nachfolgende Befehle können bei der Administration eines Apache HTTP Servers nützlich sein.
HINWEIS - Die nachfolgende Auflistung erhebt keinen Anspruch auf Vollständigkeit !
/usr/bin/apachectl
Der nachfolgende Befehl
stellt das Apache Server Control Interface dar.
Nachfolgende eine Auflistung der gebräuchlichsten Befehle unter Zuhilfenahme von apachectl
:
Befehl | Beschreibung |
apachectl configtest
| Syntaktische Überprüfung der kompletten Konfiguration |
apachectl -t
| Wie configtest |
apachectl -v
| Ausgabe der Version |
apachectl -V
| Ausgabe der Version und zusätzlicher Parameter |
apachectl -l
| Ausgabe der einkompilierten Module |
apachectl -L
| Ausgabe aller möglichen Konfigurationsdirektiven |
apachectl -t -D DUMP_VHOSTS
| Auflistung aller konfigurierten virtuellen Hosts |
apachectl -t -D DUMP_RUN_CFG
| Ausgabe der Laufzeit-Einstellungen |
apachectl -S
| Wie -t -D DUMP_VHOSTS und -t -D DUMP_RUN_CFG |
apachectl -t -D DUMP_MODULES
| Auflistung aller geladenen Module |
apachectl -M
| Wie -t -D DUMP_MODULES |