Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
fhc:installation [2018/06/22 12:59] pollmann [HTTPS aktivieren] |
— (aktuell) | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | [[fhc:server|zurück zur Übersicht]] | ||
| - | |||
| - | ====== FH-Complete Server Installation ====== | ||
| - | |||
| - | <note warning> | ||
| - | Diese Installationsanleitung befindet sich noch im Aufbau | ||
| - | </note> | ||
| - | Diese Anleitung beschreibt die Installation des FH-Complete Core. | ||
| - | In diesem Setup wird davon ausgegangen, dass sich die Datenbank auf einem eigenen Server befindet. | ||
| - | |||
| - | ===== Voraussetzungen ===== | ||
| - | |||
| - | Die Installation setzt folgende Infrastruktur voraus: | ||
| - | |||
| - | * LDAP Server (ldap.example.com) | ||
| - | * Mail Server (mail.example.com) | ||
| - | * Storage | ||
| - | * PostgreSQL Server (db.example.com) | ||
| - | |||
| - | * Der Server selbst ist unter (fhcomplete.example.com) erreichbar | ||
| - | |||
| - | ===== Grund Installation ===== | ||
| - | |||
| - | Ausgangsbasis für die Installation ist eine Standardinstallation von Debian 9 Stretch. | ||
| - | Die folgenden Befehle für die Installation werden als root User ausgeführt. | ||
| - | |||
| - | Zuerst installieren wir den Apache Webserver | ||
| - | <code> | ||
| - | apt install apache2 | ||
| - | </code> | ||
| - | |||
| - | und die PHP Pakete | ||
| - | <code> | ||
| - | apt install php7.0 php7.0-xsl php7.0-gd php7.0-pgsql php7.0-ldap php7.0-mcrypt php7.0-mbstring php7.0-soap php7.0-curl | ||
| - | </code> | ||
| - | |||
| - | Zusätzliche Tools installieren | ||
| - | <code> | ||
| - | apt install vim zip | ||
| - | </code> | ||
| - | |||
| - | ===== NTP - Zeitsynchronisation ===== | ||
| - | Die Uhrzeit sollte auf allen FH-Complete Servern annähernd die selbe sein. Deshalb sollte diese mit NTP synchron gehalten werden. | ||
| - | |||
| - | <code> | ||
| - | apt-get install ntp | ||
| - | </code> | ||
| - | |||
| - | In der Datei /etc/ntp.conf wird dann ein Timeserver hinzugefügt. | ||
| - | |||
| - | <code bash /etc/ntp.conf> | ||
| - | # You do need to talk to an NTP server or two (or three). | ||
| - | #server ntp.your-provider.example | ||
| - | server ts.example.com | ||
| - | </code> | ||
| - | |||
| - | ===== Apache einrichten ===== | ||
| - | ==== HTTPS aktivieren ==== | ||
| - | |||
| - | Um die HTTPS Verschlüsselung zu aktivieren benötigen wir das Server Zertifikat und den dazu passenden private Key. | ||
| - | Den private Key speichern wir unter /etc/ssl/private/fhcomplete.key und das Zertifikat unter /etc/ssl/certs/fhcomplete.pem | ||
| - | Nähere Informationen zu den Zertifikaten gibt es [[fhc:zertifikate|hier]] | ||
| - | |||
| - | Mit folgendem Befehl aktivieren wir SSL im Apache | ||
| - | <code> | ||
| - | a2enmod ssl | ||
| - | systemctl restart apache2 | ||
| - | </code> | ||
| - | |||
| - | Wir kopieren das default-ssl Config und passen dort die Zertifikatspfade entsprechend an: | ||
| - | <code> | ||
| - | cd /etc/apache2/sites-available/ | ||
| - | cp default-ssl.conf fhcomplete-ssl.conf | ||
| - | </code> | ||
| - | |||
| - | In der neu erstellten fhcomplete-ssl.conf muss der Pfad zu den Zertifikaten angegeben werden: | ||
| - | <code bash /etc/apache2/sites-available/fhcomplete-ssl.conf> | ||
| - | SSLCertificateFile /etc/ssl/certs/fhcomplete.pem | ||
| - | SSLCertificateKeyFile /etc/ssl/private/fhcomplete.key | ||
| - | </code> | ||
| - | |||
| - | Mit folgendem Befehl aktivieren wir die Konfiguration | ||
| - | <code> | ||
| - | a2ensite fhcomplete-ssl.conf | ||
| - | systemctl reload apache2 | ||
| - | </code> | ||
| - | |||
| - | Nachdem die SSL Verbindung funktioniert richten wir einen Redirect von HTTP auf HTTPS ein. Dazu editieren wir die Datei /etc/apache2/sites-enabled/000-default.conf | ||
| - | |||
| - | <code bash /etc/apache2/sites-enabled/000-default.conf> | ||
| - | .... | ||
| - | DocumentRoot /var/www/html | ||
| - | Redirect permanent / https://fhcomplete.example.com | ||
| - | .... | ||
| - | </code> | ||
| - | |||
| - | In der fhcomplete-ssl.conf richten wir einen Caldav Redirect ein sofern die Caldav Schnittstelle verwendet werden soll. | ||
| - | Zusätzlich setzen wir die Option AllowOverride und setzen die Environment Variable für Codeigniter. | ||
| - | <code bash /etc/apache2/sites-enabled/fhcomplete-ssl.conf> | ||
| - | |||
| - | # Redirect für Caldav einrichten. Beim Einrichten des Caldav Clients ist es dadurch nicht nötig die volle URL | ||
| - | # Anzugeben sondern lediglich den Hostnamen | ||
| - | Redirect permanent /.well-known/caldav /webdav/lvplan.php/ | ||
| - | |||
| - | <Directory /var/www/html/> | ||
| - | Options Indexes FollowSymLinks MultiViews | ||
| - | | ||
| - | # AllowOverride auf AuthConfig und Limit setzen damit die Authentifizierung über .htaccess | ||
| - | # Dateien funktioniert | ||
| - | AllowOverride AuthConfig Limit | ||
| - | Order allow,deny | ||
| - | allow from all | ||
| - | |||
| - | # Environment fuer Codeigniter auf production setzen | ||
| - | SetEnv CI_ENV production | ||
| - | |||
| - | </Directory> | ||
| - | </code> | ||
| - | |||
| - | Damit die Änderungen übernommen werden starten wir den Apache neu: | ||
| - | <code> | ||
| - | systemctl restart apache2 | ||
| - | </code> | ||
| - | |||
| - | |||
| - | Private Temp deaktivieren - Damit Apache mit Systemd kein eigenes /tmp Verzeichnis erstellt muss das PrivateTmp deaktiviert werden da es sonst zu Problemen bei der Dokumentenerstellung kommt | ||
| - | |||
| - | <code> | ||
| - | cd /etc/systemd/system/ | ||
| - | mkdir apache2.service.d | ||
| - | cd apache2.service.d | ||
| - | vim nopt.conf | ||
| - | </code> | ||
| - | |||
| - | Die Datei hat folgenden Inhalt | ||
| - | <code /etc/systemd/system/apache2.service.d/nopt.conf> | ||
| - | [Service] | ||
| - | PrivateTmp=false | ||
| - | </code> | ||
| - | |||
| - | Damit die Änderungen übernommen werde muss der Daemon und Apache startet werden. | ||
| - | <code> | ||
| - | systemctl daemon-reload | ||
| - | systemctl restart apache2 | ||
| - | </code> | ||
| - | |||
| - | ===== LDAP Anbindung ===== | ||
| - | |||
| - | LDAP Modul in Apache aktivieren | ||
| - | <code> | ||
| - | a2enmod authnz_ldap | ||
| - | systemctl restart apache2 | ||
| - | </code> | ||
| - | |||
| - | LDAP Utils installation | ||
| - | <code> | ||
| - | apt install ldap-utils | ||
| - | </code> | ||
| - | |||
| - | Anpassung der LDAP Config unter /etc/ldap/ldap.conf | ||
| - | <code bash /etc/ldap/ldap.conf> | ||
| - | host ldap.example.com | ||
| - | base dc=example,dc=com | ||
| - | </code> | ||
| - | ===== FH-Complete Installation ===== | ||
| - | |||
| - | Zuerst stellen wir sicher dass Git und Composer installiert sind | ||
| - | <code> | ||
| - | apt install git composer | ||
| - | </code> | ||
| - | |||
| - | Danach laden wir den aktuellen FH-Complete Core und das LDAP Addon von GitHub. | ||
| - | <code> | ||
| - | cd /home/fhcomplete/ | ||
| - | mkdir git | ||
| - | cd git | ||
| - | git clone https://github.com/FH-Complete/FHC-Core.git FHC-Core | ||
| - | git clone https://github.com/FH-Complete/FHC-AddOn-LDAP.git FHC-AddOn-LDAP | ||
| - | </code> | ||
| - | |||
| - | Und kopieren den aktuellen Stand in das Webserver-Verzeichnis | ||
| - | <code> | ||
| - | rsync -ruv /home/fhcomplete/git/FHC-Core/* /var/www/html/ --exclude=".git" | ||
| - | rsync -ruv /home/fhcomplete/git/FHC-AddOn-LDAP/* /var/www/html/addons/ldap/ --exclude=".git" | ||
| - | </code> | ||
| - | |||
| - | Danach laden wir die nötigen Zusatzmodule per Composer nach | ||
| - | <code> | ||
| - | cd /var/www/html | ||
| - | composer install | ||
| - | </code> | ||
| - | |||
| - | |||
| - | Um die htaccess Dateien zentral zu verwalten erstellen wir einen eigenen Ordner und verlinken die .htaccess Dateien mit symbolischen Links | ||
| - | <code> | ||
| - | mkdir /var/fhcomplete | ||
| - | mkdir /var/fhcomplete/htaccess | ||
| - | cd /var/fhcomplete/htaccess | ||
| - | vim .htaccess | ||
| - | vim .htaccessrdf | ||
| - | </code> | ||
| - | |||
| - | <code bash /var/fhcomplete/htaccess/.htaccess> | ||
| - | AuthBasicProvider ldap | ||
| - | AuthName "FH Complete" | ||
| - | AuthType Basic | ||
| - | AuthLDAPURL "ldap://ldap.example.com:389/ou=People,dc=example,dc=com?uid?one?objectclass=posixAccount" STARTTLS | ||
| - | AuthLDAPGroupAttribute memberuid | ||
| - | AuthLDAPGroupAttributeIsDN Off | ||
| - | Require valid-user | ||
| - | </code> | ||
| - | |||
| - | <code bash /var/fhcomplete/htaccess/.htaccessrdf> | ||
| - | Order deny,allow | ||
| - | Deny from all | ||
| - | Allow from 127.0.0.1 | ||
| - | AuthBasicProvider ldap | ||
| - | AuthName "FH Complete" | ||
| - | AuthType Basic | ||
| - | AuthLDAPURL "ldap://ldap.example.com:389/ou=People,dc=example,dc=com?uid?one?objectclass=posixAccount" STARTTLS | ||
| - | AuthLDAPGroupAttributeIsDN Off | ||
| - | AuthLDAPGroupAttribute memberuid | ||
| - | require valid-user | ||
| - | satisfy any | ||
| - | </code> | ||
| - | |||
| - | <code> | ||
| - | cd /var/www/html/cis/private/ | ||
| - | ln -s /var/fhcomplete/htaccess/.htaccess .htaccess | ||
| - | |||
| - | cd /var/www/html/vilesci/ | ||
| - | ln -s /var/fhcomplete/htaccess/.htaccess .htaccess | ||
| - | |||
| - | cd /var/www/html/system/ | ||
| - | ln -s /var/fhcomplete/htaccess/.htaccess .htaccess | ||
| - | |||
| - | cd /var/www/html/content/ | ||
| - | ln -s /var/fhcomplete/htaccess/.htaccess .htaccess | ||
| - | |||
| - | cd /var/www/html/rdf/ | ||
| - | ln -s /var/fhcomplete/htaccess/.htaccessrdf .htaccess | ||
| - | </code> | ||
| - | |||
| - | Damit die Installation der Extensions funktioniert müssen Schreibrechte für bestimmte Ordner gesetzt werden: | ||
| - | <code> | ||
| - | cd /var/www/html/ | ||
| - | |||
| - | chgrp www-data application/tmp/ application/config/extensions/ application/controllers/extensions/ application/helpers/extensions/ application/hooks/extensions/ application/libraries/extensions/ application/models/extensions/ application/views/extensions/ application/widgets/extensions/ | ||
| - | |||
| - | chmod 775 application/tmp/ application/config/extensions/ application/controllers/extensions/ application/helpers/extensions/ application/hooks/extensions/ application/libraries/extensions/ application/models/extensions/ application/views/extensions/ application/widgets/extensions/ | ||
| - | </code> | ||
| - | |||
| - | Als nächstes erstellen wir die nötigen Konfigurationsdateien. | ||
| - | <code> | ||
| - | cd /var/www/html/config/ | ||
| - | cp global.config-default.inc.php global.config.inc.php | ||
| - | cp vilesci.config-default.inc.php vilesci.config.inc.php | ||
| - | </code> | ||
| - | |||
| - | Im Vilesci Config müssen folgende Einträge zwingend angepasst werden: | ||
| - | <code> | ||
| - | define("DB_HOST","db.example.com"); | ||
| - | define("DB_NAME","fhcomplete"); | ||
| - | define("DB_PASSWORD","PASSWORT"); | ||
| - | |||
| - | define('APP_ROOT','https://fhcomplete.example.com/'); | ||
| - | define('XML_ROOT','https://fhcomplete.example.com/rdf/'); | ||
| - | |||
| - | define("AUTH_SYSTEM", "auth_mixed"); | ||
| - | define("AUTH_NAME","FH Complete"); // gleiche Bezeichnung wie AuthName im htaccess | ||
| - | |||
| - | define('LDAP_SERVER','ldap://ldap.example.com'); | ||
| - | define('LDAP_BASE_DN','ou=People,dc=example,dc=com'); | ||
| - | define('MAIL_DEBUG',''); // Entrag entfernen da sonst alle Mails an diese Addresse gesendet werden | ||
| - | |||
| - | </code> | ||
| - | |||
| - | ===== Mailversand einrichten ===== | ||
| - | ===== Dokumentenerstellung einrichten ===== | ||
| - | |||