Canonical: https://toolipedia.app/web-server-config-generator

# Web Server Config Generator

Generate an Apache virtual host or a Caddyfile for static sites, single page apps, PHP-FPM or a reverse proxy, with HTTPS redirect and security headers.

Breadcrumbs: Toolipedia > Developer tools > Code and developer utilities > Web Server Config Generator

## About Web Server Config Generator

The Nginx and .htaccess generators on this site cover other servers, while Apache virtual hosts and Caddyfiles have their own syntax. Choose the server, the domain and the kind of site: static files, a single page app that falls back to index.html, PHP through PHP-FPM or a reverse proxy to a local app. Then pick the HTTPS and www behaviour. The Apache result includes a port 80 redirect, the SSL certificate lines, Directory permissions, optional security headers and compression, and the a2enmod command. The Caddy result is far shorter because Caddy handles certificates itself.

## How to use Web Server Config Generator
1. Choose Apache or Caddy, enter the domain and pick the site type.
2. Set the document root or the app address, and the HTTPS and www options.
3. Copy the file to the right folder, test the configuration and reload the server.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.

## Also known as
- apache virtual host generator
- caddyfile generator
- apache vhost config
- caddy reverse proxy config
- apache php fpm virtual host
- caddyfile for single page app

## Frequently asked questions

### Do I need to get the HTTPS certificate first for Apache?

Yes. The virtual host points to the certificate and key files, so run a tool such as certbot first. Caddy gets and renews its own certificate once the domain points to the server.

### Which PHP-FPM socket should I use?

The socket name contains the PHP version, such as php8.2-fpm.sock on Debian and Ubuntu. Check the folder /run/php on your server and change the field to match.

### Does the proxy option support WebSockets?

Caddy supports them with no extra lines. Apache also needs the proxy_wstunnel module and a rewrite rule for the upgrade request, which this page does not generate.

### Is Web Server Config Generator free?

Yes. Web Server Config Generator on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

## Related tools

More free tools that go well with Web Server Config Generator:
- [Nginx config generator](https://toolipedia.app/nginx-config-generator)
- [Hosts File Builder](https://toolipedia.app/hosts-file-builder)
- [.htaccess Generator](https://toolipedia.app/htaccess-generator)
- [SSH Config File Generator](https://toolipedia.app/ssh-config-generator)
- [Web Server Access Log Parser and Summary](https://toolipedia.app/web-server-access-log-parser-and-summary)
