This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost 127.0.0.1:81> | |
ServerAdmin <email> | |
ServerName example.tld | |
ServerAlias www.example.tld | |
DocumentRoot /var/www/html | |
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{User-agent}i\"" varnishcombined | |
CustomLog ${APACHE_LOG_DIR}/access.log varnishcombined | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --vault-name YOUR_VAULT_NAME --account-id YOUR_ACCOUNT_ID --region YOUR_REGION | |
2. aws glacier list-jobs --vault-name YOUR_VAULT_NAME --region YOUR_REGION --account-id YOUR_ACCOUNT_ID | |
try again and again until you get "Completed": true, and "StatusCode": "Succeeded" | |
it can take several hours or days | |
3. aws glacier get-job-output --job-id YOUR_JOB_ID --vault-name YOUR_VAULT_NAME --region YOUR_REGION --account-id YOUR_ACCOUNT_ID ./output.json | |
copy job_id from the output of the second step | |
4. nano glacier.php |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName analytics.example.com | |
DocumentRoot /var/www/matomo/ | |
<Directory /var/www/matomo> | |
DirectoryIndex index.php | |
Options FollowSymLinks | |
AllowOverride All | |
Require all granted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 46.101.98.116:443 ssl http2; | |
server_name stats.eksis.eu; | |
access_log /var/log/nginx/access.matomo.log; | |
error_log /var/log/nginx/error.matomo.log; | |
location / { | |
proxy_pass http://127.0.0.1:8080; | |
proxy_set_header X-Real-IP $remote_addr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen [::]:80; # remove this if you don't want Matomo to be reachable from IPv6 | |
listen 80; | |
server_name analytics.example.com; | |
access_log /var/log/nginx/matomo.access.log; | |
error_log /var/log/nginx/matomo.error.log; | |
root /var/www/matomo/; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## in the server block | |
# | |
# note: if you have posts with title matching these, turn them off or fine-tune | |
# them to exclude those | |
## Block SQL injections | |
location ~* union.*select.*\( { | |
access_log /var/log/nginx/blocked.log blocked; | |
deny all; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map $http_user_agent $bad_bot { | |
default 0; | |
# libraries etc. | |
"~*(?:\b)aiohttp(?:\b)" 1; | |
"~*(?:\b)akka-http/(?:\b)" 1; # - done | |
"~*(?:\b)Amazon CloudFront(?:\b)" 1; # - done | |
"~*(?:\b)Facebot Twitterbot(?:\b)" 1; | |
"~*(?:\b)check_http/(?:\b)" 1; | |
"~*(?:\b)curl/(?:\b)" 1; | |
"~*(?:\b)Java/(?:\b)" 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
User-agent: AffiliateLabz | |
User-agent: AhrefsBot | |
User-agent: AspiegelBot | |
User-agent: coccocbot | |
User-agent: IAS crawler | |
User-agent: MJ12bot | |
User-agent: seewithkids.com | |
User-agent: SemrushBot/6~bl | |
User-agent: TTD-Content | |
User-agent: YandexBot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
check process nginx with pidfile /var/run/nginx.pid | |
group www | |
group nginx | |
start program = "/etc/init.d/nginx start" | |
stop program = "/etc/init.d/nginx stop" | |
# if failed port 80 protocol http request "/" then restart ; I'm redirecting to 443 in Nginx, so no need to monitor | |
if 5 restarts with 5 cycles then timeout | |
depend nginx_bin | |
depend nginx_rc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Varnish | |
check program varnishpanic with path "/bin/varnishadm panic.show" | |
if status != 1 then alert | |
check process varnish with pidfile /var/run/varnish.pid | |
#start program = "/etc/init.d/varnish start" with timeout 30 seconds | |
#stop program = "/etc/init.d/varnish stop" | |
start program = "/usr/bin/systemctl start varnish" with timeout 30 seconds | |
stop program = "/usr/bin/systemctl stop varnish" | |
if failed host 127.0.0.1 port 81 protocol http |