WordPress auf anderen Server einrichten

FTP Server installieren
sudo apt install vsftpd
Hostnamen ermitteln -> hostnamectl

MySql Server installieren
sudo apt install mysql-server
Status überprüfen -> sudo service mysql status QUIT mit der Eingabe q
Netzwerkstatus -> sudo ss -tap | grep mysql
Die Datei /etc/mysql/
/etc/mysql/mysql.conf.d/mysqld.cnf den Bind Eintrag anpassen auf die Server IP
bind-address = 192.168.0.5

DBeaver ce Installieren

sudo snap install curl

Abhängigkeiten Installieren
sudo apt update
sudo apt install apache2 \
ghostscript \
libapache2-mod-php \
php \
php-bcmath \
php-curl \
php-imagick \
php-intl \
php-json \
php-mbstring \
php-mysql \
php-xml \
php-zip

Install WordPress

sudo mkdir -p /srv/www
sudo chown www-data: /srv/www
curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C /srv/www

Create Apache site for WordPress. Create /etc/apache2/sites-available/wordpress.conf with following lines:

cd /etc/apache2/sites-available
$ sudo nano wordpress.conf

<VirtualHost *:80>
    DocumentRoot /srv/www/wordpress
    <Directory /srv/www/wordpress>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>
    <Directory /srv/www/wordpress/wp-content>
        Options FollowSymLinks
        Require all granted
    </Directory>
</VirtualHost>


sudo a2ensite wordpress
systemctl reload apache2
sudo a2enmod rewrite
systemctl reload apache2
sudo a2dissite 000-default
systemctl reload apache2
sudo service apache2 reload

Configure database

$ sudo mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0,00 sec)

mysql> CREATE USER wordpress@localhost IDENTIFIED BY '<your-password>';
Query OK, 1 row affected (0,00 sec)

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
    -> ON wordpress.*
    -> TO wordpress@localhost;
Query OK, 1 row affected (0,00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 1 row affected (0,00 sec)

mysql> quit
Bye


Enable MySQL with -> sudo service mysql start

sudo -u www-data cp /srv/www/wordpress/wp-config-sample.php /srv/www/wordpress/wp-config.php


Next, set the database credentials in the configuration file (do not replace database_name_here or username_here in the commands below. Do replace <your-password> with your database password.):

sudo -u www-data sed -i ’s/database_name_here/wordpress/‘ /srv/www/wordpress/wp-config.php

sudo -u www-data sed -i ’s/username_here/wordpress/‘ /srv/www/wordpress/wp-config.php


sudo -u www-data sed -i ’s/password_here//‘ /srv/www/wordpress/wp-config.php

sudo -u www-data nano /srv/www/wordpress/wp-config.php
Find the following:
define( ‚AUTH_KEY‘, ‚put your unique phrase here‘ );
define( ‚SECURE_AUTH_KEY‘, ‚put your unique phrase here‘ );
define( ‚LOGGED_IN_KEY‘, ‚put your unique phrase here‘ );
define( ‚NONCE_KEY‘, ‚put your unique phrase here‘ );
define( ‚AUTH_SALT‘, ‚put your unique phrase here‘ );
define( ‚SECURE_AUTH_SALT‘, ‚put your unique phrase here‘ );
define( ‚LOGGED_IN_SALT‘, ‚put your unique phrase here‘ );
define( ‚NONCE_SALT‘, ‚put your unique phrase here‘ );

Delete those lines (ctrl+k will delete a line each time you press the sequence). Then replace with the content of https://api.wordpress.org/secret-key/1.1/salt/. (This address is a randomiser that returns completely random keys each time it is opened.) This step is important to ensure that your site is not vulnerable to “known secrets” attacks.

Save and close the configuration file by typing ctrl+x followed by y then enter

Das bedeutet die Zeilen define(‚AUTH_KEY …. bis define(‚NONCE -> löschen und mit der ausgabe von https://api.wordpress.org/secret-key/1.1/salt/ ersetzen.

Einfacher jedoch mit dem Texteditor da Nano eine eigene Zwischenablage hat.



Dieser Beitrag wurde unter Installation abgelegt und mit verschlagwortet. Setze ein Lesezeichen auf den Permalink.