Hilfecenter

projectfacts_Logo

Apache Konfiguration

Linux #

Es ist empfehlenswert, eigene Zertifikate in das folgende Verzeichnis abzulegen: /etc/apache2/ssl/

Wenn Sie kein SSL-Zertifikat besitzen, können Sie sich über Let’s Encrypt ein kostenloses SSL-Zertifikat ausstellen lassen. Hier ist der Certbot (https://certbot.eff.org/) zu empfehlen.

Führen Sie folgenden Befehl aus, um die benötigten Module zu aktivieren:

				
					a2enmod ssl rewrite proxy proxy_wstunnel proxy_http
				
			

Unter /etc/apache2/sites-available legen Sie eine Datei mit dem Namen projectfacts.conf an. Fügen Sie den Inhalt der Beispielkonfiguration in die projectfacts.conf ein.

Beispielkonfiguration:

				
					<VirtualHost *:80>
  ServerAdmin admin@example.de
  ServerName server.example.de

  Redirect / https://server.example.de/
</VirtualHost>

<VirtualHost *:443>
  ServerAdmin admin@example.de
  ServerName server.example.de
  AddDefaultCharset utf-8
  AddCharset utf-8 .html
  AddCharset utf-8 .do

  SSLEngine On
  SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
  SSLHonorCipherOrder On
  SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
  SSLCertificateFile /etc/apache2/ssl/server.example.de.crt
  SSLCertificateKeyFile /etc/apache2/ssl/server.example.de.key
  SSLCACertificateFile /etc/apache2/ssl/server.example.de.intermediate.crt

  ErrorLog /srv/projectfacts/logs/httpd_error_log
  CustomLog /srv/projectfacts/logs/httpd_access_log combined

  HostnameLookups Off
  UseCanonicalName Off
  ServerSignature Off

  Header set Rtime "%D"
  Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"

  ProxyPreserveHost on
  RequestHeader set X-Forwarded-Proto "https"

  Redirect permanent /pfea/login/ExternalaccessLoginDialog.do https://[DOMAIN]/htdocs/apps/pfextern
  Redirect permanent /pfea/home/ExternalaccessHomeDialog.do https://[DOMAIN]/htdocs/apps/pfextern

  ProxyRequests Off
  ProxyPass /pfea/home/ExternalaccessHomeDialog.do !
  ProxyPass /pfea/login/ExternalaccessLoginDialog.do !
  # ProxyPass /.well-known/acme-challenge/  http://localhost:8080/htdocs/.well-known/acme-challenge/  # Certbot Konfiguration
  # ProxyPassReverse /.well-known/acme-challenge/  http://localhost:8080/htdocs/.well-known/acme-challenge/  # Certbot Konfiguration
  ProxyPass /ws/ ws://localhost:8080/ws/ timeout=90
  ProxyPassReverse /ws/ ws://localhost:8080/ws/
  ProxyPass / http://localhost:8080/
  ProxyPassReverse / http://localhost:8080/
</VirtualHost>

				
			

Um die CipherSuite anzupassen, können Sie folgendes Tool verwenden: https://mozilla.github.io/server-side-tls/ssl-config-generator/

Bearbeiten Sie folgende Datei /etc/apache2/conf-available/security.conf:

				
					ServerTokens Prod
ServerSignature Off
TraceEnable Off
				
			

Bearbeiten Sie folgende Datei /etc/apache2/mods-enabled/ssl.conf:

				
					SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384
SSLHonorCipherOrder on
SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
SSLCompression off
				
			

Bearbeiten Sie folgende Datei /etc/apache2/mods-enabled/mpm_event.conf:

				
					StartServers 2
MinSpareThreads 320
MaxSpareThreads 320
ThreadLimit 64
ThreadsPerChild 64
MaxRequestWorkers 320
MaxConnectionsPerChild 0
				
			

Bearbeiten Sie die Datei /etc/logrotate.d/apache2 und passen Sie folgenden Eintrag von „…/apache2 reload“ zu „…/apache2 restart“ an.

Fügen Sie folgende Zeile oberhalb von /var/log/apache2/*.log hinzu:
/srv/projectfacts/logs/httpd_*_log

 Zum Aktivieren der Seite führen Sie folgenden Befehl aus:
a2ensite <Name der Konfigurationsdatei>

Zum Deaktivieren einer Seite verwenden Sie folgenden Befehl:
a2dissite <Name der Konfigurationsdatei>

Starten Sie den Apache Server neu mit systemctl restart apache2.service

Unter /etc/apache2/site-enable können Sie sehen, welche Konfiguration aktiv ist.

Windows #

Es ist empfehlenswert, eigene Zertifikate in das folgende Verzeichnis abzulegen: C:\Apache24\conf\ssl\

Wenn Sie kein SSL-Zertifikat besitzen, können Sie sich über Let’s Encrypt ein kostenloses SSL-Zertifikat ausstellen lassen. Hier ist der Certbot (https://certbot.eff.org/) zu empfehlen.

Legen Sie den Apache-Webserver unter C:\apache24 ab.

Starten Sie die CMD mit Administrations rechten. Navigieren Sie zu C:\Apache24\bin

und führen Sie folgenden Befehle aus: httpd.exe -k install -n “apache2.4“

Unter C:\Apache24\conf\extra\ legen Sie eine neue Datei mit dem Namen projectfacts.conf an (Siehe Beispielkonfiguration unter Linux).

Fügen Sie die Konfiguration in die httpd.conf hinzu (Beispiel im nächsten Schritt)

Öffnen Sie die Datei unter C:\Apache24\conf\httpd.conf. In dieser Datei werden die

Module, Mods, Ports und die vHost Konfigurationen angepasst:

Öffnen Sie die Datei
C:\Apache24\conf\extra\httpd-mpm und fügen Sie unter mpm_worker_module folgendes ein:

				
					StartServers 2
MinSpareThreads 320
MaxSpareThreads 320
ThreadLimit 64
ThreadsPerChild 64
MaxRequestWorkers 320
MaxConnectionsPerChild 0
				
			

Starten Sie nun den Apache-Server neu.

Apache Connection Timeout #

Passen Sie in der projectfacts.conf den ProxyPass an:
Windows: C:\Apache24\conf\extra\projectfacts.cnf
Linux:/etc/apache2/sites-enabled/projectfacts.conf

				
					ProxyPass "/" "http://example.com" connectiontimeout=10 timeout=600