-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfileserver.conf
More file actions
118 lines (103 loc) · 4.04 KB
/
fileserver.conf
File metadata and controls
118 lines (103 loc) · 4.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<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>