118 lines
4 KiB
Text
118 lines
4 KiB
Text
<VirtualHost *:80>
|
|
# File server configuration for game server file downloads
|
|
ServerName files.yourdomain.com
|
|
ServerAlias files.*
|
|
|
|
# Document root points to the file server directory
|
|
# Change this path to your actual file server location
|
|
DocumentRoot /var/www/fileserver
|
|
|
|
# Directory configuration
|
|
<Directory /var/www/fileserver>
|
|
Options +Indexes +FollowSymLinks
|
|
AllowOverride None
|
|
Require all granted
|
|
|
|
# Enable directory browsing with custom index
|
|
DirectoryIndex index.html index.php
|
|
|
|
# Fancy indexing for better file browsing
|
|
IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* DescriptionWidth=*
|
|
IndexOrderDefault Descending Date
|
|
|
|
# Add descriptions for common file types
|
|
AddDescription "Game Server Files" *.zip *.tar.gz *.rar
|
|
AddDescription "Configuration File" *.cfg *.ini *.conf
|
|
AddDescription "Script File" *.sh *.bat
|
|
AddDescription "Text Document" *.txt *.md
|
|
|
|
# Set icons for file types
|
|
AddIconByType (TXT,/icons/text.png) text/*
|
|
AddIconByType (IMG,/icons/image2.png) image/*
|
|
AddIcon /icons/compressed.png .zip .tar .gz .rar .7z
|
|
AddIcon /icons/script.png .sh .bat .ps1
|
|
</Directory>
|
|
|
|
# Prevent execution of scripts in upload directories
|
|
<Directory /var/www/fileserver/uploads>
|
|
<FilesMatch "\.(php|php3|php4|php5|phtml|pl|py|jsp|asp|sh|cgi)$">
|
|
Require all denied
|
|
</FilesMatch>
|
|
</Directory>
|
|
|
|
# Set proper MIME types
|
|
<IfModule mod_mime.c>
|
|
AddType application/octet-stream .zip .tar .gz .rar .7z
|
|
AddType text/plain .txt .log .cfg .ini .conf
|
|
</IfModule>
|
|
|
|
# Enable large file downloads
|
|
LimitRequestBody 0
|
|
|
|
# Error and access logs
|
|
ErrorLog ${APACHE_LOG_DIR}/fileserver-error.log
|
|
CustomLog ${APACHE_LOG_DIR}/fileserver-access.log combined
|
|
|
|
# Security headers
|
|
<IfModule mod_headers.c>
|
|
Header always set X-Content-Type-Options "nosniff"
|
|
Header always set X-Frame-Options "SAMEORIGIN"
|
|
</IfModule>
|
|
|
|
# Compression for text files
|
|
<IfModule mod_deflate.c>
|
|
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
|
|
</IfModule>
|
|
|
|
# Cache static files
|
|
<IfModule mod_expires.c>
|
|
ExpiresActive On
|
|
ExpiresDefault "access plus 1 week"
|
|
</IfModule>
|
|
|
|
# Optional: Bandwidth limiting (requires mod_bw or similar)
|
|
# Uncomment and adjust as needed
|
|
#<IfModule mod_bw.c>
|
|
# BandWidthModule On
|
|
# ForceBandWidthModule On
|
|
# BandWidth all 512000
|
|
# MinBandWidth all 50000
|
|
#</IfModule>
|
|
</VirtualHost>
|
|
|
|
# SSL/HTTPS configuration (uncomment and configure after obtaining SSL certificate)
|
|
#<VirtualHost *:443>
|
|
# ServerName files.yourdomain.com
|
|
# ServerAlias files.*
|
|
#
|
|
# DocumentRoot /var/www/fileserver
|
|
#
|
|
# SSLEngine on
|
|
# SSLCertificateFile /etc/ssl/certs/files.yourdomain.com.crt
|
|
# SSLCertificateKeyFile /etc/ssl/private/files.yourdomain.com.key
|
|
# SSLCertificateChainFile /etc/ssl/certs/ca-bundle.crt
|
|
#
|
|
# <Directory /var/www/fileserver>
|
|
# Options +Indexes +FollowSymLinks
|
|
# AllowOverride None
|
|
# Require all granted
|
|
# DirectoryIndex index.html index.php
|
|
# IndexOptions FancyIndexing HTMLTable VersionSort NameWidth=* DescriptionWidth=*
|
|
# IndexOrderDefault Descending Date
|
|
# </Directory>
|
|
#
|
|
# <Directory /var/www/fileserver/uploads>
|
|
# <FilesMatch "\.(php|php3|php4|php5|phtml|pl|py|jsp|asp|sh|cgi)$">
|
|
# Require all denied
|
|
# </FilesMatch>
|
|
# </Directory>
|
|
#
|
|
# ErrorLog ${APACHE_LOG_DIR}/fileserver-ssl-error.log
|
|
# CustomLog ${APACHE_LOG_DIR}/fileserver-ssl-access.log combined
|
|
#
|
|
# <IfModule mod_headers.c>
|
|
# Header always set X-Content-Type-Options "nosniff"
|
|
# Header always set X-Frame-Options "SAMEORIGIN"
|
|
# Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
|
|
# </IfModule>
|
|
#</VirtualHost>
|