So your site has a login page? Ever wondered how many “people” are knocking on your door? When I looked at the login attempts on my SSH front door, just shortly after new server deployment, I decided to change doors (ports..). SSH login attempts are in the logs and are fun to look at. But how about failed WordPress logins? First of all, they are not in the logs. But this can be fixed easily like this: —> create directory mu-plugins mkdir /var/www/<your site root>/wp-content/mu-plugins —> create file wp-fail2ban.php in this directory <?php function admin_login_failed_403() {     status_header( 403 ); } add_action( ‘wp_login_failed’, ‘admin_login_failed_403’Read More →

I described the installation of multi-site WordPress here with nginx webserver and php-fpm processes both running as user www-data. According to WordPress, the webserver should have read access to all data and only the WordPress user should have write access. The concept of a WordPress user relates to hosted environments. So how to implement these requirements on your own VPS? First of all, php-fpm supports the concept of pools. Each pool can run with an unique user, separate from the webserver user. So each site should run in a separate pool. This results in the following accounts: webserver: www-data user (default for nginx on debian) site 1:Read More →

If you want to run single WordPress site, best to use a WordPress hosting offer. If you want to run 5 WordPress sites, it is often more economical to get a VPS and configure multi-site. But you will face much more install and admin work, especially if you avoid using tools like Plesk etc. On a fresh Debian 10 server install, I started with: apt update; apt upgrade —> set timezone timedatectl set-timezone Europe/Berlin —> verify status of timers systemctl list-timers —> install zip & unzip for Duplicator (WordPress plugin) apt install zip unzip Make sure to run: apt update apt list –upgradable regularly andRead More →

On a new Debian 10 server I wanted to create some system accounts. Like those being used by mysql, postfix and ntp: messagebus:x:104:105::/nonexistent:/usr/sbin/nologin unscd:x:105:109::/var/lib/unscd:/usr/sbin/nologin ntp:x:106:112::/nonexistent:/usr/sbin/nologin mysql:x:108:114:MySQL Server,,,:/nonexistent:/bin/false postfix:x:109:116::/var/spool/postfix:/usr/sbin/nologin Account are created with useradd, or adduser? Well, man useradd tells me this is a low level command, so better use adduser. Fair enough. man adduser clearly states how to create a system account, use the –system flag. Reading futher, man adduser tells me, that “A home directory is created by the same rules as for normal users“. Really, for a system user? No problem, just add the –no-create-home flag and the problem is solved. What thisRead More →