Deploy Static Sites on Apache
This template shows how to serve a static site directly from Apache.
What It Needs
- A document root with built files.
- A simple virtual host.
- Optional redirect and security headers.
Typical Virtual Host
<VirtualHost *:80>
ServerName docs.example.com
DocumentRoot /var/www/docs
<Directory /var/www/docs>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Static Site Checklist
- Build the site before deployment.
- Copy the generated assets into the document root.
- Set correct permissions for the Apache user.
- Add caching headers if the site is asset-heavy.
Practical Notes
- Use Apache as a simple delivery layer.
- Keep the build output separate from source control.
- If the site is behind TLS, redirect plain HTTP to HTTPS.