CMS/WordPress
Hinweis: Diese Inhalte wurden mit Unterstützung von Künstlicher Intelligenz erstellt und redaktionell überprüft (Transparenzhinweis gemäß Art. 50 EU AI Act).
WordPress-Datenbank auf Ubuntu einrichten
Um eine WordPress-Datenbank auf einem Ubuntu-Rechner einzurichten, folge diesen Schritten:
1. MySQL-Konsole öffnen
sudo mysql -u root -p
2. Datenbank anlegen
CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
3. Benutzer anlegen
CREATE USER 'wpuser'@'localhost' IDENTIFIED BY 'dein_passwort';
4. Rechte vergeben
GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
WordPress herunterladen
cd $HOME
wget https://wordpress.org/latest.tar.gz
sudo tar -xzf latest.tar.gz -C /var/www
== Dateirechte für WordPress setzen ==
<pre>
sudo chown -R www-data:www-data /var/www/wordpress
</pre>
== Nginx für WordPress konfigurieren ==
Erstelle eine neue Konfigurationsdatei für deine WordPress-Seite:
<pre>
sudo nano /etc/nginx/conf.d/wordpress
</pre>
Füge folgenden Inhalt ein:
<syntaxhighlight lang="nginx">
server {
listen 80;
server_name wordpress.localhost;
root /var/www/wordpress;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
}
location ~ /\.ht {
deny all;
}
}
Aktiviere die Konfiguration:
sudo nginx -t
sudo systemctl reload nginx
Hinweis: Diese Inhalte wurden mit Unterstützung von Künstlicher Intelligenz erstellt und redaktionell überprüft (Transparenzhinweis gemäß Art. 50 EU AI Act).