Webserver bereitstellen
-
Server updaten
sudo dnf update
-
Server upgraden
sudo dnf upgrade
-
Epel installieren (Extra Packages for Enterprise Linux)
Damit man das Repo installieren, worauf sich das neuste PHP befindet.
sudo dnf -y install epel-release
-
Remirepo Installieren
sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
-
PHP Modul installieren
sudo dnf -y module install php:remi-8.0
-
Apache installieren
sudo dnf -y install httpd
-
Apache aktivieren
sudo systemctl enable httpd
-
Apache starten
sudo systemctl start httpd
-
In den DocumentRoot-Ordner wechseln
cd /var/www/html/
-
Darin Wordpress installationspaket installieren
sudo wget https://wordpress.org/latest.tar.gz
-
Wordpress-Paket entpacken
sudo tar -xzvf latest.tar.gz
-
In den entpackten Ordner gehen
cd wordpress
-
Die Konfigurations-Datei duplizieren und umbenennen
sudo cp wp-config-sample.php wp-config.php
-
Die Konfigurations-Datei bearbeiten
sudo vi wp-config.php
-
Unter "Database settings" die folgende Inhalte einfügen:
- DB_NAME
- DB_USER
- DB_PASSWORD
- DB_HOST
- DB_CHARSET
- DB_COLLATE
Beispiel:
// ** Database settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define( 'DB_NAME', 'dbwordpress' ); /** Database username */ define( 'DB_USER', 'wpuser' ); /** Database password */ define( 'DB_PASSWORD', '*********' ); /** Database hostname */ define( 'DB_HOST', '192.168.20.5' ); /** 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', '' );
-
User Apache berechtigen
sudo chown -R apache:apache /var/www/html/wordpress
-
Wordpress Ordner berechtigen
sudo chmod -R 775 /var/www/html/wordpress/
-
Den SELinux-Kontext für das Verzeichnis und dessen Inhalten konfigurieren
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/html/wordpress(/.*)?"
Man könnte auch einfach SELinux deaktivieren.
-
Mit diesem Befehl die Veränderungen aktivieren
sudo restorecon -Rv /var/www/html/wordpress
-
Erstellen einer Apache-Konfigurationsdatei für WordPress
sudo vi /etc/httpd/conf.d/wordpress.conf
-
Den folgenden Code kopieren und wo nötig anpassen
<VirtualHost *:80> ServerName localhost ServerAdmin root@localhost DocumentRoot /var/www/html/wordpress <Directory "/var/www/html/wordpress"> Options Indexes FollowSymLinks AllowOverride all Require all granted </Directory> ErrorLog /var/log/httpd/wordpress_error.log CustomLog /var/log/httpd/wordpress_access.log common </VirtualHost>
-
MySQL Extension installieren
sudo dnf install php-mysqlnd sudo dnf install mysql
-
PHP neustarten
sudo systemctl restart php-fpm
-
Apache neustarten
sudo systemctl restart httpd
-
Httpd neu starten
sudo systemctl restart httpd
-
PHP neu starten
sudo systemctl restart php-fpm
-
Webbrowser öffnen und diesen Link eingeben:
http://<IP-Adresse vom Webserver>
Beispiel:
http://192.168.20.5/wp-admin
-
Wordpress installieren
Link: Wordpress Installation