-
Notifications
You must be signed in to change notification settings - Fork 10
/
httpd.chanzhi.conf
140 lines (126 loc) · 3.78 KB
/
httpd.chanzhi.conf
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# server basic settings.
ServerRoot "/opt/zbox/run/apache"
PidFile /opt/zbox/tmp/apache/httpd.pid
DocumentRoot "/opt/zbox/app/htdocs"
Listen 80
User nobody
Group nogroup
ServerAdmin chanzhi@localhost.net
ServerName localhost
EnableMMAP off
EnableSendfile off
TypesConfig /opt/zbox/etc/apache/mime.types
# performance settings.
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
UseCanonicalName Off
HostnameLookups Off
# security.
AccessFileName .htaccess
ServerTokens Prod
ServerSignature Off
# deflat.
AddType image/x-icon .ico
AddType image/gif .gif
AddType image/jpeg .jpg .jpeg
AddType image/png .png
AddType application/javascript .js
DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/css application/javascript
# modules.
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule access_compat_module modules/mod_access_compat.so
LoadModule alias_module modules/mod_alias.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule filter_module modules/mod_filter.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule ssl_module modules/mod_ssl.so
# php module.
LoadModule php7_module modules/libphp7.so
AddType application/x-httpd-php .php .php3 .php4
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler text/plain
</FilesMatch>
# directory settings.
DirectoryIndex index.html index.htm index.php
<Directory />
AllowOverride none
Require all denied
</Directory>
<Directory "/opt/zbox/app/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
<Files "index.php">
SetHandler application/x-httpd-php
</Files>
</Directory>
<DirectoryMatch "/opt/zbox/app/htdocs/.+/.*">
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler text/plain
</FilesMatch>
</DirectoryMatch>
<Files ".ht*">
Require all denied
</Files>
# logs
ErrorLog "/opt/zbox/logs/apache_error_log"
LogLevel warn
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog "/opt/zbox/logs/apache_access_log" combined
<VirtualHost *:80>
ServerAdmin chanzhi@local.net
DocumentRoot "/opt/zbox/app/chanzhi/www"
ServerName localhost
<Directory />
AllowOverride all
Require all granted
<Files "index.php">
SetHandler application/x-httpd-php
</Files>
<Files "upgrade.php">
SetHandler application/x-httpd-php
</Files>
<Files "install.php">
SetHandler application/x-httpd-php
</Files>
</Directory>
<DirectoryMatch "/opt/zbox/app/chanzhi/www/.+/.*">
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler text/plain
</FilesMatch>
</DirectoryMatch>
ErrorLog "/opt/zbox/logs/apache_error_log"
CustomLog "/opt/zbox/logs/apache_access_log" combind
</VirtualHost>
# setting for admin
Alias /adminer "/opt/zbox/app/adminer"
<Directory "/opt/zbox/app/adminer">
AuthName 'zentao admin(run /opt/zbox/auth/adduser.sh to add user.)'
AuthType Basic
AuthUserFile /opt/zbox/auth/users
require valid-user
<Files "index.php">
SetHandler application/x-httpd-php
</Files>
</Directory>
<DirectoryMatch "/opt/zbox/app/adminer/.+/.*">
<FilesMatch ".+\.ph(p[3457]?|t|tml)$">
SetHandler text/plain
</FilesMatch>
</DirectoryMatch>