CMS/WordPress: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
// via Wikitext Extension for VSCode |
// via Wikitext Extension for VSCode |
||
| Zeile 34: | Zeile 34: | ||
wget https://wordpress.org/latest.tar.gz | wget https://wordpress.org/latest.tar.gz | ||
sudo tar -xzf latest.tar.gz -C /var/www | sudo tar -xzf latest.tar.gz -C /var/www | ||
== Dateirechte für WordPress setzen == | |||
<syntaxhighlight lang="bash"> | |||
sudo chown -R www-data:www-data /var/www/wordpress | |||
</syntaxhighlight> | |||
== Nginx für WordPress konfigurieren == | |||
Erstelle eine neue Konfigurationsdatei für deine WordPress-Seite: | |||
<syntaxhighlight lang="bash"> | |||
sudo nano /etc/nginx/conf.d/wordpress | |||
</syntaxhighlight> | |||
Füge folgenden Inhalt ein: | |||
<syntaxhighlight lang="nginx"> | |||
server { | |||
listen 80; | |||
server_name 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.1-fpm.sock; | |||
} | |||
location ~ /\.ht { | |||
deny all; | |||
} | |||
} | |||
</syntaxhighlight> | |||
Aktiviere die Konfiguration: | |||
<syntaxhighlight lang="bash"> | |||
sudo nginx -t | |||
sudo systemctl reload nginx | |||
</syntaxhighlight> | </syntaxhighlight> | ||
---- | ---- | ||
''Hinweis: Diese Inhalte wurden mit Unterstützung von Künstlicher Intelligenz erstellt und redaktionell überprüft (Transparenzhinweis gemäß Art. 50 EU AI Act).'' | ''Hinweis: Diese Inhalte wurden mit Unterstützung von Künstlicher Intelligenz erstellt und redaktionell überprüft (Transparenzhinweis gemäß Art. 50 EU AI Act).'' | ||
Version vom 28. Januar 2026, 00:06 Uhr
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 ==
<syntaxhighlight lang="bash">
sudo chown -R www-data:www-data /var/www/wordpress
Nginx für WordPress konfigurieren
Erstelle eine neue Konfigurationsdatei für deine WordPress-Seite:
sudo nano /etc/nginx/conf.d/wordpress
Füge folgenden Inhalt ein:
server {
listen 80;
server_name 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.1-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).