====== Wordpress auf einer Enterprise Linux VM installieren ====== Installation von benötigten Paketen sudo dnf install install php-gd php-soap php-intl php-mysqlnd php-pdo php-pecl-zip php-fpm php-opcache php-curl php-zip wget vim mariadb-server mariadb tar httpd sudo dnf install mod_ssl Neustart webserver sudo systemctl restart httpd sudo systemctl enable httpd Generiere eine Datenbank sowie einen Benutzer für Wordpress sudo mysql -u root -p CREATE DATABASE wordpress_db; CREATE USER 'wordpress_user'@'localhost' IDENTIFIED BY 'SeCrEtSeCrEtSeCrEtSeCrEtSeCrEtSeCrEtSeCrEt'; GRANT ALL ON wordpress_db.* TO 'wordpress_user'@'localhost'; FLUSH PRIVILEGES; EXIT; Download Wordpress $ wget https://wordpress.org/latest.tar.gz -O wordpress.tar.gz $ tar -xvf wordpress.tar.gz $ sudo cp -R wordpress /var/www/html/ Konfiguriere die Wordpress Dateien sowie Ordnerstruktur $ sudo chown -R apache:apache /var/www/html/wordpress $ sudo chmod -R 775 /var/www/html/wordpress $ sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/wordpress(/.*)?" $ sudo restorecon -Rv /var/www/html/wordpress Erlaube Verbindungen von Wordpress via Skripts (php) z.B. für Updates oder installation von PlugIns $ sudo setsebool -P httpd_can_network_connect 1 Optional: $$$ OPTIONAL $$$ sudo semanage fcontext --add --type httpd_sys_rw_content_t "/var/www/(/.*)?/wp-content(/.*)?" sudo semanage fcontext --add --type httpd_sys_rw_content_t "/var/www/(/.*)?/wp-content/upgrade(/.*)?" sudo semanage fcontext --add --type httpd_sys_rw_content_t "/var/www/(/.*)?/wp-content/uploads(/.*)?" sudo semanage fcontext --add --type httpd_sys_script_exec_t "/var/www/(/.*)?/wp-config\.php" sudo semanage fcontext --add --type httpd_sys_script_exec_t "/var/www/(/.*)?/wp-includes/.*\.php" sudo restorecon -r /var/www/html/wordpress $$$ OPTIONAL END $$$ Erstelle ein Selbstsigniertes Zertifikat, sodass die Verbindung vom Reverse Proxy verschlüsselt stattfinden $ openssl req -newkey rsa:4096 -nodes -keyout /etc/pki/tls/private/wordpress.key -x509 -days 3650 -out /etc/pki/tls/certs/wordpress.crt Konfiguriere den Webserver (HTTP + HTTPS) Derzeit einzeln, mann kann auch port 80 auf 443 weiterleiten $ sudo vim /etc/httpd/conf.d/wordpress.conf Füge folgenden Inhalt der Datei hinzu """ LoadModule ssl_module modules/mod_ssl.so ServerName mygrowhouse24.de DocumentRoot /var/www/wordpress Options Indexes FollowSymLinks AllowOverride all Require all granted ErrorLog /var/log/httpd/wordpress_error.log CustomLog /var/log/httpd/wordpress_access.log common SSLEngine on SSLCertificateFile "/etc/pki/tls/certs/wordpress.crt" SSLCertificateKeyFile "/etc/pki/tls/private/wordpress.key" ServerName 10.0.200.101 ServerAdmin admin@mygrowhouse25.de DocumentRoot /var/www/wordpress Options Indexes FollowSymLinks AllowOverride all Require all granted ErrorLog /var/log/httpd/wordpress_error.log CustomLog /var/log/httpd/wordpress_access.log common """ Starte den Webserver neu sudo systemctl restart httpd Firewall erlauben $ sudo firewall-cmd --permanent --zone=public --add-service=http $ sudo firewall-cmd --permanent --zone=public --add-service=https $ sudo firewall-cmd --reload