Benutzer-Werkzeuge

Webseiten-Werkzeuge


software:middleware:installation

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
software:middleware:installation [2019/03/18 12:48] – Apache Rewrite jausoftware:middleware:installation [2023/03/27 21:14] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
- +====== Installation der Middleware ======
-===== Installation der Middleware =====+
  
 This installs the middleware and the frontend. You also need to install the logger (vzlogger). This installs the middleware and the frontend. You also need to install the logger (vzlogger).
  
-==== Voraussetzungen ==== +===== Voraussetzungen ===== 
-  * PHP 7.(nicht verfügbar in Raspbian Stretch!)+  * PHP 7.3 (z.B. debian ab Buster (10))
   * Doctrine 2.5   * Doctrine 2.5
-  * MySQL, MariaDB, PostgreSQL oder SQLite + PDO Treiber+  * MySQL, MariaDB + PDO Treiber
   * APC (optional, aber empfohlen)   * APC (optional, aber empfohlen)
-  * jpGraph (optional, zum Plotten von PNG Grafiken) +  * Apache, nginx (optional)
-  * Apache mod_rewrite (optional)+
  
-Es eigenen sich hier Debian oder Ubuntu, sowie für den Raspberry Pi: Raspbian oder Raspbian Light.("Buster"-Version, oder "Stretch" mit PHP Update)\\+Es eignen sich hier Debian oder Ubuntu, sowie für den Raspberry Pi: Raspbian oder Raspbian Light.("Bullseye"-Version mit PHP 7.4)\\
 Die Abhängigkeiten lassen sich schnell mit folgendem Befehl installieren: Die Abhängigkeiten lassen sich schnell mit folgendem Befehl installieren:
-<code>sudo apt-get install git-core libapache2-mod-php7.1 php7.1-cli php7.1-mysql php-apcu mysql-server mysql-client php7.1-xml php-mbstring ca-certificates apache2+<code>sudo apt-get install git php-cli php-mysql php-apcu mariadb-server mariadb-client php-xml php-mbstring php7.4-opcache php-common ca-certificates zip unzip php-zip apt-transport-https php-curl apache2
 </code> </code>
-bzw. für PostgreSQL  
-<code>apt-get install git-core libapache2-mod-php7.1 php7.1-cli php7.1-pgsql php-apcu postgresql-8.4</code> 
  
 Für die manuelle Installation wird zudem "curl" benötigt. Für die manuelle Installation wird zudem "curl" benötigt.
Zeile 26: Zeile 22:
  
  
-==== Install-Skript (empfohlene Installationsmethode) ====+===== Install-Skript (empfohlene Methode=====
 <code> <code>
 wget https://raw.github.com/volkszaehler/volkszaehler.org/master/bin/install.sh wget https://raw.github.com/volkszaehler/volkszaehler.org/master/bin/install.sh
Zeile 35: Zeile 31:
  
 Das sollte dann ablaufen: Das sollte dann ablaufen:
 +[Bitte unbedingt ein Passwort für den vz-admin-User vergeben!]
  
 <code> <code>
Zeile 50: Zeile 47:
  git: /usr/bin/git  git: /usr/bin/git
  
-checking php version: 7.3.2-3 >= 7.1, ok+checking php version: 7.3.3-1 >= 7.1, ok
  
 volkszaehler setup... volkszaehler setup...
Zeile 56: Zeile 53:
 git clone volkszaehler.org into /home/pi/volkszaehler.org git clone volkszaehler.org into /home/pi/volkszaehler.org
 Cloning into '/home/pi/volkszaehler.org'... Cloning into '/home/pi/volkszaehler.org'...
-remote: Counting objects: 11087, done. +remote: Enumerating objects: 4, done. 
-remote: Compressing objects: 100% (11/11), done. +remote: Counting objects: 100% (4/4), done. 
-remote: Total 11087 (delta 5), reused (delta 3), pack-reused 11073 +remote: Compressing objects: 100% (4/4), done. 
-Receiving objects: 100% (11087/11087), 7.19 MiB | 2.61 MiB/s, done. +remote: Total 11981 (delta 0), reused (delta 0), pack-reused 11977 
-Resolving deltas: 100% (6085/6085), done.+Receiving objects: 100% (11981/11981), 7.51 MiB | 752.00 KiB/s, done. 
 +Resolving deltas: 100% (6760/6760), done.
 link from webserver to volkszaehler directory? [/var/www/volkszaehler.org] link from webserver to volkszaehler directory? [/var/www/volkszaehler.org]
 linking /var/www/volkszaehler.org to /home/pi/volkszaehler.org linking /var/www/volkszaehler.org to /home/pi/volkszaehler.org
  
 checking composer... checking composer...
-/home/pi/volkszaehler.org /home/pi +composer: /usr/local/bin/composer
-composer not found, downloading... +
-All settings correct for using Composer +
-Downloading... +
- +
-Composer (version 1.5.2) successfully installed to: /var/www/volkszaehler.org/composer.phar +
-Use it: php composer.phar +
- +
-/home/pi +
-composer: /home/pi/volkszaehler.org/composer.phar+
  
 installing dependencies... installing dependencies...
-/home/pi/volkszaehler.org /home/pi+~/volkszaehler.org ~
 Loading composer repositories with package information Loading composer repositories with package information
 Updating dependencies Updating dependencies
-Package operations: 40 installs, 0 updates, 0 removals +Package operations: 52 installs, 0 updates, 0 removals 
-  - Installing psr/log (1.0.2): Downloading (100%) +  - Installing symfony/routing (v4.2.4): Downloading (100%) 
-  - Installing symfony/debug (v3.3.9): Downloading (100%) +  - Installing symfony/polyfill-mbstring (v1.11.0): Downloading (100%) 
-  - Installing symfony/polyfill-mbstring (v1.5.0): Downloading (100%) +  - Installing symfony/http-foundation (v4.2.4): Downloading (100%) 
-  - Installing symfony/console (v3.3.9): Downloading (100%)+  - Installing ralouphie/getallheaders (2.0.5): Downloading (100%) 
 +  - Installing psr/http-message (1.0.1): Downloading (100%) 
 +  - Installing guzzlehttp/psr7 (1.5.2): Downloading (100%) 
 +  - Installing react/promise (v2.7.1): Downloading (100%) 
 +  - Installing react/event-loop (v1.1.0): Downloading (100%) 
 +  - Installing react/promise-timer (v1.5.0): Downloading (100%) 
 +  - Installing evenement/evenement (v3.0.1): Downloading (100%) 
 +  - Installing react/stream (v1.1.0): Downloading (100%) 
 +  - Installing react/cache (v0.5.0): Downloading (100%) 
 +  - Installing react/dns (v0.4.16): Downloading (100%) 
 +  - Installing react/socket (v1.2.0): Downloading (100%) 
 +  - Installing ratchet/rfc6455 (0.2.4): Downloading (100%) 
 +  - Installing cboden/ratchet (v0.4.1): Downloading (100%) 
 +  - Installing symfony/contracts (v1.0.2): Downloading (100%) 
 +  - Installing symfony/console (v4.2.4): Downloading (100%) 
 +  - Installing doctrine/instantiator (1.2.0): Downloading (100%) 
 +  - Installing doctrine/event-manager (v1.0.0): Downloading (100%) 
 +  - Installing doctrine/cache (v1.8.0): Downloading (100%) 
 +  - Installing doctrine/dbal (v2.9.2): Downloading (100%)
   - Installing doctrine/lexer (v1.0.1): Downloading (100%)   - Installing doctrine/lexer (v1.0.1): Downloading (100%)
-  - Installing doctrine/inflector (v1.2.0): Downloading (100%) +  - Installing doctrine/annotations (v1.6.0): Downloading (100%) 
-  - Installing doctrine/collections (v1.4.0): Downloading (100%) +  - Installing doctrine/reflection (v1.0.0): Downloading (100%) 
-  - Installing doctrine/cache (v1.6.2): Downloading (100%) +  - Installing doctrine/collections (v1.6.0): Downloading (100%) 
-  - Installing doctrine/annotations (v1.4.0): Downloading (100%) +  - Installing doctrine/persistence (v1.1.0): Downloading (100%) 
-  - Installing doctrine/common (v2.7.3): Downloading (100%) +  - Installing doctrine/inflector (v1.3.0): Downloading (100%) 
-  - Installing doctrine/dbal (v2.5.13): Downloading (100%) +  - Installing doctrine/common (v2.10.0): Downloading (100%) 
-  - Installing andig/dbcopy (dev-master 94a72ce): Cloning 94a72ce582 from cache +  - Installing doctrine/orm (v2.6.3): Downloading (100%) 
-  - Installing symfony/routing (v3.3.9): Downloading (100%) +  - Installing symfony/polyfill-ctype (v1.11.0): Downloading (100%) 
-  - Installing symfony/http-foundation (v3.3.9): Downloading (100%) +  - Installing symfony/yaml (v4.2.4): Downloading (100%) 
-  - Installing react/promise (v2.5.1): Downloading (100%) +  - Installing guzzlehttp/promises (v1.3.1): Downloading (100%) 
-  - Installing evenement/evenement (v2.0.0): Downloading (100%) +  - Installing guzzlehttp/guzzle (6.3.3): Downloading (100%) 
-  - Installing react/stream (v0.4.6): Downloading (100%) +  - Installing influxdb/influxdb-php (1.14.7): Downloading (100%) 
-  - Installing react/event-loop (v0.4.3): Downloading (100%) +  - Installing symfony/event-dispatcher (v4.2.4): Downloading (100%) 
-  - Installing react/socket (v0.5.1): Downloading (100%) +  - Installing andig/dbcopy (1.3): Downloading (100%) 
-  - Installing psr/http-message (1.0.1): Downloading (100%) +  - Installing andig/php-shunting-yard (1.0.2): Downloading (100%) 
-  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%) +  - Installing react/promise-stream (v1.1.1): Downloading (100%) 
-  - Installing ratchet/rfc6455 (v0.2.3): Downloading (100%) +  - Installing ringcentral/psr7 (1.2.2): Downloading (100%) 
-  - Installing cboden/ratchet (v0.4): Downloading (100%) +  - Installing react/http (v0.8.4): Downloading (100%) 
-  - Installing react/promise-stream (v0.1.1): Downloading (100%) +  - Installing http-interop/http-middleware (0.5.0): Downloading (100%) 
-  - Installing ringcentral/psr7 (1.2.1): Downloading (100%) +  - Installing psr/log (1.1.0): Downloading (100%) 
-  - Installing react/http (dev-master cd15204): Cloning cd15204bd1 from cache +  - Installing symfony/debug (v4.2.4): Downloading (100%) 
-  - Installing paragonie/random_compat (v2.0.11): Downloading (100%) +  - Installing symfony/http-kernel (v4.2.4): Downloading (100%) 
-  - Installing monolog/monolog (1.23.0): Downloading (100%) +  - Installing paragonie/random_compat (v9.99.99): Downloading (100%) 
-  - Installing react/promise-timer (v1.2.0): Downloading (100%) +  - Installing monolog/monolog (1.24.0): Downloading (100%) 
-  - Installing react/cache (v0.4.1): Downloading (100%) +  - Installing react/child-process (v0.5.2): Downloading (100%) 
-  - Installing react/dns (v0.4.11): Downloading (100%) +  - Installing symfony/process (v4.2.4): Downloading (100%) 
-  - Installing react/socket-client (v0.5.3): Downloading (100%) +  - Installing php-pm/php-pm (1.0.5): Downloading (100%) 
-  - Installing symfony/process (v3.3.9): Downloading (100%) +  - Installing php-pm/httpkernel-adapter (1.0.6): Downloading (100%) 
-  - Installing mkraemer/react-pcntl (v2.0.0): Downloading (100%) +  - Installing webpatser/laravel-uuid (3.0.2): Downloading (100%) 
-  - Installing php-pm/php-pm (dev-master 5a883f4): Cloning 5a883f48f0 from cache +Package http-interop/http-middleware is abandoned, you should avoid using it. Use http-interop/http-server-middleware instead.
-  - Installing symfony/event-dispatcher (v3.3.9): Downloading (100%) +
-  - Installing symfony/http-kernel (v3.3.9): Downloading (100%) +
-  - Installing php-pm/httpkernel-adapter (dev-master b373b03): Cloning b373b0384f from cache +
-  - Installing doctrine/instantiator (1.0.5): Downloading (100%) +
-  - Installing doctrine/orm (v2.5.11): Downloading (100%)+
 Writing lock file Writing lock file
 Generating autoload files Generating autoload files
- +~
-/home/pi+
  
 volkszaehler.org is not configured yet. creating new config from sample config file. volkszaehler.org is not configured yet. creating new config from sample config file.
-mysql admin user? [root] +mysql root user? [root] 
-mysql admin password? [] raspberry+mysql root password? [] raspberry
 mysql database? [volkszaehler] mysql database? [volkszaehler]
 +mysql admin to volkszaehler database? [vz-admin]
 +mysql admin password? [] secure
 mysql user? [vz] mysql user? [vz]
 mysql password? [demo] mysql password? [demo]
-mysql admin to volkszaehler datdabase? [vz-admin] 
-mysql admin password? [secure] 
  
 create volkszaehler.org database and admin user? [y] create volkszaehler.org database and admin user? [y]
 creating database volkszaehler... creating database volkszaehler...
-ATTENTIONThis operation should not be executed in a production environment.+Enter password{root password (raspberry)}
 creating db user vz-admin... creating db user vz-admin...
-Creating database schema... +Enter password: {root password (raspberry)} 
-/home/pi/volkszaehler.org /home/pi +creating database schema... 
-Processing entity "Volkszaehler\Model\Aggregate" +~/volkszaehler.org ~
-Processing entity "Volkszaehler\Model\Entity" +
-Processing entity "Volkszaehler\Model\Channel" +
-Processing entity "Volkszaehler\Model\Data" +
-Processing entity "Volkszaehler\Model\Property" +
-Processing entity "Volkszaehler\Model\Aggregator" +
-Database schema created successfully!+
  
-Proxy classes generated to "/home/pi/volkszaehler.org/lib/Model/Proxy" + ! 
-/home/pi+ ! [CAUTION] This operation should not be executed in a production environment! 
 + ! 
 + 
 + Creating database schema... 
 + 
 + 
 + [OK] Database schema created successfully! 
 + 
 + 
 + 
 + Processing entity "Volkszaehler\Model\Aggregate" 
 + Processing entity "Volkszaehler\Model\Entity" 
 + Processing entity "Volkszaehler\Model\Channel" 
 + Processing entity "Volkszaehler\Model\Property" 
 + Processing entity "Volkszaehler\Model\Aggregator" 
 + Processing entity "Volkszaehler\Model\Data" 
 + 
 + Proxy classes generated to "/home/pi/volkszaehler.org/lib/Model/Proxy" 
 +~
  
 create volkszaehler.org database user? [y] create volkszaehler.org database user? [y]
Zeile 164: Zeile 177:
 Das Script fragt, was es wohin installieren soll. Das Script fragt, was es wohin installieren soll.
  
-=== Apache unter Debian "Jessie" und "Stretch" konfigurieren ===+===== Webserver einrichten ===== 
 +Im Folgenden sind 3 mögliche Serverkonfigurationen beschrieben. Für Kompatibiltät mit alten Scripts und Konfigurationen empfehlen wir bei PPM zusätzlich einen Proxy einzurichten. 
 + 
 +==== PPM als Server (empfohlene Methode) ==== 
 +Der PPM-Webserver auf Basis von PHP läuft wesentlich Performanter als Apache2 und ist gerade auf schwacher Hardware wie RaspberryPi zu empfehlen. In Standardkonfiguration bedient er Anfragen auf Port 8080. 
 + 
 +  - Systemd Service einrichten ''sudo nano /etc/systemd/system/middleware.service''<code> 
 +[Unit] 
 +Description=Volkszaehler.org Middleware 
 +After=syslog.target network.target mysql.service 
 +Requires= 
 + 
 +[Service] 
 +ExecStart=/usr/bin/php /var/www/volkszaehler.org/vendor/bin/ppm start -c /var/www/volkszaehler.org/etc/middleware.json --cgi-path=/usr/bin/php 
 +ExecReload=/bin/kill -HUP $MAINPID 
 +StandardOutput=journal 
 +Restart=always 
 + 
 +[Install] 
 +WantedBy=multi-user.target </code> 
 +  - Server Konfiguration anpassen  
 +    - ''nano ~/volkszaehler.org/etc/middleware.json'' 
 +    - ändern: ''"static-directory": "/var/www/volkszaehler.org/htdocs",'' 
 +  - Middleware Weiterleitung ''url'' anpassen ''nano ~/volkszaehler.org/htdocs/js/options.js'' <code> 
 +title: 'Local (default)', 
 +url: '' 
 +//live: 8082</code> 
 +  - Systemd Service bei boot aktiveren ''sudo systemctl enable middleware'' 
 +  - Systemd Service starten ''sudo systemctl start middleware'' 
 + 
 +<note important>Wird kein Proxy installiert, wie in den nächsten Sektionen empfohlen, gibt es den Pfad http://localhost/middleware.php nicht, der in vielen Beispielkonfigurationen auf dieser Webseite verwendet wird! Stattdessen muss http://localhost/ verwendet werden.</note>  
 +==== Apache als Proxy (empfohlene Methode) ==== 
 +Dazu Apache auf die Weiterleitung zum PPM reduzieren. 
 +  - Module aktivieren<code> 
 +sudo a2enmod proxy 
 +sudo a2enmod proxy_http 
 +sudo a2enmod rewrite</code> 
 +  - Rewrite-Proxy aktivieren, ''nano ~/volkszaehler.org/htdocs/.htaccess''. Die Kommentarzeichen vor den Zeilen entfernen und Zeile 16 hinzufügen:<code> 
 +<IfModule mod_proxy.c> 
 + RewriteEngine On 
 + RewriteRule ^middleware(.php)?(/.*)? http://localhost:8080$2 [P] 
 + RewriteRule ^api(/.*)? http://localhost:8080$1 [P] 
 +        RewriteRule (.*) http://localhost:8080/$1 [P] 
 +</IfModule> 
 +</code> 
 +  - Default VirtualHost bearbeiten: ''sudo nano /etc/apache2/sites-enabled/000-default.conf''. Dort ''< DocumentRoot >'' suchen und ändern: <code> 
 +        DocumentRoot /var/www/volkszaehler.org/htdocs/ 
 +</code> 
 +  - Apache Config bearbeiten um Rewrite in .htaccess zu erlauben: ''sudo nano /etc/apache2/apache2.conf'' In der Datei den Abschnitt suchen: <code> 
 +<Directory /var/www/> 
 +        Options Indexes FollowSymLinks 
 +        AllowOverride None 
 +        Require all granted 
 +</Directory> 
 +</code>''AllowOverride None'' in ''AllowOverride All AuthConfig'' ändern.\\ 
 +  - Dann den Apache nur noch neu starten ''sudo systemctl restart apache2'' 
 + 
 +==== Alternativ: nginx als Proxy ==== 
 +Nginx ist ein schlanker Webserver/Proxy dessen Konfiguration sehr zentral erfolgt, was der Performance zu gute kommt. Er ist als Proxy für den Betrieb eines Volkszählers nicht zwingend nötig (PPM kann das gut alleine), bietet aber Abwärtskompatibilität für bestehende Scripte und Anwendungen. 
 + 
 +<code> 
 +sudo apt install nginx 
 +sudo rm /etc/nginx/sites-enabled/default 
 +sudo nano /etc/nginx/sites-available/volkszaehler 
 +</code> 
 +In diese wird eingefügt: 
 +<code> 
 +# Volkszaehler 
 + 
 +include /etc/nginx/proxy_params; 
 + 
 +server { 
 +  listen 80; 
 +  listen [::]:80; 
 +  server_name volkszaehler.org; 
 + 
 +  location / { 
 +    proxy_pass http://127.0.0.1:8080; 
 +    include /etc/nginx/proxy_params; 
 +  } 
 + 
 +  location /middleware { 
 +    rewrite ^/middleware(.php)?(/.*)? $2; 
 +    proxy_pass http://127.0.0.1:8080/; 
 +  } 
 + 
 +  location /api { 
 +    rewrite ^/api(/.*)? $1; 
 +    proxy_pass http://127.0.0.1:8080/; 
 +  } 
 + 
 +  location /frontend { 
 +    rewrite ^/frontend/(.*) $1; 
 +    proxy_pass http://127.0.0.1:8080/; 
 +  } 
 + 
 +# Konfigurationsbeispiel für eigene PHP-Scripte, 
 +# von nginx unter http://127.0.0.1/addapp/ bereitgestellt, lokal unter /var/www/html/ abgelegt. 
 +
 +#  location /addapp/ { 
 +#    alias /var/www/html/; 
 +#    index index.nginx-debian.html; 
 +#       
 +#    location ~ \.php { 
 +#      include snippets/fastcgi-php.conf; 
 +#      fastcgi_param SCRIPT_FILENAME $request_filename; 
 +#      fastcgi_pass unix:/var/run/php/php7.3-fpm.sock; 
 +#    } 
 +#  } 
 +
 +</code> 
 +<note>Möchte man eigene PHP-Scripte neben Volkszähler bereit stellen ist das das Paket php-fpm nötig. 
 + 
 +Installieren mit ''sudo apt-get install php-fpm'' und darauf achten das in der nginx-Konfiguration bei ''/var/run/php/php7.3-fpm.sock'' auf die korrekte, vorhandene Datei verwiesen wird.</note> 
 +Damit der nginx die Config lädt: 
 +<code> 
 +sudo ln -s /etc/nginx/sites-available/volkszaehler /etc/nginx/sites-enabled/volkszaehler 
 +</code> 
 +Dann nur noch Starten und in Bootprozess einbinden: 
 +<code> 
 +sudo systemctl start nginx 
 +sudo systemctl enable nginx 
 +</code> 
 + 
 +==== Alternativ: Apache als Server (unter Debian "Stretch"===
 +<note>Möchte man von PPM auf Apache als Server umstellen sind auch die Änderungen an der Middleware-Konfiguration für PPM zurück zu nehmen: ''url: 'api' ''</note> 
 +  * Pakete installieren ''sudo apt-get install apache2 libapache2-mod-php''
   * mod_rewrite aktivieren: ''sudo a2enmod rewrite''   * mod_rewrite aktivieren: ''sudo a2enmod rewrite''
   * Default VirtualHost bearbeiten: ''sudo nano /etc/apache2/sites-enabled/000-default.conf''   * Default VirtualHost bearbeiten: ''sudo nano /etc/apache2/sites-enabled/000-default.conf''
Zeile 187: Zeile 326:
 Sollte es zu einem PHP Fehler beim Anlegen der Datenbank kommen versucht mal Doctrine per Hand zu Installieren. Sollte es zu einem PHP Fehler beim Anlegen der Datenbank kommen versucht mal Doctrine per Hand zu Installieren.
  
-==== Manuelle Installation ==== +==== Alternativ: nginx als Server ==== 
- +<note>Möchte man von PPM auf nginx als Server umstellen sind auch die Änderungen an der Middleware-Konfiguration für PPM zurück zu nehmen''url'api' ''.</note>
-=== Download der volkszaehler.org Skripte === +
-Download der Skripte aus dem git Repository: +
-<code> +
-git clone git://github.com/volkszaehler/volkszaehler.org.git ~/volkszaehler.org +
-sudo ln -sf ~/volkszaehler.org /var/www/volkszaehler.org +
-sudo chown -R www-data /var/www/volkszaehler.org +
-</code> +
- +
-=== Apache konfigurieren === +
-  * mod_rewrite aktivieren: +
-<code> +
-sudo a2enmod rewrite +
-</code> +
- +
-  * Default VirtualHost bearbeiten: +
-<code> +
-/etc/apache2/sites-enabled/000-default: +
-    DocumentRoot /var/www/volkszaehler.org/htdocs/ +
-</code> +
- +
-  * unter <Directory /var/www/>: +
-<code> +
-AllowOverride FileInfo Limit Options Indexes Authconfig +
-</code> +
- +
-=== Alternativ: nginx konfigurieren ===+
 <code> <code>
 server { server {
Zeile 230: Zeile 343:
         location ~ \.php {         location ~ \.php {
                 include snippets/fastcgi-php.conf;                 include snippets/fastcgi-php.conf;
-        #       # With php5-cgi alone:+        #       # With php7-cgi alone:
         #       fastcgi_pass 127.0.0.1:9000;         #       fastcgi_pass 127.0.0.1:9000;
-                # With php5-fpm: +                # With php7-fpm: 
-                fastcgi_pass unix:/var/run/php5-fpm.sock;+                fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
         }         }
 } }
 </code> </code>
 +<note>Darauf achten das in der nginx-Konfiguration bei ''/var/run/php/php7.3-fpm.sock'' auf die korrekte, vorhandene Datei verwiesen wird.</note>
  
-Wichtig ist dass in der config in der Zeile "location ~ \.php {" kein $-Zeichen hinter dem PHP steht. Siehe [[http://volkszaehler.org/pipermail/volkszaehler-dev/2011-June/000925.html|Mail Archiv]]+Wichtig ist dass in der config in der Zeile "location ~ \.php {" kein $-Zeichen hinter dem PHP steht. Siehe [[https://lists.volkszaehler.org/pipermail/volkszaehler-dev/2011-June/000925.html|Mail Archiv]]
  
 +==== Alternativ: Lighttpd als Server ====
 +Notwendige Rewrite-Regeln:
 +<code>
 +    url.rewrite-if-not-file = (
 +        "^/(?:middleware|api)(/.*)?" => "/middleware.php$1",
 + "^/frontend/(.*)" => "$1"
 +    )
 +</code>
 +
 +
 +===== Manuelle Installation =====
 +
 +=== Download der volkszaehler.org Skripte ===
 +Download der Skripte aus dem git Repository:
 +<code>
 +git clone git://github.com/volkszaehler/volkszaehler.org.git ~/volkszaehler.org
 +sudo ln -sf ~/volkszaehler.org /var/www/volkszaehler.org
 +sudo chown -R www-data /var/www/volkszaehler.org
 +</code>
  
 === Installation der benötigten Module === === Installation der benötigten Module ===
Zeile 262: Zeile 395:
 <code> <code>
 cd /var/www/volkszaehler.org/etc/ cd /var/www/volkszaehler.org/etc/
-cp volkszaehler.conf.template.php volkszaehler.conf.php +cp config.dist.yaml config.yaml 
-edit volkszaehler.conf.php+</code> 
-    $config['db']['host'              = 'localhost'; +edit config.yaml
-    $config['db']['user'              = 'vz'; +<code> 
-    $config['db']['password'          = '<shhh!>'; +db
-    $config['db']['dbname'            = 'volkszaehler';+  host: 127.0.0.1 
 +  port: 3306 
 +  uservz 
 +  password: demo 
 +  dbnamevolkszaehler
 </code> </code>
  
Zeile 273: Zeile 410:
  
 === Datenbank konfigurieren === === Datenbank konfigurieren ===
-  * Datenbank-User anlegen:+  * Datenbank anlegen: 
 +<code> 
 +mysql: 
 +    CREATE DATABASE `volkszaehler`; 
 +     
 +oder phpmyadmin: 
 +    Home -> "Datenbank anlegen", Name"volkszaehler" -> "Anlegen"  ​ 
 +</code>
  
 +  * Datenbank-User anlegen:
 <code> <code>
-phpmyadmin:+mysql: 
 +    GRANT ALL ON volkszaehler.* to 'vz_admin'@'localhost' IDENTIFIED BY '<shhhh!>' WITH GRANT OPTION; 
 +    CREATE USER 'vz'@'localhost' IDENTIFIED BY '<shhhh!>'; 
 +    GRANT USAGE ON volkszaehler.* TO 'vz'@'localhost'; 
 +    GRANT SELECT, UPDATE, INSERT ON volkszaehler.* TO 'vz'@'localhost'; 
 +         
 +oder phpmyadmin: 
 +    Home -> "Rechte" -> "Neuen Benutzer hinzufügen" 
 +        Benutzername: vz_admin 
 +        Host: localhost 
 +        Passwort: <shhh!> 
 +        Vollzugriff (Grant All) auf DB volkszaehler erlauben. 
 +        -> ok
     Home -> "Rechte" -> "Neuen Benutzer hinzufügen"     Home -> "Rechte" -> "Neuen Benutzer hinzufügen"
         Benutzername: vz         Benutzername: vz
Zeile 283: Zeile 440:
         keine globalen Rechte vergeben!         keine globalen Rechte vergeben!
         -> ok         -> ok
-oder: 
-    CREATE USER 'vz'@'localhost' IDENTIFIED BY '<shhhh!>'; 
-</code> 
- 
-  * Datenbank anlegen: 
-<code> 
-phpmyadmin 
-    Home -> "Datenbank anlegen", Name: "volkszaehler" -> "Anlegen" 
-oder: 
-    CREATE DATABASE `volkszaehler`; 
 </code> </code>
  
-  * Tabellen anlegen:+ * Tabellen anlegen:
 <code> <code>
 # cd /var/www/volkszaehler.org/ # cd /var/www/volkszaehler.org/
Zeile 337: Zeile 484:
 </code> </code>
  
-===== Aktualisierung der Middleware einschließlich des Frontends =====+=== Webserver === 
 +Wie bereits [[/software/middleware/installation#webserver_einrichten|weiter oben]] beschrieben. 
 + 
 +====== Aktualisierung der Middleware einschließlich des Frontends ======
  
-Nachdem Volkszähler im Zuge der Installation eine Kopie des git Repositories erstellt, kann die Installation auch aus diesem Repository aktualisiert werden.+Wenn nur die ''./etc/config.yaml'' angepasst kann wieder das [[software:middleware:installation#install-skript_empfohlene_methode|Installationsskript]] von oben verwendet werden. Da die Datenbank vermutlich nicht angetastet werden soll, die entsprechenden Fragen einfach verneinen.
  
-Eine Beschreibung findet sich im Kapitel zu [[/howto/git]].+Nachdem Volkszähler im Zuge der Installation eine Kopie des git Repositories erstellt, kann die Installation aber auch aus diesem Repository aktualisiert werden. Eine Beschreibung findet sich im Kapitel zu [[/howto/git]]. Beim Image ist dies der notwendige Weg weil da auch andere Dateien editiert wurden.
  
  
-===== phpMyAdmin installieren =====+====== phpMyAdmin installieren =====
 +<note>Statt phpMyAdmin empfehlen wir derzeit einen lokalen Client wie z.B. [[https://www.heidisql.com|HeidiSQL]]</note>
 <note important>Für Vollzugriff auf die Volkszählerdatenbank über phpMyAdmin haben wir den User ''vz-admin''. Standardpasswort: ''secure''</note> <note important>Für Vollzugriff auf die Volkszählerdatenbank über phpMyAdmin haben wir den User ''vz-admin''. Standardpasswort: ''secure''</note>
 MySQL-Superuser ist: ''root'' und das Standardpasswort: ''raspberry''\\ MySQL-Superuser ist: ''root'' und das Standardpasswort: ''raspberry''\\
software/middleware/installation.1552909715.txt.gz · Zuletzt geändert: 2019/03/18 12:48 von jau