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
Nächste ÜberarbeitungBeide Seiten der Revision
software:middleware:installation [2018/12/14 07:46] – "langhaarschneider" entfernt jausoftware:middleware:installation [2019/04/27 16:05] – nginx Proxy Konfig, systemd Folge unwichtig jau
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.(bringt Rasbian Stretch schon mit)+  * PHP 7.(nicht verfügbar in Raspbian Stretch!)
   * Doctrine 2.5   * Doctrine 2.5
   * MySQL, MariaDB, PostgreSQL oder SQLite + PDO Treiber   * MySQL, MariaDB, PostgreSQL oder SQLite + PDO Treiber
   * APC (optional, aber empfohlen)   * APC (optional, aber empfohlen)
-  * jpGraph (optionalzum Plotten von PNG Grafiken) +  * nginx, Apache (optional)
-  * Apache mod_rewrite (optional)+
  
-Es eigenen sich hier Debian oder Ubuntu, sowie für den Raspberry Pi: Raspbian oder Raspbian Light.( "Stretch"-Version)\\+Es eigenen sich hier Debian oder Ubuntu, sowie für den Raspberry Pi: Raspbian oder Raspbian Light.("Buster"-Version, oder "Stretch" mit PHP Update)\\
 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.0 php7.0-cli php7.0-mysql php-apcu mysql-server mysql-client php7.0-xml php-mbstring ca-certificates apache2+<code>sudo apt-get install git-core php-cli php-mysql php-apcu mysql-server mysql-client php-xml php-mbstring ca-certificates 
 </code> </code>
 bzw. für PostgreSQL  bzw. für PostgreSQL 
-<code>apt-get install git-core libapache2-mod-php7.0 php7.0-cli php7.0-pgsql php-apcu postgresql-8.4</code>+<code>sudo apt-get install git-core php-cli php-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.
 +<note>Wie man unter Raspian/Debian auf einer neuere PHP-Version >=7.1 kommt ist unter [[/howto/building_raspberry_pi_image_for_vz]] beschrieben. Nur für erfahrene User!</note>
  
 ==== Vollautomatisiert mit Ansible und DebOps ==== ==== Vollautomatisiert mit Ansible und DebOps ====
Zeile 26: Zeile 26:
  
  
-==== 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 50: Zeile 50:
  git: /usr/bin/git  git: /usr/bin/git
  
-checking php version: 7.0.19-1 >= 7.0, ok+checking php version: 7.3.3-1 >= 7.1, ok
  
 volkszaehler setup... volkszaehler setup...
Zeile 56: Zeile 56:
 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 doctrine/lexer (v1.0.1): Downloading (100%) +
-  - Installing doctrine/inflector (v1.2.0): Downloading (100%) +
-  - Installing doctrine/collections (v1.4.0): Downloading (100%) +
-  - Installing doctrine/cache (v1.6.2): Downloading (100%) +
-  - Installing doctrine/annotations (v1.4.0): Downloading (100%) +
-  - Installing doctrine/common (v2.7.3): Downloading (100%) +
-  - Installing doctrine/dbal (v2.5.13): Downloading (100%) +
-  - Installing andig/dbcopy (dev-master 94a72ce): Cloning 94a72ce582 from cache +
-  - Installing symfony/routing (v3.3.9): Downloading (100%) +
-  - Installing symfony/http-foundation (v3.3.9): Downloading (100%) +
-  - Installing react/promise (v2.5.1): Downloading (100%) +
-  - Installing evenement/evenement (v2.0.0): Downloading (100%) +
-  - Installing react/stream (v0.4.6): Downloading (100%) +
-  - Installing react/event-loop (v0.4.3): Downloading (100%) +
-  - Installing react/socket (v0.5.1): Downloading (100%)+
   - Installing psr/http-message (1.0.1): Downloading (100%)   - Installing psr/http-message (1.0.1): Downloading (100%)
-  - Installing guzzlehttp/psr7 (1.4.2): Downloading (100%) +  - Installing guzzlehttp/psr7 (1.5.2): Downloading (100%) 
-  - Installing ratchet/rfc6455 (v0.2.3): Downloading (100%) +  - Installing react/promise (v2.7.1): Downloading (100%) 
-  - Installing cboden/ratchet (v0.4): Downloading (100%) +  - Installing react/event-loop (v1.1.0): Downloading (100%) 
-  - Installing react/promise-stream (v0.1.1): Downloading (100%) +  - Installing react/promise-timer (v1.5.0): Downloading (100%) 
-  - Installing ringcentral/psr7 (1.2.1): Downloading (100%) +  - Installing evenement/evenement (v3.0.1): Downloading (100%) 
-  - Installing react/http (dev-master cd15204): Cloning cd15204bd1 from cache +  - Installing react/stream (v1.1.0): Downloading (100%) 
-  - Installing paragonie/random_compat (v2.0.11): Downloading (100%) +  - Installing react/cache (v0.5.0): Downloading (100%) 
-  - Installing monolog/monolog (1.23.0): Downloading (100%) +  - Installing react/dns (v0.4.16): Downloading (100%) 
-  - Installing react/promise-timer (v1.2.0): Downloading (100%) +  - Installing react/socket (v1.2.0): Downloading (100%) 
-  - Installing react/cache (v0.4.1): Downloading (100%) +  - Installing ratchet/rfc6455 (0.2.4): Downloading (100%) 
-  - Installing react/dns (v0.4.11): Downloading (100%) +  - Installing cboden/ratchet (v0.4.1): Downloading (100%) 
-  - Installing react/socket-client (v0.5.3): Downloading (100%) +  - Installing symfony/contracts (v1.0.2): Downloading (100%) 
-  - Installing symfony/process (v3.3.9): Downloading (100%) +  Installing symfony/console (v4.2.4): Downloading (100%) 
-  - Installing mkraemer/react-pcntl (v2.0.0): Downloading (100%) +  - Installing doctrine/instantiator (1.2.0): Downloading (100%) 
-  - Installing php-pm/php-pm (dev-master 5a883f4): Cloning 5a883f48f0 from cache +  - Installing doctrine/event-manager (v1.0.0): Downloading (100%) 
-  - Installing symfony/event-dispatcher (v3.3.9): Downloading (100%) +  - Installing doctrine/cache (v1.8.0): Downloading (100%) 
-  - Installing symfony/http-kernel (v3.3.9): Downloading (100%) +  - Installing doctrine/dbal (v2.9.2): Downloading (100%) 
-  - Installing php-pm/httpkernel-adapter (dev-master b373b03): Cloning b373b0384f from cache +  - Installing doctrine/lexer (v1.0.1): Downloading (100%) 
-  - Installing doctrine/instantiator (1.0.5): Downloading (100%) +  - Installing doctrine/annotations (v1.6.0): Downloading (100%) 
-  - Installing doctrine/orm (v2.5.11): Downloading (100%)+  - Installing doctrine/reflection (v1.0.0): Downloading (100%) 
 +  - Installing doctrine/collections (v1.6.0): Downloading (100%) 
 +  - Installing doctrine/persistence (v1.1.0): Downloading (100%) 
 +  - Installing doctrine/inflector (v1.3.0): Downloading (100%) 
 +  - Installing doctrine/common (v2.10.0): Downloading (100%) 
 +  Installing doctrine/orm (v2.6.3): Downloading (100%) 
 +  - Installing symfony/polyfill-ctype (v1.11.0): Downloading (100%) 
 +  - Installing symfony/yaml (v4.2.4): Downloading (100%) 
 +  Installing guzzlehttp/promises (v1.3.1): Downloading (100%) 
 +  - Installing guzzlehttp/guzzle (6.3.3): Downloading (100%) 
 +  Installing influxdb/influxdb-php (1.14.7): Downloading (100%) 
 +  - Installing symfony/event-dispatcher (v4.2.4): Downloading (100%) 
 +  - Installing andig/dbcopy (1.3): Downloading (100%) 
 +  - Installing andig/php-shunting-yard (1.0.2): Downloading (100%) 
 +  - Installing react/promise-stream (v1.1.1): Downloading (100%) 
 +  - Installing ringcentral/psr7 (1.2.2): Downloading (100%) 
 +  - Installing react/http (v0.8.4): Downloading (100%) 
 +  - Installing http-interop/http-middleware (0.5.0): Downloading (100%) 
 +  - Installing psr/log (1.1.0): Downloading (100%) 
 +  - Installing symfony/debug (v4.2.4): Downloading (100%) 
 +  - Installing symfony/http-kernel (v4.2.4): Downloading (100%) 
 +  - Installing paragonie/random_compat (v9.99.99): Downloading (100%) 
 +  Installing monolog/monolog (1.24.0): Downloading (100%) 
 +  Installing react/child-process (v0.5.2): Downloading (100%) 
 +  Installing symfony/process (v4.2.4): Downloading (100%) 
 +  - Installing php-pm/php-pm (1.0.5): Downloading (100%) 
 +  - Installing php-pm/httpkernel-adapter (1.0.6): Downloading (100%) 
 +  - Installing webpatser/laravel-uuid (3.0.2): Downloading (100%) 
 +Package http-interop/http-middleware is abandoned, you should avoid using it. Use http-interop/http-server-middleware instead.
 Writing lock file Writing lock file
 Generating autoload files Generating autoload files
- +~
-install server-side graph generation (jpgraph, not required for frontend)? [n] +
-/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...
-ATTENTION: This operation should not be executed in a production environment. 
 creating db user vz-admin... creating db user vz-admin...
-Creating database schema... +creating database schema... 
-/home/pi/volkszaehler.org /home/pi +~/volkszaehler.org 
-Processing entity "Volkszaehler\Model\Aggregate" + 
-Processing entity "Volkszaehler\Model\Entity" + ! 
-Processing entity "Volkszaehler\Model\Channel" + ! [CAUTION] This operation should not be executed in a production environment! 
-Processing entity "Volkszaehler\Model\Data+ ! 
-Processing entity "Volkszaehler\Model\Property+ 
-Processing entity "Volkszaehler\Model\Aggregator" + Creating database schema... 
-Database schema created successfully!+ 
 + 
 + [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" + Proxy classes generated to "/home/pi/volkszaehler.org/lib/Model/Proxy" 
-/home/pi+~
  
 create volkszaehler.org database user? [y] create volkszaehler.org database user? [y]
Zeile 165: Zeile 178:
 Das Script fragt, was es wohin installieren soll. Das Script fragt, was es wohin installieren soll.
  
 +===== 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.
  
-=== Apache unter Debian "Wheezy" konfigurieren === +==== PPM als Server (empfohlene Methode) ==== 
-  * mod_rewrite aktivieren: +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.
-<code> +
-sudo a2enmod rewrite +
-</code>+
  
-  * Default VirtualHost bearbeiten ( die Datei: "000-default" bearbeiten): +  - Systemd Service einrichten ''sudo nano /etc/systemd/system/middleware.service''<code> 
-<code> +[Unit] 
-sudo nano /etc/apache2/sites-enabled/000-default +Description=Volkszaehler.org Middleware 
-</code>+After=syslog.target network.target 
 +Requires=
  
-  * In der Datei, neben: < DocumentRoot > : +[Service] 
-<code> +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 
- /var/www/volkszaehler.org/htdocs+ExecReload=/bin/kill -HUP $MAINPID 
-</code> +StandardOutput=journal 
-eintragen.+Restart=always
  
-  * unter <Directory /var/www/>: (Achtung <Directory> taucht öfter auf.+[Install] 
-neben<AllowOverride> +WantedBy=multi-user.target </code> 
-<code> +  - Server Konfiguration anpassen  
-FileInfo Limit Options Indexes Authconfig +    - ''nano ~/volkszaehler.org/etc/middleware.json'' 
-</code> +    - ändern: ''"static-directory": "/var/www/volkszaehler.org/htdocs",'' 
-eintragen. Das "none" wird überschrieben.+  - 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''
  
-Die Datei sollte dann so aussehen:+==== nginx als Proxy (empfohlene Methode) ==== 
 +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> <code>
-<VirtualHost *:80> +sudo apt install nginx 
-        ServerAdmin webmaster@localhost +sudo rm /etc/nginx/sites-enabled/default 
- +sudo nano /etc/nginx/sites-available/volkszaehler
-        DocumentRoot /var/www/volkszaehler.org/htdocs/ +
-        <Directory /> +
-                Options FollowSymLinks +
-                AllowOverride None +
-        </Directory> +
-        <Directory /var/www/> +
-                Options Indexes FollowSymLinks MultiViews +
-                AllowOverride FileInfo Limit Options Indexes AuthConfig +
-                Order allow,deny +
-                allow from all +
-        </Directory> +
- +
-        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin+
-        <Directory "/usr/lib/cgi-bin"> +
-                AllowOverride None +
-                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch +
-                Order allow,deny +
-                Allow from all +
-        </Directory> +
- +
-        ErrorLog ${APACHE_LOG_DIR}/error.log +
- +
-        # Possible values include: debug, info, notice, warn, error, crit, +
-        # alert, emerg. +
-        LogLevel warn +
- +
-        CustomLog ${APACHE_LOG_DIR}/access.log combined +
-</VirtualHost>+
 </code> </code>
- +In diese wird eingefügt:
-=== Apache unter Debian "Jessie" und "Stretch" konfigurieren === +
-  * mod_rewrite aktivieren:+
 <code> <code>
-sudo a2enmod rewrite +# Volkszaehler
-</code>+
  
-  * Default VirtualHost bearbeiten ( die Datei: "000-default.conf" bearbeiten): +include /etc/nginx/proxy_params;
-<code> +
-sudo nano /etc/apache2/sites-enabled/000-default.conf +
-</code>+
  
-  * In der Datei, neben< DocumentRoot > : +server { 
-<code> +  listen 80; 
- /var/www/volkszaehler.org/htdocs/ +  listen [::]:80;
-</code> +
-eintragen.+
  
-Nach dem editieren und abspeichern der Datei+  location / { 
-<code> +    proxy_pass http://127.0.0.1:8080; 
- sudo systemctl restart apache2 +    include /etc/nginx/proxy_params; 
-</code> +  }
-ausführen.+
  
-Sollte es zu einem PHP Fehler beim Anlegen der Datenbank kommen versucht mal Doctrine per Hand zu Installieren.+  location /middleware { 
 +    rewrite ^/middleware(.php)?(/.*)? $2; 
 +    proxy_pass http://127.0.0.1:8080/; 
 +  }
  
-==== Manuelle Installation ====+  location /api { 
 +    rewrite ^/api(/.*)? $1; 
 +    proxy_pass http://127.0.0.1:8080/; 
 +  }
  
-=== Download der volkszaehler.org Skripte === +  location /frontend { 
-Download der Skripte aus dem git Repository: +    rewrite ^/frontend/(.*) $1; 
-<code> +    proxy_pass http://127.0.0.1:8080/; 
-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> </code>
- +Damit der nginx die Config lädt:
-=== Apache konfigurieren === +
-  * mod_rewrite aktivieren:+
 <code> <code>
-sudo a2enmod rewrite+sudo ln -s /etc/nginx/sites-available/volkszaehler /etc/nginx/sites-enabled/volkszaehler
 </code> </code>
- +Dann nur noch Starten und in Bootprozess einbinden:
-  * Default VirtualHost bearbeiten: +
-<code> +
-/etc/apache2/sites-enabled/000-default: +
-    DocumentRoot /var/www/volkszaehler.org/htdocs/ +
-</code> +
- +
-  * unter <Directory /var/www/>:+
 <code> <code>
-AllowOverride FileInfo Limit Options Indexes Authconfig+sudo systemctl start nginx 
 +sudo systemctl enable nginx
 </code> </code>
  
-=== Alternativ: nginx konfigurieren ===+==== Alternativ: nginx als Server ====
 <code> <code>
 server { server {
Zeile 294: Zeile 273:
         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/php7-fpm.sock;
         }         }
 } }
 </code> </code>
  
-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: Apache als Server (unter Debian "Stretch") ====
 +  * Pakete installieren ''sudo apt-get install apache2 libapache2-mod-php7.1''
 +  * mod_rewrite aktivieren: ''sudo a2enmod rewrite''
 +  * Default VirtualHost bearbeiten: ''sudo nano /etc/apache2/sites-enabled/000-default.conf''
 +  ' In der Datei, neben ''< DocumentRoot >'' eintragen:
 +<code>
 + /var/www/volkszaehler.org/htdocs/
 +</code>
 +
 +  * Apache Config bearbeiten um Rewrite 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>
 +   * in ''AllowOverride All AuthConfig'' ändern.
 +
 +Nach dem editieren und abspeichern der Datei ''sudo systemctl restart apache2'' ausführen.
 +
 +Sollte es zu einem PHP Fehler beim Anlegen der Datenbank kommen versucht mal Doctrine per Hand zu Installieren.
 +
 +==== Alternativ: Apache als Proxy ====
 +Auch Apache kann auf die Weiterleitung zum PPM reduziert werden.
 +<code>sudo a2enmod proxy
 +sudo a2enmod proxy_http
 +nano ~/volkszaehler.org/htdocs/.htaccess</code>
 +Die Kommentarzeichen vor den Zeilen entfernen:
 +<code>
 +<IfModule mod_proxy.c>
 +        RewriteEngine On
 +        RewriteRule ^middleware(.php)?(/.*)? http://localhost:8080/$2 [P]
 +        RewriteRule ^api(/.*)$ http://localhost:8080/$1 [P]
 +</IfModule>
 +</code>
 +Dann den Apache nur noch neu starten
 +<code>sudo systemctl restart apache2</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 326: Zeile 355:
 <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 401: Zeile 434:
 </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. Nachdem Volkszähler im Zuge der Installation eine Kopie des git Repositories erstellt, kann die Installation auch aus diesem Repository aktualisiert werden.
Zeile 408: Zeile 444:
  
  
-===== phpMyAdmin installieren =====+====== phpMyAdmin installieren ======
 <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''\\
Zeile 421: Zeile 457:
 Um dem neuen User volle Adminrechte zu gewähren: Um dem neuen User volle Adminrechte zu gewähren:
 <code>sudo mysql -uroot -praspberry --execute "grant all privileges on *.* to 'phpmyadmin'@'localhost' with grant option"</code> <code>sudo mysql -uroot -praspberry --execute "grant all privileges on *.* to 'phpmyadmin'@'localhost' with grant option"</code>
- 
-==== Debian Jessie ==== 
-<code>sudo apt-get install phpmyadmin</code> 
-<code>sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/sites-enabled/phpmyadmin.conf</code> 
-<code>sudo systemctl restart apache2</code> 
- 
-==== Debian Wheezy ==== 
-<code>sudo apt-get install phpmyadmin</code> 
-<code>sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf.d/phpmyadmin.conf</code> 
-<code>sudo /etc/init.d/apache2 reload</code> 
  
software/middleware/installation.txt · Zuletzt geändert: 2023/03/27 21:14 von joha