Bash script for managing htaccess files

Had to create this for a less technical user to manage htaccess, so thought I'd share. Your mileage may vary. Change the location of the default htpass file in the config. You can supply another location in mid script if you have more than one. #!/bin/bash# ConfigurationHTACCESS_FILE_DEFAULT="htpass_test"# Function to display a list of usersdisplay_users() { … Read more

Changing default port for grafana agent

This was much more difficult than it should have been. Grafana agent runs on port 9090 and 9091, so when I installed it on a server where nginx was using those ports, I got an error, not unreasonably. error creating the agent server entrypoint" err="creating HTTP listener: listen tcp 127.0.0.1:9090: bind: address already in use … Read more

php-fpm monitoring for single domain

Ran into this one recently and the solution came out of left field, so I thought I'd throw it out to the internet at large. I've got a server which is running php-fpm and nginx. However it has several websites running on it, each of which has its own php-fpm/pool.d/ profile. We were having a problem with one of the websites, which got a lot more traffic than the others, so we needed a way to monitor its php-fpm performance.

Setting up php monitoring is not hard. There are many guides around the internet. You put the line

pm.status_path = /status

in your fpm pool file, then add a block to your nginx config so that it can only be accessed by certain IP addresses.

Read more

Mysql 8 Binary Logs ON by default

I'm not sure how typing this in my quiet corner of the internet will be effective in broadcasting the message, but this is a Big Deal for server administrators. Previously binary logging was disabled by default, but now, with the default settings, if you have a busy database server, pretty soon you'll have a hefty … Read more