Cette page n’est pas encore traduite en français : elle s’affiche en anglais.

Apache VirtualHost Generator — vhost Config with HTTPS

Get a complete Apache virtual host config for your domain: a static site, WordPress, PHP-FPM or a reverse proxy to a Node or Python app. Tick HTTPS with Let’s Encrypt, www redirects, HTTP/2, compression, caching and security headers — and get the a2enmod commands it needs.

Mis à jour le
VirtualHost
Enable commands

Vos données ne quittent jamais votre ordinateur. Tout le traitement se fait localement dans votre navigateur.

Comment utiliser : Apache VirtualHost Generator

  1. Pick the scenario: static site, WordPress (pretty permalinks and .htaccess support), PHP-FPM or a reverse proxy to an app on a port.
  2. Enter your domain, the document root or upstream address and how www should be handled.
  3. Tick the extras — HTTPS, HTTP/2, compression, caching, security headers, WebSockets.
  4. Save the config in /etc/apache2/sites-available/ and run the enable commands — they include the modules it needs.

VirtualHost vs .htaccess

A VirtualHost lives in the server config and is read once when Apache starts, so it is faster and can do things .htaccess can’t, like listening on ports, SSL certificates and proxying. Use .htaccess only when you can’t edit the server config (shared hosting) — the .htaccess Generator covers that case.

Modules the config uses

OptionModule
HTTPS redirect, www redirect, WordPressmod_rewrite
HTTPSmod_ssl
HTTP/2mod_http2 (needs the event or worker MPM, which PHP-FPM setups use)
Reverse proxy / WebSocketsmod_proxy, mod_proxy_http, mod_proxy_wstunnel
PHP-FPMmod_proxy_fcgi
Compression, caching, headersmod_deflate, mod_expires, mod_headers

Check the syntax with sudo apachectl configtest before reloading. Prefer Nginx or Caddy? See the Nginx Config Generator and Caddyfile Generator.

Aussi recherché comme : apache vhost config, apache reverse proxy config, apache virtual host example, apache ssl virtualhost, apache wordpress config, apache2 site config, apache https redirect.

Outils complémentaires : Apache VirtualHost Generator

  • .htaccess Tester & Validator — Find the line that causes a 500 error and test rewrite rules before you deploy: enter a URL to see which conditions match, where it redirects or what it rewrites to.
  • SSL Checker — Verify an HTTPS certificate in seconds — see when it expires, who issued it, which hostnames it covers and whether the chain is trusted.
  • Security Headers Checker — Grade a site’s HTTP security headers from A+ to F, see which are missing and why they matter, and copy ready-made config snippets for Nginx, Apache, Netlify, Vercel or Cloudflare.
  • YAML Validator — Paste a Docker Compose file, Kubernetes manifest, GitHub Actions workflow or any YAML to pinpoint errors, catch common pitfalls and get a cleanly formatted version.

Questions fréquentes

Where do Apache virtual host files go?
On Debian and Ubuntu: /etc/apache2/sites-available/DOMAIN.conf, enabled with sudo a2ensite DOMAIN. On RHEL, Rocky and Alma: /etc/httpd/conf.d/DOMAIN.conf.
How do I redirect HTTP to HTTPS in Apache?
Tick HTTPS: the port 80 VirtualHost redirects every request to https:// with a 301, and the port 443 VirtualHost serves the site with your certificate.
How do I use Apache as a reverse proxy?
Choose Reverse proxy and enter the app address. The config uses ProxyPass and ProxyPassReverse, keeps the Host header and sends X-Forwarded-Proto so the app knows the request was HTTPS.
Why does WordPress need AllowOverride All?
WordPress writes its permalink rules to .htaccess. AllowOverride All lets Apache read that file; without it, every page except the home page returns 404.
Puis-je installer Apache VirtualHost Generator en tant qu’application web et l’utiliser hors ligne ?
Oui. Apache VirtualHost Generator est une application web installable (PWA) : elle s’installe depuis votre navigateur, sans passer par une boutique d’applications. Cliquez sur « Installer l’application » en haut de cette page dans Chrome ou Edge (Windows, macOS, Linux, ChromeOS) ; sur Android, utilisez « Partager » → « Ajouter à l’écran d’accueil » sur iPhone et iPad ; ou « Fichier » → « Ajouter au Dock » dans Safari 17+ sur Mac. L’application s’ouvre alors dans sa propre fenêtre avec sa propre icône, et comme elle s’exécute entièrement dans votre navigateur, elle continue de fonctionner hors ligne. Firefox sur ordinateur de bureau ne permet pas d’installer d’applications web. Comment fonctionne l’installation.

Outils similaires