tkr/examples/apache/vps/root/tkr.my-domain.com.conf
Greg Sarjeant 86abf587f6 simplify web server configs (#65)
Reviewed-on: https://gitea.subcultureofone.org/greg/tkr/pulls/65
Co-authored-by: Greg Sarjeant <greg@subcultureofone.org>
Co-committed-by: Greg Sarjeant <greg@subcultureofone.org>
2025-08-10 22:13:45 +00:00

49 lines
1.4 KiB
Plaintext

# Basic Apache VirtualHost for tkr
# Replace "your-domain.com" with your actual domain
# Replace "/var/www/tkr" with your installation path
# HTTP - redirect to HTTPS
<VirtualHost *:80>
ServerName your-domain.com
Redirect permanent / https://your-domain.com/
</VirtualHost>
# HTTPS
<VirtualHost *:443>
ServerName your-domain.com
DocumentRoot /var/www/tkr/public
# SSL Configuration (using Let's Encrypt)
SSLEngine on
SSLCertificateFile /etc/letsencrypt/live/your-domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/your-domain.com/privkey.pem
# Main directory - route everything through index.php
<Directory "/var/www/tkr/public">
AllowOverride None
Require all granted
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
</Directory>
# Block access to sensitive directories
<Directory "/var/www/tkr/storage">
Require all denied
</Directory>
<Directory "/var/www/tkr/src">
Require all denied
</Directory>
<Directory "/var/www/tkr/config">
Require all denied
</Directory>
<Directory "/var/www/tkr/templates">
Require all denied
</Directory>
ErrorLog ${APACHE_LOG_DIR}/tkr_error.log
CustomLog ${APACHE_LOG_DIR}/tkr_access.log combined
</VirtualHost>