summaryrefslogtreecommitdiff
path: root/etc/httpd/conf/httpd.conf
blob: 3b6da7164e9baf472bee9a816110e069f1dd0e37 (plain)
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
#
#
# Apache Server Configuration

ServerRoot /etc/httpd

#
# Load Modules
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule dir_module modules/mod_dir.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule alias_module modules/mod_alias.so
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

# Load CGI Module
<IfModule !mpm_prefork_module>
   LoadModule cgid_module modules/mod_cgid.so
</IfModule>
<IfModule mpm_prefork_module>
   LoadModule cgi_module modules/mod_cgi.so
</IfModule>

# And Basic Auth Modules
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_user_module modules/mod_authz_user.so

#
# Server config
Listen 0.0.0.0:80
ServerName localhost
ServerAdmin root@localhost
EnableSendFile on
AddDefaultCharset UTF-8
TypesConfig /etc/mime.types
MIMEMagicFile conf/magic
AddHandler cgi-script .cgi

# Always wear protection.
<Directory />
    Require all denied
</Directory>

# NOTE: Alias matcher MUST end in /, not /cgit.cgi. It WILL break otherwise.
# ALSO: "cgitrc must have a virtual-root=/".
# Remove /cgit.cgi/ from url paths.
ScriptAlias "/" "/srv/www/htdocs/cgit/cgit.cgi/"
<Directory "/srv/www/htdocs/cgit/">
    DirectoryIndex cgit.cgi
    AllowOverride None
    Options +ExecCGI +FollowSymLinks
    SetHandler cgi-script
    Require all granted
</Directory>

# Deny access to .htaccess/.htpasswd
<Files ".ht">
    Require all denied
</Files>