Skip to content

Instantly share code, notes, and snippets.

@benhartwich
benhartwich / nginx.conf
Last active May 8, 2018 07:37
nginx.conf
user www-data;
worker_processes auto;
thread_pool default threads=32 max_queue=65536;
pid /var/run/nginx.pid;
events {
worker_connections 1024; # Abfrage mittels ulimit -n
multi_accept on;
use epoll;
@benhartwich
benhartwich / multisite-mu-domain-mapping.conf
Last active August 29, 2015 14:11
WordPress nginx.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name test.de www.test.de;
root /var/www/httpdocs;
index index.php;
client_max_body_size 30m;
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
@benhartwich
benhartwich / wordpress-auth.conf
Last active May 15, 2018 14:27
WordPress Login Auth Nginx
location ~* /wp-login.php {
satisfy any;
allow 62.218.34.128/28;
deny all;
auth_basic "Please Login";
auth_basic_user_file ssl/.htpasswd;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
try_files $uri =404;
@benhartwich
benhartwich / apache-autoconfig
Last active December 12, 2023 20:31
Autoconfig / Autodiscover
<VirtualHost *:80>
ServerAdmin mail@benjaminhartwich.de
ServerName autoconfig.nichteinschalten.de
ServerAlias autoconfig.nichteinschalten.de
DocumentRoot "/var/www/autoconfig/"
<Directory "/var/www/autoconfig/">
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
[client folder]
listen = 127.0.0.1:9003
listen.allowed_clients = 127.0.0.1
user = username
group = group
listen.mode = 0660
@benhartwich
benhartwich / commands.conf
Created January 18, 2018 12:51
Icinga2 Centreon Commands Integration
object CheckCommand "centreon-snmp-load" {
import "plugin-check-command"
command = [ "/home/icinga2/centreon-plugins/centreon_plugins.pl"]
arguments = {
"--plugin" = "os::linux::snmp::plugin"
"--mode" = "load"
"--hostname" = "$address$"
"--snmp-version" = "2c"
"--snmp-community" = "$snmp_community$"
@benhartwich
benhartwich / opendkim.sh
Created February 14, 2018 11:55
opendKIM autocreate new domain
#!/bin/bash
# Gib die Namen der OpenDKIM Config Dateien an
Key_Table="KeyTable"
Signing_Table="SigningTable"
Trusted_Hosts="TrustedHosts"
# Gib deine Mail Adresse an
MAIL="mail@xy.de"
@benhartwich
benhartwich / vhost.conf
Created May 8, 2018 07:42
PHP FPM for nginx
[username]
listen = /var/run/php/php7.2-fpm-username.sock
listen.allowed_clients = 127.0.0.1
user = username
group = username
listen.mode = 0660
listen.owner = username
listen.group = www-data
@benhartwich
benhartwich / my.conf
Created May 9, 2018 10:59
MariaDB Tuning
[mysqld]
connect_timeout = 15
wait_timeout = 120
max_allowed_packet = 16M
sort_buffer_size = 16M
bulk_insert_buffer_size = 16M
tmp_table_size = 32M
max_heap_table_size = 32M
thread_handling = pool-of-threads
#thread_pool_size = 128
@benhartwich
benhartwich / vhost.conf
Last active October 2, 2018 07:10
LimeSurvey nginx
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name xy.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
ssl_certificate /etc/letsencrypt/live/xy.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/xy.com/privkey.pem;
add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
root /var/kunden/lime/httpdocs;