Dies ist eine alte Version des Dokuments!
Container 'wordpress-technikkultur'
Ressourcen
- 0.5 GB RAM
- 2 Cores
- 8 GB HDD (root-fs)
System
- interne IPs
- 10.2.0.5, fd00:10:2:0::5
- 10.3.0.5, fd00:10:3:0::5
Dienste
- Wordpress (via NGINX)
Installation
- Standard-Template mit Benutzern
NGINX / PHP
- NGINX und PHP-FPM installieren
- sudo apt-get install php7.3 php7.3-cli php7.3-fpm php7.3-gd php7.3-xml php7.3-zip php7.3-mbstring php7.3-mysql php7.3-imagick php7.3-curl nginx
- Default-Konfiguration anpassen
/etc/nginx/sites-available/default
server { listen 80 default_server; listen [::]:80 default_server; root /var/www/public_html; # Add index.php to the list if you are using PHP index index.php; server_name _; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location / { # This is cool because no php is touched for static content. # include the "?$args" part so non-default permalinks doesn't break when using query string try_files $uri $uri/ /index.php?$args; } # pass PHP scripts to FastCGI server location ~ \.php$ { #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini include fastcgi_params; fastcgi_intercept_errors on; fastcgi_pass unix:/run/php/php7.3-fpm.sock; #The following parameter can be also included in fastcgi_params file fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires max; log_not_found off; } }
- Dienste aktivieren und neustarten
- sudo systemctl enable nginx.service php7.3-fpm.service
- sudo systemctl restart nginx.service php7.3-fpm.service
Wordpress
- Wordpress-Verzeichnisse erstellen
- sudo mkdir /var/www/public_html
- Datenbank erstellen
- Wordpress installieren
- nach Anleitung
- Entpacken in das Verzeichnis /var/www/public_html
- Berechtigungen anpassen
- sudo chown -R www-data:www-data /var/www/public_html
- Konfigurationsvorlage kopieren
- sudo cp /var/www/public_html/wp-config-sample.php /var/www/public_html/wp-config.php
- DB-Konfiguration anpassen
/var/www/public_html/wp-config.php
/** The name of the database for WordPress */ define( 'DB_NAME', 'wordpress_technikkultur' ); /** MySQL database username */ define( 'DB_USER', 'XXXXXXXXX' ); /** MySQL database password */ define( 'DB_PASSWORD', 'XXXXXXXXXX' ); /** MySQL hostname */ define( 'DB_HOST', '10.3.0.100' ); /** Database Charset to use in creating database tables. */ define( 'DB_CHARSET', 'utf8' ); /** The Database Collate type. Don't change this if in doubt. */ define( 'DB_COLLATE', '' );
- Salt-Konfiguration anpassen: Ausgabe von https://api.wordpress.org/secret-key/1.1/salt/ in Konfiguration schreiben
/var/www/public_html/wp-config.php
define('AUTH_KEY', '****************************************************************'); define('SECURE_AUTH_KEY', '****************************************************************'); define('LOGGED_IN_KEY', '****************************************************************'); define('NONCE_KEY', '****************************************************************'); define('AUTH_SALT', '****************************************************************'); define('SECURE_AUTH_SALT', '****************************************************************'); define('LOGGED_IN_SALT', '****************************************************************'); define('NONCE_SALT', '****************************************************************');
- Verwendung eines SSL-Proxies konfigurieren
/var/www/public_html/wp-config.php
... /* Accept SSL behind proxy */ if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { $_SERVER['HTTPS'] = 'on'; } /** Sets up WordPress vars and included files. */ require_once ABSPATH . 'wp-settings.php';
- Installer aufrufen unter https://technikkultur-erfurt.de/wp-admin/install.php
- Titel: Verein zur Förderung der Technikkultur in Erfurt e.V.
- Mail-Adresse: webmaster@XXXXXX.de
- Benutzername und Passwort sicher wählen und dokumentieren
- Im Admin-Backend einloggen und HTTPS konfigurieren
- Unter Einstellungen - Allgemein die Parameter WordPress-Adresse (URL) und Website-Adresse (URL) anpassen
Backup mit Borgmatic
- Installation siehe mariadb
- Konfiguration
/etc/borgmatic/config.yaml
... location: # List of source directories to backup (required). Globs and # tildes are expanded. source_directories: - /etc - /home - /root - /var/log - /var/www ...