Benutzer-Werkzeuge

Webseiten-Werkzeuge


Action disabled: source
tachtler:apache_http_server_centos_7

Apache HTTP Server CentOS 7

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.

Installation

Zur Installation des Apache HTTP Servers wird nachfolgendes Paket benötigt:

  • httpd - ist im base-Repository von CentOS enthalten

installiert werden.

Mit nachfolgendem Befehl, wird das Pakete httpd installiert:

# yum install httpd
Loaded plugins: changelog, priorities
59 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.4.6-18.el7.centos will be installed
--> Processing Dependency: httpd-tools = 2.4.6-18.el7.centos for package: httpd-2.4.6-18.el7.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-18.el7.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-18.el7.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-18.el7.centos.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-3.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
---> Package httpd-tools.x86_64 0:2.4.6-18.el7.centos will be installed
---> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
--> Finished Dependency Resolution

Changes in packages about to be updated:


Dependencies Resolved

================================================================================
 Package           Arch         Version                     Repository     Size
================================================================================
Installing:
 httpd             x86_64       2.4.6-18.el7.centos         updates       2.7 M
Installing for dependencies:
 apr               x86_64       1.4.8-3.el7                 base          103 k
 apr-util          x86_64       1.5.2-6.el7                 base           92 k
 httpd-tools       x86_64       2.4.6-18.el7.centos         updates        77 k
 mailcap           noarch       2.1.41-2.el7                base           31 k

Transaction Summary
================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 3.0 M
Installed size: 10 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/base/packages/apr-1.4.8-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, 
key ID f4a80eb5: NOKEY
Public key for apr-1.4.8-3.el7.x86_64.rpm is not installed
(1/5): apr-1.4.8-3.el7.x86_64.rpm                          | 103 kB   00:00     
(2/5): apr-util-1.5.2-6.el7.x86_64.rpm                     |  92 kB   00:00     
(3/5): mailcap-2.1.41-2.el7.noarch.rpm                     |  31 kB   00:00     
Public key for httpd-tools-2.4.6-18.el7.centos.x86_64.rpm is not installed
(4/5): httpd-tools-2.4.6-18.el7.centos.x86_64.rpm          |  77 kB   00:00     
(5/5): httpd-2.4.6-18.el7.centos.x86_64.rpm                | 2.7 MB   00:00     
--------------------------------------------------------------------------------
Total                                              6.2 MB/s | 3.0 MB  00:00     
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Importing GPG key 0xF4A80EB5:
 Userid     : "CentOS-7 Key (CentOS 7 Official Signing Key) <security@centos.org>"
 Fingerprint: 6341 ab27 53d7 8a78 a7c2 7bb1 24c6 a8a7 f4a8 0eb5
 Package    : centos-release-7-0.1406.el7.centos.2.5.x86_64 (@installupdates)
 From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : apr-1.4.8-3.el7.x86_64                                       1/5 
  Installing : apr-util-1.5.2-6.el7.x86_64                                  2/5 
  Installing : httpd-tools-2.4.6-18.el7.centos.x86_64                       3/5 
  Installing : mailcap-2.1.41-2.el7.noarch                                  4/5 
  Installing : httpd-2.4.6-18.el7.centos.x86_64                             5/5 
  Verifying  : mailcap-2.1.41-2.el7.noarch                                  1/5 
  Verifying  : httpd-tools-2.4.6-18.el7.centos.x86_64                       2/5 
  Verifying  : apr-util-1.5.2-6.el7.x86_64                                  3/5 
  Verifying  : apr-1.4.8-3.el7.x86_64                                       4/5 
  Verifying  : httpd-2.4.6-18.el7.centos.x86_64                             5/5 

Installed:
  httpd.x86_64 0:2.4.6-18.el7.centos                                            

Dependency Installed:
  apr.x86_64 0:1.4.8-3.el7                     apr-util.x86_64 0:1.5.2-6.el7    
  httpd-tools.x86_64 0:2.4.6-18.el7.centos     mailcap.noarch 0:2.1.41-2.el7    

Complete!

Mit nachfolgendem Befehl kann überprüft werden, welche Inhalte mit den Paket httpd installiert wurden.

# rpm -qil httpd
Name        : httpd
Version     : 2.4.6
Release     : 18.el7.centos
Architecture: x86_64
Install Date: Fri 21 Nov 2014 09:03:44 AM CET
Group       : System Environment/Daemons
Size        : 9793373
License     : ASL 2.0
Signature   : RSA/SHA256, Wed 23 Jul 2014 05:21:22 PM CEST, Key ID 24c6a8a7f4a80eb5
Source RPM  : httpd-2.4.6-18.el7.centos.src.rpm
Build Date  : Wed 23 Jul 2014 04:49:10 PM CEST
Build Host  : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager    : CentOS BuildSystem <http://bugs.centos.org>
Vendor      : CentOS
URL         : http://httpd.apache.org/
Summary     : Apache HTTP Server
Description :
The Apache HTTP Server is a powerful, efficient, and extensible
web server.
/etc/httpd
/etc/httpd/conf
/etc/httpd/conf.d
/etc/httpd/conf.d/README
/etc/httpd/conf.d/autoindex.conf
/etc/httpd/conf.d/userdir.conf
/etc/httpd/conf.d/welcome.conf
/etc/httpd/conf.modules.d
/etc/httpd/conf.modules.d/00-base.conf
/etc/httpd/conf.modules.d/00-dav.conf
/etc/httpd/conf.modules.d/00-lua.conf
/etc/httpd/conf.modules.d/00-mpm.conf
/etc/httpd/conf.modules.d/00-proxy.conf
/etc/httpd/conf.modules.d/00-systemd.conf
/etc/httpd/conf.modules.d/01-cgi.conf
/etc/httpd/conf/httpd.conf
/etc/httpd/conf/magic
/etc/httpd/logs
/etc/httpd/modules
/etc/httpd/run
/etc/logrotate.d/httpd
/etc/sysconfig/htcacheclean
/etc/sysconfig/httpd
/run/httpd
/run/httpd/htcacheclean
/usr/lib/systemd/system/htcacheclean.service
/usr/lib/systemd/system/httpd.service
/usr/lib/tmpfiles.d/httpd.conf
/usr/lib64/httpd
/usr/lib64/httpd/modules
/usr/lib64/httpd/modules/mod_access_compat.so
/usr/lib64/httpd/modules/mod_actions.so
/usr/lib64/httpd/modules/mod_alias.so
/usr/lib64/httpd/modules/mod_allowmethods.so
/usr/lib64/httpd/modules/mod_asis.so
/usr/lib64/httpd/modules/mod_auth_basic.so
/usr/lib64/httpd/modules/mod_auth_digest.so
/usr/lib64/httpd/modules/mod_authn_anon.so
/usr/lib64/httpd/modules/mod_authn_core.so
/usr/lib64/httpd/modules/mod_authn_dbd.so
/usr/lib64/httpd/modules/mod_authn_dbm.so
/usr/lib64/httpd/modules/mod_authn_file.so
/usr/lib64/httpd/modules/mod_authn_socache.so
/usr/lib64/httpd/modules/mod_authz_core.so
/usr/lib64/httpd/modules/mod_authz_dbd.so
/usr/lib64/httpd/modules/mod_authz_dbm.so
/usr/lib64/httpd/modules/mod_authz_groupfile.so
/usr/lib64/httpd/modules/mod_authz_host.so
/usr/lib64/httpd/modules/mod_authz_owner.so
/usr/lib64/httpd/modules/mod_authz_user.so
/usr/lib64/httpd/modules/mod_autoindex.so
/usr/lib64/httpd/modules/mod_buffer.so
/usr/lib64/httpd/modules/mod_cache.so
/usr/lib64/httpd/modules/mod_cache_disk.so
/usr/lib64/httpd/modules/mod_cache_socache.so
/usr/lib64/httpd/modules/mod_cgi.so
/usr/lib64/httpd/modules/mod_cgid.so
/usr/lib64/httpd/modules/mod_charset_lite.so
/usr/lib64/httpd/modules/mod_data.so
/usr/lib64/httpd/modules/mod_dav.so
/usr/lib64/httpd/modules/mod_dav_fs.so
/usr/lib64/httpd/modules/mod_dav_lock.so
/usr/lib64/httpd/modules/mod_dbd.so
/usr/lib64/httpd/modules/mod_deflate.so
/usr/lib64/httpd/modules/mod_dialup.so
/usr/lib64/httpd/modules/mod_dir.so
/usr/lib64/httpd/modules/mod_dumpio.so
/usr/lib64/httpd/modules/mod_echo.so
/usr/lib64/httpd/modules/mod_env.so
/usr/lib64/httpd/modules/mod_expires.so
/usr/lib64/httpd/modules/mod_ext_filter.so
/usr/lib64/httpd/modules/mod_file_cache.so
/usr/lib64/httpd/modules/mod_filter.so
/usr/lib64/httpd/modules/mod_headers.so
/usr/lib64/httpd/modules/mod_heartbeat.so
/usr/lib64/httpd/modules/mod_heartmonitor.so
/usr/lib64/httpd/modules/mod_include.so
/usr/lib64/httpd/modules/mod_info.so
/usr/lib64/httpd/modules/mod_lbmethod_bybusyness.so
/usr/lib64/httpd/modules/mod_lbmethod_byrequests.so
/usr/lib64/httpd/modules/mod_lbmethod_bytraffic.so
/usr/lib64/httpd/modules/mod_lbmethod_heartbeat.so
/usr/lib64/httpd/modules/mod_log_config.so
/usr/lib64/httpd/modules/mod_log_debug.so
/usr/lib64/httpd/modules/mod_log_forensic.so
/usr/lib64/httpd/modules/mod_logio.so
/usr/lib64/httpd/modules/mod_lua.so
/usr/lib64/httpd/modules/mod_macro.so
/usr/lib64/httpd/modules/mod_mime.so
/usr/lib64/httpd/modules/mod_mime_magic.so
/usr/lib64/httpd/modules/mod_mpm_event.so
/usr/lib64/httpd/modules/mod_mpm_prefork.so
/usr/lib64/httpd/modules/mod_mpm_worker.so
/usr/lib64/httpd/modules/mod_negotiation.so
/usr/lib64/httpd/modules/mod_proxy.so
/usr/lib64/httpd/modules/mod_proxy_ajp.so
/usr/lib64/httpd/modules/mod_proxy_balancer.so
/usr/lib64/httpd/modules/mod_proxy_connect.so
/usr/lib64/httpd/modules/mod_proxy_express.so
/usr/lib64/httpd/modules/mod_proxy_fcgi.so
/usr/lib64/httpd/modules/mod_proxy_fdpass.so
/usr/lib64/httpd/modules/mod_proxy_ftp.so
/usr/lib64/httpd/modules/mod_proxy_http.so
/usr/lib64/httpd/modules/mod_proxy_scgi.so
/usr/lib64/httpd/modules/mod_proxy_wstunnel.so
/usr/lib64/httpd/modules/mod_ratelimit.so
/usr/lib64/httpd/modules/mod_reflector.so
/usr/lib64/httpd/modules/mod_remoteip.so
/usr/lib64/httpd/modules/mod_reqtimeout.so
/usr/lib64/httpd/modules/mod_request.so
/usr/lib64/httpd/modules/mod_rewrite.so
/usr/lib64/httpd/modules/mod_sed.so
/usr/lib64/httpd/modules/mod_setenvif.so
/usr/lib64/httpd/modules/mod_slotmem_plain.so
/usr/lib64/httpd/modules/mod_slotmem_shm.so
/usr/lib64/httpd/modules/mod_socache_dbm.so
/usr/lib64/httpd/modules/mod_socache_memcache.so
/usr/lib64/httpd/modules/mod_socache_shmcb.so
/usr/lib64/httpd/modules/mod_speling.so
/usr/lib64/httpd/modules/mod_status.so
/usr/lib64/httpd/modules/mod_substitute.so
/usr/lib64/httpd/modules/mod_suexec.so
/usr/lib64/httpd/modules/mod_systemd.so
/usr/lib64/httpd/modules/mod_unique_id.so
/usr/lib64/httpd/modules/mod_unixd.so
/usr/lib64/httpd/modules/mod_userdir.so
/usr/lib64/httpd/modules/mod_usertrack.so
/usr/lib64/httpd/modules/mod_version.so
/usr/lib64/httpd/modules/mod_vhost_alias.so
/usr/lib64/httpd/modules/mod_watchdog.so
/usr/libexec/initscripts/legacy-actions/httpd
/usr/libexec/initscripts/legacy-actions/httpd/configtest
/usr/libexec/initscripts/legacy-actions/httpd/graceful
/usr/sbin/apachectl
/usr/sbin/fcgistarter
/usr/sbin/htcacheclean
/usr/sbin/httpd
/usr/sbin/rotatelogs
/usr/sbin/suexec
/usr/share/doc/httpd-2.4.6
/usr/share/doc/httpd-2.4.6/ABOUT_APACHE
/usr/share/doc/httpd-2.4.6/CHANGES
/usr/share/doc/httpd-2.4.6/LICENSE
/usr/share/doc/httpd-2.4.6/NOTICE
/usr/share/doc/httpd-2.4.6/README
/usr/share/doc/httpd-2.4.6/VERSIONING
/usr/share/doc/httpd-2.4.6/httpd-dav.conf
/usr/share/doc/httpd-2.4.6/httpd-default.conf
/usr/share/doc/httpd-2.4.6/httpd-info.conf
/usr/share/doc/httpd-2.4.6/httpd-languages.conf
/usr/share/doc/httpd-2.4.6/httpd-manual.conf
/usr/share/doc/httpd-2.4.6/httpd-mpm.conf
/usr/share/doc/httpd-2.4.6/httpd-multilang-errordoc.conf
/usr/share/doc/httpd-2.4.6/httpd-vhosts.conf
/usr/share/doc/httpd-2.4.6/proxy-html.conf
/usr/share/httpd
/usr/share/httpd/error
/usr/share/httpd/error/HTTP_BAD_GATEWAY.html.var
/usr/share/httpd/error/HTTP_BAD_REQUEST.html.var
/usr/share/httpd/error/HTTP_FORBIDDEN.html.var
/usr/share/httpd/error/HTTP_GONE.html.var
/usr/share/httpd/error/HTTP_INTERNAL_SERVER_ERROR.html.var
/usr/share/httpd/error/HTTP_LENGTH_REQUIRED.html.var
/usr/share/httpd/error/HTTP_METHOD_NOT_ALLOWED.html.var
/usr/share/httpd/error/HTTP_NOT_FOUND.html.var
/usr/share/httpd/error/HTTP_NOT_IMPLEMENTED.html.var
/usr/share/httpd/error/HTTP_PRECONDITION_FAILED.html.var
/usr/share/httpd/error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
/usr/share/httpd/error/HTTP_REQUEST_TIME_OUT.html.var
/usr/share/httpd/error/HTTP_REQUEST_URI_TOO_LARGE.html.var
/usr/share/httpd/error/HTTP_SERVICE_UNAVAILABLE.html.var
/usr/share/httpd/error/HTTP_UNAUTHORIZED.html.var
/usr/share/httpd/error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
/usr/share/httpd/error/HTTP_VARIANT_ALSO_VARIES.html.var
/usr/share/httpd/error/README
/usr/share/httpd/error/contact.html.var
/usr/share/httpd/error/include
/usr/share/httpd/error/include/bottom.html
/usr/share/httpd/error/include/spacer.html
/usr/share/httpd/error/include/top.html
/usr/share/httpd/icons
/usr/share/httpd/icons/README
/usr/share/httpd/icons/README.html
/usr/share/httpd/icons/a.gif
/usr/share/httpd/icons/a.png
/usr/share/httpd/icons/alert.black.gif
/usr/share/httpd/icons/alert.black.png
/usr/share/httpd/icons/alert.red.gif
/usr/share/httpd/icons/alert.red.png
/usr/share/httpd/icons/apache_pb.gif
/usr/share/httpd/icons/apache_pb.png
/usr/share/httpd/icons/apache_pb.svg
/usr/share/httpd/icons/apache_pb2.gif
/usr/share/httpd/icons/apache_pb2.png
/usr/share/httpd/icons/back.gif
/usr/share/httpd/icons/back.png
/usr/share/httpd/icons/ball.gray.gif
/usr/share/httpd/icons/ball.gray.png
/usr/share/httpd/icons/ball.red.gif
/usr/share/httpd/icons/ball.red.png
/usr/share/httpd/icons/binary.gif
/usr/share/httpd/icons/binary.png
/usr/share/httpd/icons/binhex.gif
/usr/share/httpd/icons/binhex.png
/usr/share/httpd/icons/blank.gif
/usr/share/httpd/icons/blank.png
/usr/share/httpd/icons/bomb.gif
/usr/share/httpd/icons/bomb.png
/usr/share/httpd/icons/box1.gif
/usr/share/httpd/icons/box1.png
/usr/share/httpd/icons/box2.gif
/usr/share/httpd/icons/box2.png
/usr/share/httpd/icons/broken.gif
/usr/share/httpd/icons/broken.png
/usr/share/httpd/icons/burst.gif
/usr/share/httpd/icons/burst.png
/usr/share/httpd/icons/c.gif
/usr/share/httpd/icons/c.png
/usr/share/httpd/icons/comp.blue.gif
/usr/share/httpd/icons/comp.blue.png
/usr/share/httpd/icons/comp.gray.gif
/usr/share/httpd/icons/comp.gray.png
/usr/share/httpd/icons/compressed.gif
/usr/share/httpd/icons/compressed.png
/usr/share/httpd/icons/continued.gif
/usr/share/httpd/icons/continued.png
/usr/share/httpd/icons/dir.gif
/usr/share/httpd/icons/dir.png
/usr/share/httpd/icons/diskimg.gif
/usr/share/httpd/icons/diskimg.png
/usr/share/httpd/icons/down.gif
/usr/share/httpd/icons/down.png
/usr/share/httpd/icons/dvi.gif
/usr/share/httpd/icons/dvi.png
/usr/share/httpd/icons/f.gif
/usr/share/httpd/icons/f.png
/usr/share/httpd/icons/folder.gif
/usr/share/httpd/icons/folder.open.gif
/usr/share/httpd/icons/folder.open.png
/usr/share/httpd/icons/folder.png
/usr/share/httpd/icons/folder.sec.gif
/usr/share/httpd/icons/folder.sec.png
/usr/share/httpd/icons/forward.gif
/usr/share/httpd/icons/forward.png
/usr/share/httpd/icons/generic.gif
/usr/share/httpd/icons/generic.png
/usr/share/httpd/icons/generic.red.gif
/usr/share/httpd/icons/generic.red.png
/usr/share/httpd/icons/generic.sec.gif
/usr/share/httpd/icons/generic.sec.png
/usr/share/httpd/icons/hand.right.gif
/usr/share/httpd/icons/hand.right.png
/usr/share/httpd/icons/hand.up.gif
/usr/share/httpd/icons/hand.up.png
/usr/share/httpd/icons/icon.sheet.gif
/usr/share/httpd/icons/icon.sheet.png
/usr/share/httpd/icons/image1.gif
/usr/share/httpd/icons/image1.png
/usr/share/httpd/icons/image2.gif
/usr/share/httpd/icons/image2.png
/usr/share/httpd/icons/image3.gif
/usr/share/httpd/icons/image3.png
/usr/share/httpd/icons/index.gif
/usr/share/httpd/icons/index.png
/usr/share/httpd/icons/layout.gif
/usr/share/httpd/icons/layout.png
/usr/share/httpd/icons/left.gif
/usr/share/httpd/icons/left.png
/usr/share/httpd/icons/link.gif
/usr/share/httpd/icons/link.png
/usr/share/httpd/icons/movie.gif
/usr/share/httpd/icons/movie.png
/usr/share/httpd/icons/odf6odb.png
/usr/share/httpd/icons/odf6odc.png
/usr/share/httpd/icons/odf6odf.png
/usr/share/httpd/icons/odf6odg.png
/usr/share/httpd/icons/odf6odi.png
/usr/share/httpd/icons/odf6odm.png
/usr/share/httpd/icons/odf6odp.png
/usr/share/httpd/icons/odf6ods.png
/usr/share/httpd/icons/odf6odt.png
/usr/share/httpd/icons/odf6otc.png
/usr/share/httpd/icons/odf6otf.png
/usr/share/httpd/icons/odf6otg.png
/usr/share/httpd/icons/odf6oth.png
/usr/share/httpd/icons/odf6oti.png
/usr/share/httpd/icons/odf6otp.png
/usr/share/httpd/icons/odf6ots.png
/usr/share/httpd/icons/odf6ott.png
/usr/share/httpd/icons/p.gif
/usr/share/httpd/icons/p.png
/usr/share/httpd/icons/patch.gif
/usr/share/httpd/icons/patch.png
/usr/share/httpd/icons/pdf.gif
/usr/share/httpd/icons/pdf.png
/usr/share/httpd/icons/pie0.gif
/usr/share/httpd/icons/pie0.png
/usr/share/httpd/icons/pie1.gif
/usr/share/httpd/icons/pie1.png
/usr/share/httpd/icons/pie2.gif
/usr/share/httpd/icons/pie2.png
/usr/share/httpd/icons/pie3.gif
/usr/share/httpd/icons/pie3.png
/usr/share/httpd/icons/pie4.gif
/usr/share/httpd/icons/pie4.png
/usr/share/httpd/icons/pie5.gif
/usr/share/httpd/icons/pie5.png
/usr/share/httpd/icons/pie6.gif
/usr/share/httpd/icons/pie6.png
/usr/share/httpd/icons/pie7.gif
/usr/share/httpd/icons/pie7.png
/usr/share/httpd/icons/pie8.gif
/usr/share/httpd/icons/pie8.png
/usr/share/httpd/icons/portal.gif
/usr/share/httpd/icons/portal.png
/usr/share/httpd/icons/poweredby.png
/usr/share/httpd/icons/ps.gif
/usr/share/httpd/icons/ps.png
/usr/share/httpd/icons/quill.gif
/usr/share/httpd/icons/quill.png
/usr/share/httpd/icons/right.gif
/usr/share/httpd/icons/right.png
/usr/share/httpd/icons/screw1.gif
/usr/share/httpd/icons/screw1.png
/usr/share/httpd/icons/screw2.gif
/usr/share/httpd/icons/screw2.png
/usr/share/httpd/icons/script.gif
/usr/share/httpd/icons/script.png
/usr/share/httpd/icons/small
/usr/share/httpd/icons/small/back.gif
/usr/share/httpd/icons/small/back.png
/usr/share/httpd/icons/small/binary.gif
/usr/share/httpd/icons/small/binary.png
/usr/share/httpd/icons/small/binhex.gif
/usr/share/httpd/icons/small/binhex.png
/usr/share/httpd/icons/small/blank.gif
/usr/share/httpd/icons/small/blank.png
/usr/share/httpd/icons/small/broken.gif
/usr/share/httpd/icons/small/broken.png
/usr/share/httpd/icons/small/burst.gif
/usr/share/httpd/icons/small/burst.png
/usr/share/httpd/icons/small/comp1.gif
/usr/share/httpd/icons/small/comp1.png
/usr/share/httpd/icons/small/comp2.gif
/usr/share/httpd/icons/small/comp2.png
/usr/share/httpd/icons/small/compressed.gif
/usr/share/httpd/icons/small/compressed.png
/usr/share/httpd/icons/small/continued.gif
/usr/share/httpd/icons/small/continued.png
/usr/share/httpd/icons/small/doc.gif
/usr/share/httpd/icons/small/doc.png
/usr/share/httpd/icons/small/folder.gif
/usr/share/httpd/icons/small/folder.png
/usr/share/httpd/icons/small/folder2.gif
/usr/share/httpd/icons/small/folder2.png
/usr/share/httpd/icons/small/forward.gif
/usr/share/httpd/icons/small/forward.png
/usr/share/httpd/icons/small/generic.gif
/usr/share/httpd/icons/small/generic.png
/usr/share/httpd/icons/small/generic2.gif
/usr/share/httpd/icons/small/generic2.png
/usr/share/httpd/icons/small/generic3.gif
/usr/share/httpd/icons/small/generic3.png
/usr/share/httpd/icons/small/image.gif
/usr/share/httpd/icons/small/image.png
/usr/share/httpd/icons/small/image2.gif
/usr/share/httpd/icons/small/image2.png
/usr/share/httpd/icons/small/index.gif
/usr/share/httpd/icons/small/index.png
/usr/share/httpd/icons/small/key.gif
/usr/share/httpd/icons/small/key.png
/usr/share/httpd/icons/small/movie.gif
/usr/share/httpd/icons/small/movie.png
/usr/share/httpd/icons/small/patch.gif
/usr/share/httpd/icons/small/patch.png
/usr/share/httpd/icons/small/ps.gif
/usr/share/httpd/icons/small/ps.png
/usr/share/httpd/icons/small/rainbow.gif
/usr/share/httpd/icons/small/rainbow.png
/usr/share/httpd/icons/small/sound.gif
/usr/share/httpd/icons/small/sound.png
/usr/share/httpd/icons/small/sound2.gif
/usr/share/httpd/icons/small/sound2.png
/usr/share/httpd/icons/small/tar.gif
/usr/share/httpd/icons/small/tar.png
/usr/share/httpd/icons/small/text.gif
/usr/share/httpd/icons/small/text.png
/usr/share/httpd/icons/small/transfer.gif
/usr/share/httpd/icons/small/transfer.png
/usr/share/httpd/icons/small/unknown.gif
/usr/share/httpd/icons/small/unknown.png
/usr/share/httpd/icons/small/uu.gif
/usr/share/httpd/icons/small/uu.png
/usr/share/httpd/icons/sound1.gif
/usr/share/httpd/icons/sound1.png
/usr/share/httpd/icons/sound2.gif
/usr/share/httpd/icons/sound2.png
/usr/share/httpd/icons/sphere1.gif
/usr/share/httpd/icons/sphere1.png
/usr/share/httpd/icons/sphere2.gif
/usr/share/httpd/icons/sphere2.png
/usr/share/httpd/icons/svg.png
/usr/share/httpd/icons/tar.gif
/usr/share/httpd/icons/tar.png
/usr/share/httpd/icons/tex.gif
/usr/share/httpd/icons/tex.png
/usr/share/httpd/icons/text.gif
/usr/share/httpd/icons/text.png
/usr/share/httpd/icons/transfer.gif
/usr/share/httpd/icons/transfer.png
/usr/share/httpd/icons/unknown.gif
/usr/share/httpd/icons/unknown.png
/usr/share/httpd/icons/up.gif
/usr/share/httpd/icons/up.png
/usr/share/httpd/icons/uu.gif
/usr/share/httpd/icons/uu.png
/usr/share/httpd/icons/uuencoded.gif
/usr/share/httpd/icons/uuencoded.png
/usr/share/httpd/icons/world1.gif
/usr/share/httpd/icons/world1.png
/usr/share/httpd/icons/world2.gif
/usr/share/httpd/icons/world2.png
/usr/share/httpd/icons/xml.png
/usr/share/httpd/noindex
/usr/share/httpd/noindex/css
/usr/share/httpd/noindex/css/bootstrap-theme.min.css
/usr/share/httpd/noindex/css/bootstrap.min.css
/usr/share/httpd/noindex/css/fonts
/usr/share/httpd/noindex/css/fonts/Bold
/usr/share/httpd/noindex/css/fonts/Bold/OpenSans-Bold.eot
/usr/share/httpd/noindex/css/fonts/Bold/OpenSans-Bold.svg
/usr/share/httpd/noindex/css/fonts/Bold/OpenSans-Bold.ttf
/usr/share/httpd/noindex/css/fonts/Bold/OpenSans-Bold.woff
/usr/share/httpd/noindex/css/fonts/BoldItalic
/usr/share/httpd/noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.eot
/usr/share/httpd/noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.svg
/usr/share/httpd/noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.ttf
/usr/share/httpd/noindex/css/fonts/BoldItalic/OpenSans-BoldItalic.woff
/usr/share/httpd/noindex/css/fonts/ExtraBold
/usr/share/httpd/noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.eot
/usr/share/httpd/noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.svg
/usr/share/httpd/noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.ttf
/usr/share/httpd/noindex/css/fonts/ExtraBold/OpenSans-ExtraBold.woff
/usr/share/httpd/noindex/css/fonts/ExtraBoldItalic
/usr/share/httpd/noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.eot
/usr/share/httpd/noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.svg
/usr/share/httpd/noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.ttf
/usr/share/httpd/noindex/css/fonts/ExtraBoldItalic/OpenSans-ExtraBoldItalic.woff
/usr/share/httpd/noindex/css/fonts/Italic
/usr/share/httpd/noindex/css/fonts/Italic/OpenSans-Italic.eot
/usr/share/httpd/noindex/css/fonts/Italic/OpenSans-Italic.svg
/usr/share/httpd/noindex/css/fonts/Italic/OpenSans-Italic.ttf
/usr/share/httpd/noindex/css/fonts/Italic/OpenSans-Italic.woff
/usr/share/httpd/noindex/css/fonts/Light
/usr/share/httpd/noindex/css/fonts/Light/OpenSans-Light.eot
/usr/share/httpd/noindex/css/fonts/Light/OpenSans-Light.svg
/usr/share/httpd/noindex/css/fonts/Light/OpenSans-Light.ttf
/usr/share/httpd/noindex/css/fonts/Light/OpenSans-Light.woff
/usr/share/httpd/noindex/css/fonts/LightItalic
/usr/share/httpd/noindex/css/fonts/LightItalic/OpenSans-LightItalic.eot
/usr/share/httpd/noindex/css/fonts/LightItalic/OpenSans-LightItalic.svg
/usr/share/httpd/noindex/css/fonts/LightItalic/OpenSans-LightItalic.ttf
/usr/share/httpd/noindex/css/fonts/LightItalic/OpenSans-LightItalic.woff
/usr/share/httpd/noindex/css/fonts/Regular
/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.eot
/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.svg
/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.ttf
/usr/share/httpd/noindex/css/fonts/Regular/OpenSans-Regular.woff
/usr/share/httpd/noindex/css/fonts/Semibold
/usr/share/httpd/noindex/css/fonts/Semibold/OpenSans-Semibold.eot
/usr/share/httpd/noindex/css/fonts/Semibold/OpenSans-Semibold.svg
/usr/share/httpd/noindex/css/fonts/Semibold/OpenSans-Semibold.ttf
/usr/share/httpd/noindex/css/fonts/Semibold/OpenSans-Semibold.woff
/usr/share/httpd/noindex/css/fonts/SemiboldItalic
/usr/share/httpd/noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.eot
/usr/share/httpd/noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.svg
/usr/share/httpd/noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.ttf
/usr/share/httpd/noindex/css/fonts/SemiboldItalic/OpenSans-SemiboldItalic.woff
/usr/share/httpd/noindex/css/open-sans.css
/usr/share/httpd/noindex/images
/usr/share/httpd/noindex/images/apache_pb.gif
/usr/share/httpd/noindex/images/poweredby.png
/usr/share/httpd/noindex/index.html
/usr/share/man/man8/apachectl.8.gz
/usr/share/man/man8/fcgistarter.8.gz
/usr/share/man/man8/htcacheclean.8.gz
/usr/share/man/man8/httpd.8.gz
/usr/share/man/man8/rotatelogs.8.gz
/usr/share/man/man8/suexec.8.gz
/var/cache/httpd
/var/cache/httpd/proxy
/var/lib/dav
/var/log/httpd
/var/www
/var/www/cgi-bin
/var/www/html

Dienst/Deamon-Start einrichten

Um einen Apache HTTP Server, welcher als Dienst/Deamon 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
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'

Eine Überprüfung, ob beim Neustart des Server der httpd-Dienst/Deamon 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

bzw.

# systemctl is-enabled httpd.service
enabled

:!: HINWEIS - Falls der Apache HTTP Server mit der Fehlermeldung

... httpd: (99)Cannot assign requested address: AH00072: make_sock: could not bind to address ...

beim automatischen Systemstart, NICHT starten sollte, dann kann dies ggf. mit der Anpassung des Service httpd.service wie nachfolgend dargestellt, behoben werden.

Zuerst sollte die Konfiguration des httpd.service mit nachfolgendem Befehl kopiert werden, da sonst die Konfigurationen bei einem System-Update überschrieben werden würden:

# cp -a /usr/lib/systemd/system/httpd.service /etc/systemd/system/httpd.service

Anschließend kann der Inhalt der Konfigurationsdatei

  • /etc/systemd/system/httpd.service

wie nachfolgend dargestellt angepasst werden:

[Unit]
Description=The Apache HTTP Server
After=network.target network-online.target remote-fs.target nss-lookup.target
Documentation=man:httpd(8)
Documentation=man:apachectl(8)

[Service]
Type=notify
EnvironmentFile=/etc/sysconfig/httpd
ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND
ExecReload=/usr/sbin/httpd $OPTIONS -k graceful
ExecStop=/bin/kill -WINCH ${MAINPID}
# We want systemd to give httpd some time to finish gracefully, but still want
# it to kill httpd after TimeoutStopSec if something went wrong during the
# graceful stop. Normally, Systemd sends SIGTERM signal right after the
# ExecStop, which would kill httpd. We are sending useless SIGCONT here to give
# httpd time to finish.
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target

Anpassung:

  • After=network.target network-online.target remote-fs.target nss-lookup.target

Ergänzung der Zeile um network-online.target an der entsprechende Stelle!

Abschließend müssen die Änderungen noch aktiviert werden, wozu nachfolgender Befehl genutzt werden kann:

# systemctl daemon-reload

iptables Regel

Damit der Apache HTTP Server auch erreichbar ist und nicht die Web-Anfragen vom Paketfilter iptables blockiert werden, muss nachfolgende Regel 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 ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out   source       destination         
1     1562 1266K ACCEPT     all  --  *      *     0.0.0.0/0    0.0.0.0/0      state 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      state NEW tcp dpt:22 
5       39  1248 REJECT     all  --  *      *     0.0.0.0/0    0.0.0.0/0      reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out   source       destination         
1        0     0 REJECT     all  --  *      *     0.0.0.0/0    0.0.0.0/0      reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out   source       destination

Nachfolgender Befehl, fügt folgende iptables-Regel dem iptables-Regelwerk nach der Position 5 hinzu, ohne das der Paketfilter angehalten werden muss:

  • -A INPUT -p tcp --dport 80 -j ACCEPT

und hier die Befehle:

# iptables -I INPUT 5 -p tcp --dport 80 -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 ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out   source       destination         
1       70  5752 ACCEPT     all  --  *      *     0.0.0.0/0    0.0.0.0/0      state 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        0     0 ACCEPT     tcp  --  *      *     0.0.0.0/0    0.0.0.0/0      state NEW tcp dpt:22 
5        0     0 ACCEPT     tcp  --  *      *     0.0.0.0/0    0.0.0.0/0      tcp dpt:80 
6        0     0 REJECT     all  --  *      *     0.0.0.0/0    0.0.0.0/0      reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out   source       destination         
1        0     0 REJECT     all  --  *      *     0.0.0.0/0    0.0.0.0/0      reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out   source       destination

Die neue Zeile ist an Position 5 (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
...

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 

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:

  • Alle Anfragen kommen auf dem Server 192.168.0.1 auf Port 80 an
  • Alle Anfragen sollen auf den Server 192.168.0.90 auf Port 80 - weitergeleitet werden!

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:

  • nat

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 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         
1        0     0 MASQUERADE  all  --  *      eth0  0.0.0.0/0    0.0.0.0/0           

Chain OUTPUT (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 !!!

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 POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
num   pkts bytes target     prot opt in     out   source       destination         
1        0     0 MASQUERADE  all  --  *      eth0  0.0.0.0/0    0.0.0.0/0           

Chain OUTPUT (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 

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 - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
   Active: active (running) since Fri 2014-11-21 10:26:51 CET; 4s ago
  Process: 10513 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
 Main PID: 10525 (httpd)
   Status: "Processing requests..."
   CGroup: /system.slice/httpd.service
           ├─10525 /usr/sbin/httpd -DFOREGROUND
           ├─10526 /usr/sbin/httpd -DFOREGROUND
           ├─10527 /usr/sbin/httpd -DFOREGROUND
           ├─10528 /usr/sbin/httpd -DFOREGROUND
           ├─10529 /usr/sbin/httpd -DFOREGROUND
           └─10530 /usr/sbin/httpd -DFOREGROUND

Nov 21 10:26:51 vml70090.idmz.tachtler.net systemd[1]: Started The Apache HTT...
Hint: Some lines were ellipsized, use -l to show in full.

bzw.

# ps auxwf | grep httpd
root     10538  0.0  0.0 112640   924 pts/0    S+   10:27   0:00                      \_ grep --color=auto httpd
root     10525  0.0  0.1 213700  4776 ?        Ss   10:26   0:00 /usr/sbin/httpd -DFOREGROUND
apache   10526  0.0  0.0 213700  2868 ?        S    10:26   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache   10527  0.0  0.0 213700  2868 ?        S    10:26   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache   10528  0.0  0.0 213700  2868 ?        S    10:26   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache   10529  0.0  0.0 213700  2868 ?        S    10:26   0:00  \_ /usr/sbin/httpd -DFOREGROUND
apache   10530  0.0  0.0 213700  2868 ?        S    10:26   0:00  \_ /usr/sbin/httpd -DFOREGROUND

Eine weitere Überprüfung, ob der erste Start erfolgreich war, kann durch Einsicht der LOG-Dateien

  • /var/log/httpd/error_log

durchgeführt werden.

Ausgabe der LOG-Datei /var/log/httpd/error mit nachfolgendem Befehl, die Ausgabe sollte wie nachfolgend dargestellt aussehen:

# cat /var/log/httpd/error_log
[Fri Nov 21 10:26:51.978953 2014] [suexec:notice] [pid 10525] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Fri Nov 21 10:26:51.995381 2014] [auth_digest:notice] [pid 10525] AH01757: generating secret for digest authentication ...
[Fri Nov 21 10:26:51.997618 2014] [lbmethod_heartbeat:notice] [pid 10525] AH02282: No slotmem from mod_heartmonitor
[Fri Nov 21 10:26:52.004882 2014] [mpm_prefork:notice] [pid 10525] AH00163: Apache/2.4.6 (CentOS) configured -- resuming normal operations
[Fri Nov 21 10:26:52.004970 2014] [core:notice] [pid 10525] AH00094: Command line: '/usr/sbin/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:

# netstat -tulpen | grep httpd
tcp        0      0 0.0.0.0:80            0.0.0.0:*       LISTEN      0     28588      10525/httpd

Erster Browser-Aufruf

Wenn der Start des Apache HTTP Server erfolgreich durchgeführt wurde, kann die Abfrage mittels eines Browsers erfolgen, wie im nachfolgenden Bild dargestellt:

 CentOS-7 Apache HTTP Server Test Page Powered by CentOS - Mozialla Firefox

Basis-Konfiguration

Nachdem der Apache HTTP Server erfolgreich gestartet werden konnte, sollte nun eine erste Basis-Konfiguration durchgeführt werden.

Nachfolgende Verzeichnisse und Dateien beinhalten die dazu grundlegenden Konfigurationsdateien und können mit nachfolgendem Befehl wie folgt aufgelistete werden:

# ls -l /etc/httpd/*
lrwxrwxrwx 1 root root  19 Nov 21 09:03 /etc/httpd/logs -> ../../var/log/httpd
lrwxrwxrwx 1 root root  29 Nov 21 09:03 /etc/httpd/modules -> ../../usr/lib64/httpd/modules
lrwxrwxrwx 1 root root  10 Nov 21 09:03 /etc/httpd/run -> /run/httpd

/etc/httpd/conf:
total 32
-rw-r--r-- 1 root root 11753 Jul 23 16:21 httpd.conf
-rw-r--r-- 1 root root 13077 Jul 23 16:48 magic

/etc/httpd/conf.d:
total 16
-rw-r--r-- 1 root root 2893 Jul 23 16:47 autoindex.conf
-rw-r--r-- 1 root root  366 Jul 23 16:48 README
-rw-r--r-- 1 root root 1252 Jul 23 16:21 userdir.conf
-rw-r--r-- 1 root root  808 Jul 23 16:31 welcome.conf

/etc/httpd/conf.modules.d:
total 28
-rw-r--r-- 1 root root 3739 Jul 23 16:21 00-base.conf
-rw-r--r-- 1 root root  139 Jul 23 16:21 00-dav.conf
-rw-r--r-- 1 root root   41 Jul 23 16:21 00-lua.conf
-rw-r--r-- 1 root root  742 Jul 23 16:21 00-mpm.conf
-rw-r--r-- 1 root root  894 Jul 23 16:21 00-proxy.conf
-rw-r--r-- 1 root root   88 Jul 23 16:21 00-systemd.conf
-rw-r--r-- 1 root root  451 Jul 23 16:21 01-cgi.conf

/etc/httpd/conf/httpd.conf

Nachfolgend soll die Hauptkonfigurationsdatei - /etc/httpd/conf/httpd.conf entsprechend angepasst werden.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# 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 'log/access_log'
# with ServerRoot set to '/www' will be interpreted by the
# server as '/www/log/access_log', where as '/log/access_log' will be
# interpreted as '/log/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"
 
#
# 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
# Tachtler
# default: Listen 80
Listen 192.168.0.90:80
Listen 192.168.1.90: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
#
Include conf.modules.d/*.conf
 
#
# 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 apache
Group apache
 
# '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 root@localhost
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 apache090.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 "/var/www/html"
 
#
# Relax access to content within /var/www.
#
<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>
 
# Further relax access to the default document root:
<Directory "/var/www/html">
    #
    # 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.
    #
    Options Indexes FollowSymLinks
 
    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options 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.htm index.html
</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 "logs/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
 
    # Tachtler - new -
    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_proxypass
 
    <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>
 
    # Tachtler - new -
    <IfModule deflate_module>
      # You need to enable mod_deflate.c to use instream, outstream and ratio
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %b (%{ratio}n)" combined_deflate
      LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %b (%{ratio}n)" combined_proxypass_deflate
    </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 "logs/access_log" common
 
    #
    # If you prefer a logfile with access, agent, and referer information
    # (Combined Logfile Format) you can use the following directive.
    #
    CustomLog "logs/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/ "/var/www/cgi-bin/"
 
</IfModule>
 
#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Require all granted
</Directory>
 
<IfModule mime_module>
    #
    # TypesConfig points to the file containing the list of mappings from
    # filename extension to MIME-type.
    #
    TypesConfig /etc/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>
 
#
# Specify a default charset for all content served; this enables
# interpretation of all content as UTF-8 by default.  To use the
# default browser choice (ISO-8859-1), or to allow the META tags
# in HTML content to override this choice, comment out this
# directive:
#
AddDefaultCharset UTF-8
 
<IfModule mime_magic_module>
    #
    # 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
</IfModule>
 
#
# 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
#
 
#
# 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 if commented: EnableMMAP On, EnableSendfile Off
#
#EnableMMAP off
EnableSendfile on
 
# Tachtler - new -
# X-Frame-Options, Framebuster - Break out of frame and iframe
Header always append X-Frame-Options SAMEORIGIN
 
# Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf

Erklärungen:

Listen

Setzen der IP-Adressen und des jeweiligen Ports, auf denen der Apache HTTP Server lauschen soll. Eine Mehrfachdefinition ist, wie dargestellt, ebenfalls möglich!

# Tachtler
# default: Listen 80
Listen 192.168.0.90:80
Listen 192.168.1.90:80

ServerAdmin

Setzen einer personalisierten e-Mail-Adresse z.B. zur Anzeige in Fehlerseiten um in Fehlersituationen den entsprechenden Administrator des Servers benachrichtigen zu können:

# Tachtler
# default: ServerAdmin root@localhost
ServerAdmin webmaster@tachtler.net

ServerName

Setzen des Server Namens. Dies erfordert allerdings eine Auflösung des angegebenen Namens via DNS. Falls dies nicht möglich sein sollte, kann hier auch die IP-Adresse des Servers eingetragen werden:

# Tachtler
# default: #ServerName www.example.com:80
ServerName apache090.tachtler.net:80

DirectoryIndex

Festlegen der Dateien, welche vom Apache HTTP Server zur Anzeige gebracht werden sollen, wenn Anfragen gestellt werden (Einstiegsseiten in Web-Anwendungen):

<IfModule dir_module>
    # Tachtler
    # default: DirectoryIndex index.html
    DirectoryIndex index.htm index.html
</IfModule>

Log-Formate

Erstellung von verschiedenen zusätzlichen Log-Formaten für z.B. den Einsatz in virtuellen Hosts unter der Verwendung von:

  • ProxyPass - (mod_proxy_html)
  • Komprimierung (mod_deflate)
    # Tachtler - new -
    LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_proxypass
    # Tachtler - new -
    <IfModule deflate_module>
      # You need to enable mod_deflate.c to use instream, outstream and ratio
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %b (%{ratio}n)" combined_deflate
      %b (%{ratio}n)" combined_ssl_deflate
      LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %b (%{ratio}n)" combined_proxypass_deflate
    </IfModule>

X-Frame-Options

Diese Einstellung weist den Apache HTTP Server an, keine Inhalte in I-Frames auszuliefern, wenn diese nicht als URL mindestens den Domänen Teil des Servernamens als Quelle des I-Frames haben. z.B. test.tachtler.net kann iframe.tachtler.net als I-Frame laden, example.com darf dies nicht:

# Tachtler - new -
# X-Frame-Options, Framebuster - Break out of frame and iframe
Header always append X-Frame-Options SAMEORIGIN

/etc/httpd/conf.d/autoindex.conf

In der Konfigurationsdatei - /etc/httpd/conf.d/autoindex.conf können Konfigurationen zur Anzeige von Verzeichnissen im Apache HTTP Server entsprechend angepasst werden.

:!: HINWEIS - Hier werden aktuell KEINE Anpassungen vorgenommen, jedoch sind jegliche Änderungen oder eben auch keine Änderungen immer individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

(komplette Konfigurationsdatei)

#
# Directives controlling the display of server-generated directory listings.
#
# Required modules: mod_authz_core, mod_authz_host,
#                   mod_autoindex, mod_alias
#
# To see the listing of a directory, the Options directive for the
# directory must include "Indexes", and the directory must not contain
# a file matching those listed in the DirectoryIndex directive.
#
 
#
# IndexOptions: Controls the appearance of server-generated directory
# listings.
#
IndexOptions FancyIndexing HTMLTable VersionSort
 
# We include the /icons/ alias for FancyIndexed directory listings.  If
# you do not use FancyIndexing, you may comment this out.
#
Alias /icons/ "/usr/share/httpd/icons/"
 
<Directory "/usr/share/httpd/icons">
    Options Indexes MultiViews FollowSymlinks
    AllowOverride None
    Require all granted
</Directory>
 
#
# AddIcon* directives tell the server which icon to show for different
# files or filename extensions.  These are only displayed for
# FancyIndexed directories.
#
AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip
 
AddIconByType (TXT,/icons/text.gif) text/*
AddIconByType (IMG,/icons/image2.gif) image/*
AddIconByType (SND,/icons/sound2.gif) audio/*
AddIconByType (VID,/icons/movie.gif) video/*
 
AddIcon /icons/binary.gif .bin .exe
AddIcon /icons/binhex.gif .hqx
AddIcon /icons/tar.gif .tar
AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip
AddIcon /icons/a.gif .ps .ai .eps
AddIcon /icons/layout.gif .html .shtml .htm .pdf
AddIcon /icons/text.gif .txt
AddIcon /icons/c.gif .c
AddIcon /icons/p.gif .pl .py
AddIcon /icons/f.gif .for
AddIcon /icons/dvi.gif .dvi
AddIcon /icons/uuencoded.gif .uu
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl
AddIcon /icons/tex.gif .tex
AddIcon /icons/bomb.gif core.
 
AddIcon /icons/back.gif ..
AddIcon /icons/hand.right.gif README
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/blank.gif ^^BLANKICON^^
 
#
# DefaultIcon is which icon to show for files which do not have an icon
# explicitly set.
#
DefaultIcon /icons/unknown.gif
 
#
# AddDescription allows you to place a short description after a file in
# server-generated indexes.  These are only displayed for FancyIndexed
# directories.
# Format: AddDescription "description" filename
#
#AddDescription "GZIP compressed document" .gz
#AddDescription "tar archive" .tar
#AddDescription "GZIP compressed tar archive" .tgz
 
#
# ReadmeName is the name of the README file the server will look for by
# default, and append to directory listings.
#
# HeaderName is the name of a file which should be prepended to
# directory indexes.
ReadmeName README.html
HeaderName HEADER.html
 
#
# IndexIgnore is a set of filenames which directory indexing should ignore
# and not include in the listing.  Shell-style wildcarding is permitted.
#
IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t

/etc/httpd/conf.d/userdir.conf

In der Konfigurationsdatei - /etc/httpd/conf.d/autoindex.conf können Konfigurationen zur Freigabe von Benutzerbezogenen Verzeichnissen im Apache HTTP Server entsprechend angepasst werden. Standardmäßig können Benutzer mit einem home-Verzeichnis auf dem Server Inhalte in deren home-Verzeichnis z.B. in einem Unterverzeichnis

  • /home/<Benutzerkennung>/public_html

einstellen und so durch den Apache HTTP Server zur Verfügung stellen.

:!: HINWEIS - Aus Sicherheitsgründen ist dies meist nicht aktiviert!

:!: HINWEIS - Hier werden aktuell KEINE Anpassungen vorgenommen, jedoch sind jegliche Änderungen oder eben auch keine Änderungen immer individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

(komplette Konfigurationsdatei)

#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received.
#
# The path to the end user account 'public_html' directory must be
# accessible to the webserver userid.  This usually means that ~userid
# must have permissions of 711, ~userid/public_html must have permissions
# of 755, and documents contained therein must be world-readable.
# Otherwise, the client will only receive a "403 Forbidden" message.
#
<IfModule mod_userdir.c>
    #
    # UserDir is disabled by default since it can confirm the presence
    # of a username on the system (depending on home directory
    # permissions).
    #
    UserDir disabled
 
    #
    # To enable requests to /~user/ to serve the user's public_html
    # directory, remove the "UserDir disabled" line above, and uncomment
    # the following line instead:
    #
    #UserDir public_html
</IfModule>
 
#
# Control access to UserDir directories.  The following is an example
# for a site where these directories are restricted to read-only.
#
<Directory "/home/*/public_html">
    AllowOverride FileInfo AuthConfig Limit Indexes
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    Require method GET POST OPTIONS
</Directory>

/etc/httpd/conf.d/welcome.conf

Die Konfigurationsdatei - /etc/httpd/conf.d/welcome.conf liefert eine „Wollkommens-Seite“ aus, welche so lange zur Anzeige kommt, bis mindestens unter dem Verzeichnis

  • /var/www/html

entsprechender Content (Inhalte) zur Auslieferung durch den Apache HTTP Server eingestellt wurden.

:!: HINWEIS - Dies Konfigurationsdatei sollte NICHT gelöscht werden, da bei einem Update/Upgrade des Apache HTTP Server diese Konfigurationsdatei wieder neu erstellt werden würde und dies dann ggf. zu unerwünschten Konfigurationen und Effekten führen könnte! Deshalb die Konfigurationsdatei leeren, oder wie nachfolgend dargestellt alle relevanten Konfigurationen auskommentieren.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# This configuration file enables the default "Welcome" page if there
# is no default index page present for the root URL.  To disable the
# Welcome page, comment out all the lines below.
#
# NOTE: if this file is removed, it will be restored on upgrades.
#
# Tachtler - disabled -
#<LocationMatch "^/+$">
#    Options -Indexes
#    ErrorDocument 403 /.noindex.html
#</LocationMatch>
 
#<Directory /usr/share/httpd/noindex>
#    AllowOverride None
#    Require all granted
#</Directory>
 
#Alias /.noindex.html /usr/share/httpd/noindex/index.html
#Alias /css/bootstrap.min.css /usr/share/httpd/noindex/css/bootstrap.min.css
#Alias /css/open-sans.css /usr/share/httpd/noindex/css/open-sans.css
#Alias /images/apache_pb.gif /usr/share/httpd/noindex/images/apache_pb.gif
#Alias /images/poweredby.png /usr/share/httpd/noindex/images/poweredby.png

Zusatz-Konfiguration

Zusatzkonfigurationsdateien

Weitere Konfigurationsdateien befinden sich unter nachfolgendem Verzeichnis

  • /usr/share/doc/httpd-2.4.6

Mit nachfolgendem Befehl können die bereits vorbereiteten zusätzlichen Konfigurationsdateien aufgelistet werden:

# ls -l /usr/share/doc/httpd-2.4.6/*.conf
-rw-r--r-- 1 root root 1797 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-dav.conf
-rw-r--r-- 1 root root 2942 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-default.conf
-rw-r--r-- 1 root root 1119 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-info.conf
-rw-r--r-- 1 root root 5078 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-languages.conf
-rw-r--r-- 1 root root 1004 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-manual.conf
-rw-r--r-- 1 root root 4450 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-mpm.conf
-rw-r--r-- 1 root root 2216 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-multilang-errordoc.conf
-rw-r--r-- 1 root root 1511 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/httpd-vhosts.conf
-rw-r--r-- 1 root root 3161 Jul 23 16:47 /usr/share/doc/httpd-2.4.6/proxy-html.conf

Nachfolgende Tabelle, gibt eine kurze Auflistung der bereits vorbereiteten zusätzlichen Konfigurationsdateien und eine kurze Beschreiben des Verwendungszwecks der jeweiligen Konfigurationsdatei:

Konfigurationsdatei Beschreibung
httpd-dav.conf WebDAV (Web-based Distributed Authoring and Versioning).
httpd-default.conf Zusätzliche konfigurierbare Standardeinstellungen.
httpd-info.conf Erweiterten Statusinformationen z.B.server-status, server-info.
httpd-languages.conf Einstellungen für das nutzen von zusätzlich verschiedenen Sprachen.
httpd-manual.conf Ermöglicht die Anzeige der Dokumentation, falls installiert !.
httpd-mpm.conf Server-Pool Management. (prefork, worker und event).
httpd-multilang-errordoc.conf Implementierung von mehrsprachigen Fehlerdokumenten.
httpd-vhosts.conf Implementierung von virtuellen Hosts.
proxy-html.conf Beispielimplementierung von Proxy-Funktionalitäten.

Mit nachfolgendem Befehlen können nun die zusätzlichen bereits vorbereiteten zusätzlichen Konfigurationsdateien in das Konfigurationsverzeichnis

  • /etc/httpd/conf.d

kopiert werden, um diese dann auch entsprechend anpassen und einsetzen zu können:

# cp -a /usr/share/doc/httpd-2.4.6/*.conf /etc/httpd/conf.d

Nicht benötigte bzw. ggf noch nicht benötigte Konfigurationsdateien können dann mit nachfolgendem Befehl wieder entfernt werden.

:!: HINWEIS - Nachfolgende Konfigurationsdateien werden hier beispielhaft wieder entfernt, da diese hier aktuell nicht oder noch nicht zum Einsatz kommen sollen!

# rm -f httpd-dav.conf httpd-manual.conf httpd-vhosts.conf proxy-html.conf

Anschließend sollte dann das Konfigurationsverzeichnis

  • /etc/httpd/conf.d

wie folgt dargestellt aussehen, was mit nachfolgendem Befehl zur Anzeige gebracht werden kann:

# ls -l /etc/httpd/conf.d
total 44
-rw-r--r-- 1 root root 2893 Jul 23 16:47 autoindex.conf
-rw-r--r-- 1 root root 2942 Jul 23 16:47 httpd-default.conf
-rw-r--r-- 1 root root 1119 Jul 23 16:47 httpd-info.conf
-rw-r--r-- 1 root root 5078 Jul 23 16:47 httpd-languages.conf
-rw-r--r-- 1 root root 4450 Jul 23 16:47 httpd-mpm.conf
-rw-r--r-- 1 root root 2216 Jul 23 16:47 httpd-multilang-errordoc.conf
-rw-r--r-- 1 root root  366 Jul 23 16:48 README
-rw-r--r-- 1 root root 1252 Jul 23 16:21 userdir.conf
-rw-r--r-- 1 root root  808 Jul 23 16:31 welcome.conf

/etc/httpd/conf.d/httpd-default.conf

Nachfolgend soll die Konfigurationsdatei

Konfigurationsdatei Beschreibung
httpd-default.conf Zusätzliche konfigurierbare Standardeinstellungen.

entsprechend angepasst werden.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# 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.
#
# Tachtler
# default: ServerTokens Full
ServerTokens Prod
 
#
# 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:

ServerTokens

Die Einstellung spezifiziert welche Informationen der Apache HTTP Server im Server Antwort-Kopf zurück gibt.

Mögliche Einstellungen sind:

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.6
ServerTokens OS Der Server sendet (z.B.): Server: Apache/2.4.6 (Unix)
ServerTokens Full (default) Der Server sendet (z.B.): Server: Apache/2.4.6 (Unix) PHP/5.4.16
# Tachtler
# default: ServerTokens Full
ServerTokens Prod

/etc/httpd/conf.d/httpd-info.conf

Nachfolgend soll die Konfigurationsdatei

Konfigurationsdatei Beschreibung
httpd-info.conf Erweiterten Statusinformationen z.B.server-status, server-info.

entsprechend angepasst werden.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# 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
    Require host .tachtler.net
    # Tachtler
    # default: Require ip 127
    #Require ip 127
</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
 
#
# 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
    Require host .tachtler.net
    # Tachtler
    # default: Require ip 127
    #Require ip 127
</Location>

Erklärungen:

/server-status

Ermöglicht die Anzeige einer Seite, welche durch z.B. die URL: http://www.tachtler.net/server-status aufgerufen werden kann und Informationen über den aktuellen Status des Apache HTTP Server anzeigt.

Der Aufruf der URL wird durch nachfolgende Angaben wie folgt eingeschränkt:

  • Begrenzung auf Clients, welche aus dem Bereich .tachtler.net kommen.
<Location /server-status>
    SetHandler server-status
    # Tachtler
    # default: Require host .example.com
    Require host .tachtler.net
    # Tachtler
    # default: Require ip 127
    #Require ip 127
</Location>

ExtendedStatus

Das einschalten des ExtendedStatus weist den Apache HTTP Server an, bei On entweder die vollen Informationen anzuzeigen, oder bei Off nur basis Informationen anzuzeigen.

# Tachtler
# default: #ExtendedStatus On
ExtendedStatus On

/server-info

Ermöglicht die Anzeige einer Seite, welche durch z.B. die URL: http://www.tachtler.net/server-info aufgerufen werden kann und Informationen über die aktuellen Module und deren Einbindung des Apache HTTP Server anzeigt.

Der Aufruf der URL wird durch nachfolgende Angaben wie folgt eingeschränkt:

  • Begrenzung auf Clients, welche aus dem Bereich .tachtler.net kommen.
<Location /server-info>
    SetHandler server-info
    # Tachtler
    # default: Require host .example.com
    Require host .tachtler.net
    # Tachtler
    # default: Require ip 127
    #Require ip 127
</Location>

/etc/httpd/conf.d/httpd-languages.conf

Nachfolgend soll die Konfigurationsdatei

Konfigurationsdatei Beschreibung
httpd-languages.conf Einstellungen für das nutzen von zusätzlich verschiedenen Sprachen.

entsprechend angepasst werden.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# 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

Die Einstellung LanguagePriority gibt an in welcher Reihenfolge die möglichen Sprachen angezeigt werden sollen.

# 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

/etc/httpd/conf.d/httpd-mpm.conf

Nachfolgend soll die Konfigurationsdatei

Konfigurationsdatei Beschreibung
httpd-mpm.conf Server-Pool Management. (prefork, worker und event).

entsprechend angepasst werden.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# Server-Pool Management (MPM specific)
#
 
#
# PidFile: The file in which the server should record its process
# identification number when it starts.
#
# Note that this is the default PidFile for most MPMs.
#
<IfModule !mpm_netware_module>
    PidFile "/run/httpd/httpd.pid"
</IfModule>
 
#
# Only one of the below sections will be relevant on your
# installed httpd.  Use "apachectl -l" to find out the
# active mpm.
#
 
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxRequestWorkers: maximum number of server processes allowed to start
# MaxConnectionsPerChild: maximum number of connections a server process serves
#                         before terminating
<IfModule mpm_prefork_module>
    StartServers             5
    MinSpareServers          5
    MaxSpareServers         10
    MaxRequestWorkers      250
    # Tachtler
    # default: MaxConnectionsPerChild   0
    MaxConnectionsPerChild   2000
</IfModule>
 
# worker MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestWorkers: maximum number of worker threads
# MaxConnectionsPerChild: maximum number of connections a server process serves
#                         before terminating
<IfModule mpm_worker_module>
    StartServers             3
    MinSpareThreads         75
    MaxSpareThreads        250
    ThreadsPerChild         25
    MaxRequestWorkers      400
    # Tachtler
    # default: MaxConnectionsPerChild   0
    MaxConnectionsPerChild   2000
</IfModule>
 
# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestWorkers: maximum number of worker threads
# MaxConnectionsPerChild: maximum number of connections a server process serves
#                         before terminating
<IfModule mpm_event_module>
    StartServers             3
    MinSpareThreads         75
    MaxSpareThreads        250
    ThreadsPerChild         25
    MaxRequestWorkers      400
    # Tachtler
    # default: MaxConnectionsPerChild   0
    MaxConnectionsPerChild   2000
</IfModule>
 
# NetWare MPM
# ThreadStackSize: Stack size allocated for each worker thread
# StartThreads: Number of worker threads launched at server startup
# MinSpareThreads: Minimum number of idle threads, to handle request spikes
# MaxSpareThreads: Maximum number of idle threads
# MaxThreads: Maximum number of worker threads alive at the same time
# MaxConnectionsPerChild: Maximum  number of connections a thread serves. It
#                         is recommended that the default value of 0 be set
#                         for this directive on NetWare.  This will allow the
#                         thread to continue to service requests indefinitely.
<IfModule mpm_netware_module>
    ThreadStackSize      65536
    StartThreads           250
    MinSpareThreads         25
    MaxSpareThreads        250
    MaxThreads            1000
    MaxConnectionsPerChild   0
</IfModule>
 
# OS/2 MPM
# StartServers: Number of server processes to maintain
# MinSpareThreads: Minimum number of idle threads per process,
#                  to handle request spikes
# MaxSpareThreads: Maximum number of idle threads per process
# MaxConnectionsPerChild: Maximum number of connections per server process
<IfModule mpm_mpmt_os2_module>
    StartServers             2
    MinSpareThreads          5
    MaxSpareThreads         10
    MaxConnectionsPerChild   0
</IfModule>
 
# WinNT MPM
# ThreadsPerChild: constant number of worker threads in the server process
# MaxConnectionsPerChild: maximum number of connections a server process serves
<IfModule mpm_winnt_module>
    ThreadsPerChild        150
    MaxConnectionsPerChild   0
</IfModule>
 
# The maximum number of free Kbytes that every allocator is allowed
# to hold without calling free(). In threaded MPMs, every thread has its own
# allocator. When not set, or when set to zero, the threshold will be set to
# unlimited.
<IfModule !mpm_netware_module>
    MaxMemFree            2048
</IfModule>
<IfModule mpm_netware_module>
    MaxMemFree             100
</IfModule>

Erklärungen:

MaxConnectionsPerChild

Durch setzen von MaxConnectionsPerChild auf einen Wert ungleich Null, begrenzt dies die Speichermenge, die ein Prozess durch (versehentliche) Speicherlücken verbrauchen kann. Was bedeutet, ein Wert ungleich null kann unter UNIX/Linux-System die Stabilität verbessern, jedoch mit der Einschränkung, das ein Prozess, je nach Wert, nach einer gewissen Anzahl an Anfragen beendet und neu gestartet wird, was wiederum ggf. mehr Speicherverbrauch und Performance Nachteile mit sich bringt.

<IfModule mpm_prefork_module>
    StartServers             5
    MinSpareServers          5
    MaxSpareServers         10
    MaxRequestWorkers      250
    # Tachtler
    # default: MaxConnectionsPerChild   0
    MaxConnectionsPerChild   2000
</IfModule>
<IfModule mpm_worker_module>
    StartServers             3
    MinSpareThreads         75
    MaxSpareThreads        250
    ThreadsPerChild         25
    MaxRequestWorkers      400
    # Tachtler
    # default: MaxConnectionsPerChild   0
    MaxConnectionsPerChild   2000
</IfModule>
<IfModule mpm_event_module>
    StartServers             3
    MinSpareThreads         75
    MaxSpareThreads        250
    ThreadsPerChild         25
    MaxRequestWorkers      400
    # Tachtler
    # default: MaxConnectionsPerChild   0
    MaxConnectionsPerChild   2000
</IfModule>

/etc/httpd/conf.d/httpd-multilang-errordoc.conf

Nachfolgend soll die Konfigurationsdatei

Konfigurationsdatei Beschreibung
httpd-multilang-errordoc.conf Implementierung von mehrsprachigen Fehlerdokumenten.

entsprechend angepasst werden.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# 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

Die Einstellung LanguagePriority gibt an in welcher Reihenfolge die möglichen Sprachen, in denen die Fehlerdokumente angezeigt werden sollen, dargestellt werden sollen.

    # 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

Erster Neustart

Bevor weitere Konfigurationsschritte erfolgen, sollte dem ersten Neustart nichts im Wege stehen und die erweiterten Konfigurationseinstellungen sollten ebenfalls angezogen werden:

# systemctl restart httpd.service

:!: HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !

Konfiguration überprüfen

Mit nachfolgenden Seitenaufrufen kann überprüft werden, ob die Änderungen durch die Einbindung der zusätzlichen Konfigurationsdateien erfolgreich war:

Der Aufruf der URL:

sollte nachfolgende Anzeige zum Vorschein bringen:

CentOS-7 - Apache - index.html

Konfigurationsdatei Beschreibung
httpd-default.conf Zusätzliche konfigurierbare Standardeinstellungen.
httpd-multilang-errordoc.conf Implementierung von mehrsprachigen Fehlerdokumenten.

Der Aufruf der URL:

sollte nachfolgende Anzeige zum Vorschein bringen:

CentOS-7 - Apache - NotFound

Zum einen ist hier die Anzeige des Fehlerdokuments in deutscher Sprache (Browser Einstellung ist deutsch) zu sehen und zum anderen die Anzeige der Kennung (ServerTokens) des Apache HTTP Server mit der Einstellung ServerTokens Prod.

Konfigurationsdatei Beschreibung
httpd-info.conf Erweiterten Statusinformationen z.B.server-status, server-info.

Der Aufruf der URL:

sollte nachfolgende Anzeige zum Vorschein bringen:

CentOS-7 - Apache - Server-Status

Der Aufruf der URL:

sollte nachfolgende Anzeige zum Vorschein bringen:

CentOS-7 - Apache - Server-Info

Konfigurationsdatei Beschreibung
httpd-languages.conf Einstellungen für das nutzen von zusätzlich verschiedenen Sprachen.
httpd-mpm.conf Server-Pool Management. (prefork, worker und event).

Zum Nachweis, dass die vorangestellten Konfigurationsdateien auch tatsächlich angezogen wurden, besteht die Möglichkeit, der Überprüfung der Konfiguration auf syntaktische Richtigkeit und die Überprüfung zur Laufzeit mit nachfolgenden Befehlen:

# apachectl configtest
Syntax OK
# apachectl -L | grep MaxRequestsPerChild
MaxRequestsPerChild (core.c)
# apachectl -L | grep LanguagePriority
LanguagePriority (mod_negotiation.c)
ForceLanguagePriority (mod_negotiation.c)
        Force LanguagePriority elections, either None, or Fallback and/or Prefer

Erweiterte-Konfiguration

/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:

CentOS-7 - Apache - NotFound

Falls das Datum und die Uhrzeit der Fehlermeldung mit angezeigt werden sollen, kann die Konfigurationsdatei

  • /usr/share/httpd/error/include/bottom.html

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:

CentOS-7 - Apache - NotFound - Mit Datum und Uhrzeit

Module

Der Apache HTTP Server hat gewisse Module bereits einkompiliert und andere werden beim starten des Apache HTTP Server erste geladen.

Welche Module bereits im Apache HTTP Server einkompiliert sind, kann mit nachfolgendem Befehl ermittelt werden:

# apachectl -l
Compiled in modules:
  core.c
  mod_so.c
  http_core.c

Alle weiteren Module befinden sich unter dem Verzeichnis

  • /usr/lib64/httpd/modules

und werden erst beim starten des Apache HTTP Server (nach)geladen.

Nachfolgender Befehl kann dazu verwendet werden, alle geladenen Module, auch die einkompilierten, welche beim starten des Apache HTTP Server zur Verfügung stehen, anzuzeigen.

# apachectl -t -D DUMP_MODULES
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
If you want to pass extra arguments to httpd, edit the
/etc/sysconfig/httpd config file.
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 allowmethods_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_anon_module (shared)
 authn_core_module (shared)
 authn_dbd_module (shared)
 authn_dbm_module (shared)
 authn_file_module (shared)
 authn_socache_module (shared)
 authz_core_module (shared)
 authz_dbd_module (shared)
 authz_dbm_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_owner_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cache_module (shared)
 cache_disk_module (shared)
 data_module (shared)
 dbd_module (shared)
 deflate_module (shared)
 dir_module (shared)
 dumpio_module (shared)
 echo_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 info_module (shared)
 log_config_module (shared)
 logio_module (shared)
 mime_magic_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 remoteip_module (shared)
 reqtimeout_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_plain_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_memcache_module (shared)
 socache_shmcb_module (shared)
 status_module (shared)
 substitute_module (shared)
 suexec_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 userdir_module (shared)
 version_module (shared)
 vhost_alias_module (shared)
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)
 lua_module (shared)
 mpm_prefork_module (shared)
 proxy_module (shared)
 lbmethod_bybusyness_module (shared)
 lbmethod_byrequests_module (shared)
 lbmethod_bytraffic_module (shared)
 lbmethod_heartbeat_module (shared)
 proxy_ajp_module (shared)
 proxy_balancer_module (shared)
 proxy_connect_module (shared)
 proxy_express_module (shared)
 proxy_fcgi_module (shared)
 proxy_fdpass_module (shared)
 proxy_ftp_module (shared)
 proxy_http_module (shared)
 proxy_scgi_module (shared)
 systemd_module (shared)
 cgi_module (shared)

Die Konfiguration, welche Module beim starten des Apache HTTP Server (nach)geladen werden, ist in nachfolgendem Verzeichnis in nachfolgenden Konfigurationsdateien enthalten, welche mit folgendem Befehl aufgelistet werden können:

# ls -l /etc/httpd/conf.modules.d/
total 28
-rw-r--r-- 1 root root 3739 Jul 23 16:21 00-base.conf
-rw-r--r-- 1 root root  139 Jul 23 16:21 00-dav.conf
-rw-r--r-- 1 root root   41 Jul 23 16:21 00-lua.conf
-rw-r--r-- 1 root root  742 Jul 23 16:21 00-mpm.conf
-rw-r--r-- 1 root root  894 Jul 23 16:21 00-proxy.conf
-rw-r--r-- 1 root root   88 Jul 23 16:21 00-systemd.conf
-rw-r--r-- 1 root root  451 Jul 23 16:21 01-cgi.conf

/etc/httpd/conf.modules.d/00-base.conf

Die Konfigurationsdatei /etc/httpd/conf.modules.d/00-base.conf beinhaltet die Basis-Module, welche die meisten und grundlegenden Module für den Apache HTTP Server darstellen.

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

#
# This file loads most of the modules included with the Apache HTTP
# Server itself.
#
 
# Tachtler
# Only required moduls should be loaded.
LoadModule access_compat_module modules/mod_access_compat.so
# LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule auth_basic_module modules/mod_auth_basic.so
# LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
# LoadModule authn_dbd_module modules/mod_authn_dbd.so
# LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_socache_module modules/mod_authn_socache.so
LoadModule authz_core_module modules/mod_authz_core.so
# LoadModule authz_dbd_module modules/mod_authz_dbd.so
# LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cache_module modules/mod_cache.so
# LoadModule cache_disk_module modules/mod_cache_disk.so
LoadModule data_module modules/mod_data.so
# LoadModule dbd_module modules/mod_dbd.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule dumpio_module modules/mod_dumpio.so
LoadModule echo_module modules/mod_echo.so
# LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
# LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule remoteip_module modules/mod_remoteip.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
# LoadModule socache_dbm_module modules/mod_socache_dbm.so
LoadModule socache_memcache_module modules/mod_socache_memcache.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule status_module modules/mod_status.so
# LoadModule substitute_module modules/mod_substitute.so
# LoadModule suexec_module modules/mod_suexec.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule unixd_module modules/mod_unixd.so
# LoadModule userdir_module modules/mod_userdir.so
# LoadModule version_module modules/mod_version.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so
 
#LoadModule buffer_module modules/mod_buffer.so
#LoadModule watchdog_module modules/mod_watchdog.so
#LoadModule heartbeat_module modules/mod_heartbeat.so
#LoadModule heartmonitor_module modules/mod_heartmonitor.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule dialup_module modules/mod_dialup.so
#LoadModule charset_lite_module modules/mod_charset_lite.so
#LoadModule log_debug_module modules/mod_log_debug.so
#LoadModule ratelimit_module modules/mod_ratelimit.so
#LoadModule reflector_module modules/mod_reflector.so
#LoadModule request_module modules/mod_request.so
#LoadModule sed_module modules/mod_sed.so
#LoadModule speling_module modules/mod_speling.so

/etc/httpd/conf.modules.d/00-dav.conf

Die Konfigurationsdatei /etc/httpd/conf.modules.d/00-dav.conf beinhaltet die WebDAV-Module des Apache HTTP Server. Falls WebDAV zum Einsatz kommen soll, kann diese Konfgurationsdatei ohne Änderungen so belassen werden. Falls nicht, können alle Inhalte auskommentiert werden!

:!: HINWEIS - Hier werden aktuell KEINE Anpassungen vorgenommen, jedoch sind jegliche Änderungen oder eben auch keine Änderungen immer individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

(komplette Konfigurationsdatei)

LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dav_lock_module modules/mod_dav_lock.so

/etc/httpd/conf.modules.d/00-lua.conf

Die Konfigurationsdatei /etc/httpd/conf.modules.d/00-lua.conf beinhaltet die LUA-Programmiersprachen-Module des Apache HTTP Server. Falls die LUA-Programmiersprache zum Einsatz kommen soll, kann diese Konfgurationsdatei ohne Änderungen so belassen werden. Falls nicht, können alle Inhalte auskommentiert werden!

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

# Tachtler
# Only required moduls should be loaded.
# LoadModule lua_module modules/mod_lua.so

/etc/httpd/conf.modules.d/00-mpm.conf

Die Konfigurationsdatei /etc/httpd/conf.modules.d/00-mpm.conf beinhaltet die Multi-Processing-Module-Module des Apache HTTP Server. Durch diese Konfiguration wird unter UNIX/Linux-Systemen entschieden, in welchem Modus der Apache HTTP Server operieren soll.

Nachfolgende Fragen sollen eine Hilfestellung sein, um entscheiden zu können in welchem Modus der Apache HTTP Server laufen soll.

  1. Unterstützt des Betriebssystem Threads - CentOS-7: JA
  2. Unterstützt des Betriebssystem Thread-safe polling - CentOS-7: JA

(Thread-safe besagt, dass eine Komponente gleichzeitig von verschiedenen Programmbereichen mehrfach ausgeführt werden kann, ohne dass diese sich gegenseitig behindern.)


Falls beide Fragen mit JA beantwortet werden können, können als MPM (Multi-Processing-Module) in nachfolgenden präferierten Riehenfolge:

zum Einsatz kommen.


Falls nur die Frage 1 mit JA beantwortet werden kann und die Frage 2 mit NEIN beantwortet werden kann, können als MPM (Multi-Processing-Module) in nachfolgenden präferierten Riehenfolge:

zum Einsatz kommen.


Falls beide Fragen mit NEIN beantwortet werden können, kann als MPM (Multi-Processing-Module) nur:

zum Einsatz kommen.

:!: WICHTIG - Beim Einsatz von PHP (in Verbindung mit mehreren konkurrierenden Verbindungen), muss prefork verwendet werden!

:!: HINWEIS - Hier werden aktuell KEINE Anpassungen vorgenommen, jedoch sind jegliche Änderungen oder eben auch keine Änderungen immer individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

(komplette Konfigurationsdatei)

# Select the MPM module which should be used by uncommenting exactly
# one of the following LoadModule lines:
 
# prefork MPM: Implements a non-threaded, pre-forking web server
# See: http://httpd.apache.org/docs/2.4/mod/prefork.html
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
 
# worker MPM: Multi-Processing Module implementing a hybrid
# multi-threaded multi-process web server
# See: http://httpd.apache.org/docs/2.4/mod/worker.html
#
#LoadModule mpm_worker_module modules/mod_mpm_worker.so
 
# event MPM: A variant of the worker MPM with the goal of consuming
# threads only for connections with active processing
# See: http://httpd.apache.org/docs/2.4/mod/event.html
#
#LoadModule mpm_event_module modules/mod_mpm_event.so

/etc/httpd/conf.modules.d/00-proxy.conf

Die Konfigurationsdatei /etc/httpd/conf.modules.d/00-proxy.conf beinhaltet die Proxy-Module des Apache HTTP Server. Falls nicht alle Proxy-Module zum Einsatz kommen sollen, können die entsprechenden Inhalte auskommentiert werden!

:!: HINWEIS - Die nachfolgenden Anpassungen sind individuell und vom jeweiligen Einsatzzweck abhängig und ggf. den persönlichen Bedürfnissen anzupassen!

Die Anpassungen werden mit einem vorangestellten Kommentar in der Form

# Tachtler

gekennzeichnet.

(komplette Konfigurationsdatei)

# Tachtler
# Only required moduls should be loaded.
# This file configures all the proxy modules:
LoadModule proxy_module modules/mod_proxy.so
# LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so
# LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so
# LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so
# LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
# LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
# LoadModule proxy_connect_module modules/mod_proxy_connect.so
# LoadModule proxy_express_module modules/mod_proxy_express.so
# LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
# LoadModule proxy_fdpass_module modules/mod_proxy_fdpass.so
# LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
# LoadModule proxy_scgi_module modules/mod_proxy_scgi.so

/etc/httpd/conf.modules.d/00-systemd.conf

Die Konfigurationsdatei /etc/httpd/conf.modules.d/00-systemd.conf beinhaltet die Systemd-Integration des Apache HTTP Server.

:!: HINWEIS - Hier werden aktuell KEINE Anpassungen vorgenommen und es sollten auch grundsätzlich beim Einsatz von systemd, keine Anpassungen vorgenommen werden!

(komplette Konfigurationsdatei)

# This file configures systemd module:
LoadModule systemd_module modules/mod_systemd.so

/etc/httpd/conf.modules.d/01-cgi.conf

Die Konfigurationsdatei /etc/httpd/conf.modules.d/01-cgi.conf beinhaltet die CGI-Verwendung des Apache HTTP Server.

:!: HINWEIS - Hier werden aktuell KEINE Anpassungen vorgenommen und es sollten auch grundsätzlich keine Anpassungen vorgenommen werden, je nach verwendetem MPM (Multi-Processor-Module) das entsprechende CGI-Modul geladen wird!

# This configuration file loads a CGI module appropriate to the MPM
# which has been configured in 00-mpm.conf.  mod_cgid should be used
# with a threaded MPM; mod_cgi with the prefork MPM.
 
<IfModule mpm_worker_module>
   LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_event_module>
   LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
   LoadModule cgi_module modules/mod_cgi.so
</IfModule>

Virtuelle Hosts

Virtuelle Hosts gibt es in zwei Ausprägungen:

  1. IP-basierte virtuelle Hosts (jeder virtuelle Host benötigt eine eigene IP-Adresse)
  2. Namens-basierte virtuelle Hosts (mehrere virtuelle Hosts teilen sich die gleiche IP-Adresse)

IP-basierte virtuelle Hosts verwenden die IP-Adresse der Verbindung, um den korrekten virtuellen Host zur Bedienung einer Anfrage zu ermitteln. Folglich wird eine eigene IP-Adresse für jeden virtuellen Host benötigt.

Bei der Verwendung von namensbasierten virtuellen Hosts verlässt sich der Server darauf, dass der Client den Hostnamen als Bestandteil der HTTP-Header angibt. Durch Anwendung dieser Technik, können sich mehrere verschiedene Hosts die gleiche IP-Adresse teilen.

Nachfolgend soll deshalb ein Beispiel für die Erstellung eines namensbasierten Hosts konfiguriert werden.

#
# httpd.tachtler.net (Apache HTTP Server-Status/Info)
#
<VirtualHost *:80>
        ServerAdmin webmaster@tachtler.net
        ServerName httpd.tachtler.net
        ServerAlias www.httpd.tachtler.net
        ServerPath /
        DocumentRoot "/var/www/html"
        <Directory "/var/www/html">
                Options -Indexes +FollowSymLinks
                # Tachtler (enable for .htaccess file support)
                # AllowOverride AuthConfig
                AllowOverride None
                # Tachtler (enable for unlimited access)
		Require all granted
                # Tachtler (enable for restricted access)
		# Allow access from localhost, edmz, idmz, home
		# Require ip 127.0.0.1/8 192.168.1.0/24 192.168.0.0/24 192.168.2.0/25 
 
                # Rewrite the requestet URI, when following query was
                # NOT set to --> /server-status
                RewriteEngine on
                RewriteBase /
                RewriteRule ^$ %{REQUEST_URI}server-status [R=301,L]
 
        </Directory>
 
        DirectoryIndex index.htm
 
        ErrorLog logs/httpd_error.log
        SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" forwarded
        CustomLog logs/httpd_access.log combined env=!forwarded
        CustomLog logs/httpd_access.log combined_proxypass env=forwarded
</VirtualHost>

Erklärungen:

VirtualHost

Die Direktive <VirtualHost *:80> bezeichnet den Anfang eines Virtuellen Hosts und die Direktive. </VirtualHost> bezeichnet das Ende eines virtuellen Hosts.

ServerAdmin

Die Direktive ServerAdmin webmaster@tachtler.net bezeichnet die e-Mail-Adresse die z.B. bei Fehlermeldungsseiten angezeigt werden soll.

ServerName

Die Direktive ServerName httpd.tachtler.net ist die FQDN unter der dieser virtuelle Host primär erreichbar ist.

ServerAlias

Die Direktive ServerAlias www.httpd.tachtler.net bezeichnet einen oder mehrere weiter FQDN unter der der virtuelle Host erreichbar ist.

ServerPath

Die Direktive ServerPath / legt den URL-Pfad eines Hosts zur Verwendung mit namensbasierten virtuellen Hosts fest.

:!: HINWEIS - Dient nur zur Kompatibilität zu antiquierten Clients!

DocumentRoot

Die Direktive DocumentRoot „/var/www/html“ legt das Stammverzeichnis in der sich die Dateien der Web-Anwendung befinden fest.

Directory

Die Direktive <Directory „/var/www/html“> legt den Anfang von Direktiven fest, welche nur auf das genannte Verzeichnis des Dateisystems und Unterverzeichnisse angewendet werden und die Direktive </Directory> legt das Ende von Direktiven fest, welche nur auf das genannte Verzeichnis des Dateisystems und Unterverzeichnisse angewendet werden.

Options

Die Direktive Options -Indexes +FollowSymLinks legt fest welche Optionen für das Verzeichnis und die Unterverzeichnisse gelten sollen, hier -Indexes - keine Auflistung des Verzeichnisinhaltes und +FollowSymLinks - Der Server folgt symbolischen Links in diesem Verzeichnis.

AllowOverride

Die Direktive AllowOverride None legt fest, welche der angegebenen Direktiven frühere Konfigurationsanweisungen überschreiben dürfen.

Require

Die Direktive Require all granted überprüft ob ein bestimmter Benutzer autorisiert Zugriff zu nehmen, hier ist der Zugriff ohne Beschränkungen erlaubt.

Rewrite

Die Direktiven

                RewriteEngine on
                RewriteBase /
                RewriteRule ^$ %{REQUEST_URI}server-status [R=301,L]

schreiben die eingegebene URL in der Form um, dass wenn die URL nicht die Zeichenfolge server-status enthält, diese an die eingegebene URL angehängt wird und dies als redirect mit HTML-Code R=301 und nach erfolgreicher Ausführung dies nicht weiter fortzusetzen L durchgeführt wird.

DirectoryIndex

Die Direktive DirectoryIndex index.htm legt die Datei(en) fest, welche als Einstiegsseite(n) bei einem Aufruf interpretiert werden sollen.

ErrorLog

Die Direktive ErrorLog logs/httpd_error.log definiert eine Datei in die Fehlermeldungen protokolliert werden sollen, bezogen auf diesen virtuellen Host.

SetEnvIf

Die Direktive SetEnvIf X-Forwarded-For „^.*\..*\..*\..*“ forwarded definiert temporär eine Umgebungsvariable, welche später ausgewertet werden kann und als Inhalt eine mögliche Remote-Ip-Adresse beinhaltet.

CustomLog

Die Direktive CustomLog logs/httpd_access.log combined env=!forwarded bzw. CustomLog logs/httpd_access.log combined_proxypass env=forwarded definiert eine Datei in die Zugriffe und Meldungen protokolliert werden sollen, auf diesen virtuellen Host bezogen.

Wenn die Umgebungsvariable nicht gesetzt ist, ist das Format hier dann combined. Wenn die Umgebungsvariable gesetzt ist, ist das Format hier dann combined_proxypass.

:!: HINWEIS - Die Log-Formate müssen vorher z.B. in der Konfigurationsdatei /etc/httpd/conf/httpd.conf jedoch definiert sein!

Abschließender Neustart

Nach Durchführung der vorhergehenden Konfigurationsschritte, sollte dem abschließendem Neustart nichts im Wege stehen und die weiteren Konfigurationseinstellungen ebenfalls angezogen werden:

# systemctl restart httpd.service

:!: HINWEIS - Es erfolgen keine weiteren Ausgaben, wenn der Start erfolgreich war !

Nützliche Befehle

Nachfolgende Befehle können bei der Administration eines Apache HTTP Server nützlich sein.

:!: HINWEIS - Die nachfolgende Auflistung erhebt keinen Anspruch auf Vollständigkeit !

apachectl

Der nachfolgende Befehl

  • /usr/sbin/apachectl

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
Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
tachtler/apache_http_server_centos_7.txt · Zuletzt geändert: 2019/01/24 17:52 von klaus