Erstellung einer ersten Testinstanz fuer WP auf Debian Basis
Alle Kommandos dabei als root ausgefuehrt und orientiert an https://www.howtoforge.com/tutorial/wordpress-installation-with-nginx-mariadb-and-hhvm-on-ubuntu/:
apt update && apt upgrade -y && apt dist-upgrade -y && apt autoremove -y
init 6
apt install tmux curl
tmux
Ich habe mich fuer einen LEMP Stack entschieden.
Alternativ um alle pakete gleichzeitig zu installieren
apt-get install tmux curl nginx mariadb-server php php-fpm php-curl php-mysql php-gd php-mbstring php-xml php-imagick php-zip php-xmlrpc -y
------
apt-get install nginx -y
systemctl start nginx
systemctl status nginx
systemctl enable nginx
Ich haette gern PHP 8 dabei orientiert an: https://www.linuxcapable.com/how-to-install-php-8-1-on-debian-11-bullseye/
apt install ca-certificates apt-transport-https software-properties-common wget curl lsb-release -y
curl -sSL https://packages.sury.org/php/README.txt | bash -x
apt update && apt upgrade -y
apt install php8.1 php8.1-fpm php8.1-cli -y
php -v
PHP 8.1.8 (cli) (built: Jul 11 2022 08:55:24) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.8, Copyright (c) Zend Technologies
with Zend OPcache v8.1.8, Copyright (c), by Zend Technologies
apt autoremove -y
nano /etc/php/8.1/fpm/php.ini
cgi.fix_pathinfo=0
upload_max_filesize = 512M
post_max_size = 512M
memory_limit = 2048M
max_execution_time = 240
Datenbank
mysql
CREATE DATABASE wpdb;
CREATE USER 'administration'
'localhost' IDENTIFIED BY '<STURAPASSWORDHERE>';
@GRANT ALL ON wpdb.* TO 'administration'
'localhost';
@flush privileges;
exit;
cd /var/www/html
wget https://wordpress.org/latest.tar.gz
tar -zxvf latest.tar.gz
mv /var/www/html/wordpress/wp-config-sample.php /var/www/html/wordpress/wp-config.php
nano /var/www/html/wordpress/wp-config.php
// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wpdb' );
/** Database username */
define( 'DB_USER', 'administration' );
/** Database password */
define( 'DB_PASSWORD', '<STURAPASSWORDHERE>' );
/** Database hostname */
define( 'DB_HOST', 'localhost' );
/** 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', '' );
Salts generieren und dann einfuegen https://api.wordpress.org/secret-key/1.1/salt/
mv /var/www/html/wordpress/ /var/www/html/extern.htw.stura-dresden.de
chown -R www-data:www-data /var/www/html/extern.htw.stura-dresden.de/
chmod -R 755 /var/www/html/extern.htw.stura-dresden.de/
NGINX Cofiguration
nano /etc/nginx/conf.d/extern.htw.stura-dresden.de
server {
listen 80;
root /var/www/html/extern.htw.stura-dresden.de;
index index.php index.html index.htm;
server_name extern.htw.stura-dresden.de;
client_max_body_size 500M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
systemctl restart nginx
systemctl restart php8.1-fpm
systemctl status nginx
-> running