Skip to content

Webserver bereitstellen

  1. Server updaten

    sudo dnf update
    
  2. Server upgraden

    sudo dnf upgrade
    
  3. Epel installieren (Extra Packages for Enterprise Linux)

    Damit man das Repo installieren, worauf sich das neuste PHP befindet.

    sudo dnf -y install epel-release
    
  4. Remirepo Installieren

    sudo dnf -y install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
    
  5. PHP Modul installieren

    sudo dnf -y module install php:remi-8.0
    
  6. Apache installieren

    sudo dnf -y install httpd
    
  7. Apache aktivieren

    sudo systemctl enable httpd
    
  8. Apache starten

    sudo systemctl start httpd
    
  9. In den DocumentRoot-Ordner wechseln

    cd /var/www/html/
    
  10. Darin Wordpress installationspaket installieren

    sudo wget https://wordpress.org/latest.tar.gz
    
  11. Wordpress-Paket entpacken

    sudo tar -xzvf latest.tar.gz
    
  12. In den entpackten Ordner gehen

    cd wordpress
    
  13. Die Konfigurations-Datei duplizieren und umbenennen

    sudo cp wp-config-sample.php wp-config.php
    
  14. Die Konfigurations-Datei bearbeiten

    sudo vi wp-config.php
    
  15. 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', '' );
    
  16. User Apache berechtigen

    sudo chown -R apache:apache /var/www/html/wordpress
    
  17. Wordpress Ordner berechtigen

    sudo chmod -R 775 /var/www/html/wordpress/
    
  18. 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.

  19. Mit diesem Befehl die Veränderungen aktivieren

    sudo restorecon -Rv /var/www/html/wordpress
    
  20. Erstellen einer Apache-Konfigurationsdatei für WordPress

    sudo vi /etc/httpd/conf.d/wordpress.conf
    
  21. 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>
    
  22. MySQL Extension installieren

    sudo dnf install php-mysqlnd
    sudo dnf install mysql
    
  23. PHP neustarten

    sudo systemctl restart php-fpm
    
  24. Apache neustarten

    sudo systemctl restart httpd
    
  25. Httpd neu starten

    sudo systemctl restart httpd
    
  26. PHP neu starten

    sudo systemctl restart php-fpm
    
  27. Webbrowser öffnen und diesen Link eingeben:

    http://<IP-Adresse vom Webserver>
    

    Beispiel:

    http://192.168.20.5/wp-admin
    
  28. Wordpress installieren

Link: Wordpress Installation