Wordpress I

Complete installation of Wordpress (Debian 11 LAMP + WP)

Checking if packages are up to date
apt-get update && apt-get upgrade
Install dependencies
apt install net-tools sudo wget curl bash-completion

That is up to date regarding to Debian 11 – 20210928

apt install apache2 apache2-utils mariadb-server mariadb-client
apt install php libapache2-mod-php php-mysql php-fpm php-curl php-gd php-intl php-mbstring php-soap php-xml php-xmlrpc php-zip
Getting DB ready [details available in WordPress II]

Run the DB

systemctl start mariadb && systemctl enable mariadb && systemctl status mariadb

Initialize DB – the first setup

mysql_secure_installation
mysql -u root -p
CREATE DATABASE wordpress;
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress-user'@'localhost' IDENTIFIED BY 'wordpress-pass';
FLUSH PRIVILEGES;
quit;

Úprava apache2

a2enmod rewrite ssl
a2ensite default-ssl.conf
  • vložít následující pod DocumentRoot /var/www/html v: nano /etc/apache2/sites-enabled/000-default.conf nano /etc/apache2/sites-enabled/default-ssl.conf
    <Directory /var/www/html>
       Options Indexes FollowSymLinks MultiViews
       AllowOverride All
       Require all granted
    </Directory>
  • upravit SSL v: nano /etc/apache2/sites-enabled/default-ssl.conf
SSLProtocol all -SSLv2 -SSLv3
# Add SSL Cipher in one long line
SSLCipherSuite          ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder     on
SSLOptions +StrictRequire

Header always set Strict-Transport-Security "max-age=63072000; includeSubdomains"
Header always set X-Frame-Options DENY
Header always set X-Content-Type-Options nosniff
a2enmod headers
systemctl restart apache2.service
apache2ctl -t
systemctl restart apache2.service mariadb.service
systemctl enable apache2.service mariadb.service
netstat -tlp| egrep 'http|mysql'

Wordpress

cd /tmp
wget http://wordpress.org/latest.tar.gz
tar xfz latest.tar.gz
cp -rf wordpress/* /var/www/html/
rm /var/www/html/index.html
chmod -R 775 /var/www/html/
chgrp -R www-data /var/www/html/
ls -al /var/www/html

nelze instalovat pluginy

chown www-data:www-data /var/www -R 
chmod g+w /var/www -R