diff --git a/.gitignore b/.gitignore index b08dc7d..d7d8c1e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .env -docker/apache/ssl/ +docker/apache/ssl/* +!docker/apache/ssl/README.md docker/mysql/data/ diff --git a/docker/apache/000-default.conf b/docker/apache/000-default.conf index 8979fa5..ffbd8fa 100644 --- a/docker/apache/000-default.conf +++ b/docker/apache/000-default.conf @@ -1,4 +1,6 @@ + ServerName www.alwisp.net + ServerAlias alwisp.net ServerAdmin webmaster@alwisp.net DocumentRoot /var/www/html @@ -33,3 +35,64 @@ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined + +# Subdomain: jumpers.stormcloudhills.com -> /uploads/scj +# HTTP: redirect everything to HTTPS + + ServerName jumpers.stormcloudhills.com + ServerAdmin webmaster@alwisp.net + + RewriteEngine On + RewriteRule ^/?(.*)$ https://jumpers.stormcloudhills.com/$1 [R=301,L] + + ErrorLog ${APACHE_LOG_DIR}/jumpers-error.log + CustomLog ${APACHE_LOG_DIR}/jumpers-access.log combined + + +# HTTPS + + + ServerName jumpers.stormcloudhills.com + ServerAdmin webmaster@alwisp.net + DocumentRoot /var/www/html/uploads/scj + DirectoryIndex index.html + + SSLEngine on + SSLCertificateFile /etc/apache2/ssl/jumpers.stormcloudhills.com.crt + SSLCertificateKeyFile /etc/apache2/ssl/jumpers.stormcloudhills.com.key + # If your provider gives a separate CA chain/bundle, uncomment: + #SSLCertificateChainFile /etc/apache2/ssl/jumpers.stormcloudhills.com.chain.crt + + + Options -Indexes +FollowSymLinks + AllowOverride All + Require all granted + + + # Security headers + Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains" + Header always set X-Frame-Options "SAMEORIGIN" + Header always set X-Content-Type-Options "nosniff" + Header always set X-XSS-Protection "1; mode=block" + Header always set Referrer-Policy "strict-origin-when-cross-origin" + + # Compression + + AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/json + + + # Cache static assets + + ExpiresActive On + ExpiresByType image/jpeg "access plus 1 month" + ExpiresByType image/png "access plus 1 month" + ExpiresByType image/webp "access plus 1 month" + ExpiresByType image/svg+xml "access plus 1 month" + ExpiresByType text/css "access plus 1 week" + ExpiresByType application/javascript "access plus 1 week" + + + ErrorLog ${APACHE_LOG_DIR}/jumpers-ssl-error.log + CustomLog ${APACHE_LOG_DIR}/jumpers-ssl-access.log combined + + diff --git a/docker/apache/ssl/README.md b/docker/apache/ssl/README.md new file mode 100644 index 0000000..be3a7ea --- /dev/null +++ b/docker/apache/ssl/README.md @@ -0,0 +1,37 @@ +# Apache SSL certificates + +This directory is mounted into the container at `/etc/apache2/ssl` (see `docker-compose.yml`). +Drop your TLS cert/key here. The actual `.crt`/`.key`/`.pem` files are gitignored — only this README is tracked. + +## Files expected by the vhost config + +For `jumpers.stormcloudhills.com` (`docker/apache/000-default.conf`): + +| File | Purpose | +| --- | --- | +| `jumpers.stormcloudhills.com.crt` | Server certificate (SSLCertificateFile) | +| `jumpers.stormcloudhills.com.key` | Private key (SSLCertificateKeyFile) | +| `jumpers.stormcloudhills.com.chain.crt` | Optional CA chain/bundle (uncomment SSLCertificateChainFile to use) | + +## Option A — Let's Encrypt (recommended for production) + +Issue a cert on the host with certbot, then copy/symlink it in: + +```sh +certbot certonly --standalone -d jumpers.stormcloudhills.com +cp /etc/letsencrypt/live/jumpers.stormcloudhills.com/fullchain.pem \ + docker/apache/ssl/jumpers.stormcloudhills.com.crt +cp /etc/letsencrypt/live/jumpers.stormcloudhills.com/privkey.pem \ + docker/apache/ssl/jumpers.stormcloudhills.com.key +``` + +Restart Apache after each renewal: `docker compose restart web`. + +## Option B — Self-signed (local testing only; browsers will warn) + +```sh +openssl req -x509 -nodes -days 365 -newkey rsa:2048 \ + -keyout docker/apache/ssl/jumpers.stormcloudhills.com.key \ + -out docker/apache/ssl/jumpers.stormcloudhills.com.crt \ + -subj "/CN=jumpers.stormcloudhills.com" +``` diff --git a/www/uploads/scj/index.html b/www/uploads/scj/index.html new file mode 100644 index 0000000..9c759c9 --- /dev/null +++ b/www/uploads/scj/index.html @@ -0,0 +1,12 @@ + + + + + + Storm Cloud Hills Jumpers + + +

jumpers.stormcloudhills.com

+

Coming soon.

+ +