Web Server Config Creator & Linux SysAdmin Tools
Create ready-to-deploy Nginx, Apache, and OpenLiteSpeed configuration files for PHP, WordPress, Laravel, Django, Node.js, and static React apps, plus calculators for PHP-FPM memory pools, Linux chmod permissions, and Nginx rate limiting.
Nginx, Apache & OpenLiteSpeed Config File Creator
Generate production-hardened virtual host configuration files for PHP-FPM, WordPress, Laravel, Node.js/Next.js, Python/Django, or static React SPAs, complete with TLS 1.3, security headers, and deploy commands.
Activation & Syntax Test Commands
# 1. Enable site & test syntax before reloading sudo ln -sf /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/example.com.conf sudo nginx -t && sudo systemctl reload nginx
# Nginx Virtual Host for example.com (WORDPRESS)
# Save to: /etc/nginx/sites-available/example.com.conf
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
# Allow Let's Encrypt HTTP-01 ACME verification
location ^~ /.well-known/acme-challenge/ {
root /var/www/certbot;
allow all;
}
location / {
return 301 https://example.com$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com www.example.com;
if ($host = www.example.com) {
return 301 https://example.com$request_uri;
}
# TLS 1.2 / 1.3 Certificates (Certbot / Let's Encrypt)
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers off;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
root /var/www/example.com/public_html;
index index.php index.html;
client_max_body_size 64M;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log warn;
# Security Headers
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# Gzip Compression
gzip on;
gzip_vary on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml;
location / {
try_files $uri $uri/ /index.php?$args;
}
# WordPress Hardening: Block xmlrpc.php & PHP execution in uploads
location = /xmlrpc.php {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_keep_conn off; # Hardened against CVE-2026-129289 request smuggling
fastcgi_read_timeout 120s;
}
# Block hidden dotfiles (.env, .git, .htaccess)
location ~ /\.(?!well-known).* {
deny all;
}
# Cache static images, fonts, CSS, and JS
location ~* \.(?:css|js|svg|webp|jpg|jpeg|png|gif|ico|woff2)$ {
expires 365d;
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
}
}How to Measure Real Inputs Before Applying Configs
Generated server configurations are only as accurate as the baseline measurements from your live host. Before editing production files:
- Measure real PHP-FPM worker memory: Run
ps --no-headers -o rss -C php-fpm8.3 | awk '{s+=$1; n++} END {print s/n/1024}'during active traffic rather than guessing average RSS. - Avoid world-writable (
777) permissions: Web servers should own or read files via644/640and directories via755/750. Never set777to work around PHP-FPM user/group ownership mismatches. - Always test configs in staging first: Validate syntax with
php-fpm -tornginx -tbefore reloading services, and review our Technical Disclaimer.
Looking for deeper walkthroughs behind these formulas? Browse all guides on the Linux & DevOps Blog or reach out directly for hands-on server tuning.