1# Licensed to the Apache Software Foundation (ASF) under one or more
2# contributor license agreements.  See the NOTICE file distributed with
3# this work for additional information regarding copyright ownership.
4# The ASF licenses this file to You under the Apache License, Version 2.0
5# (the "License"); you may not use this file except in compliance with
6# the License.  You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16BEGIN {
17    A["ServerRoot"] = "\${SRVROOT}"
18    A["Port"] = PORT
19    A["SSLPort"] = SSLPORT
20    A["cgidir"] = "cgi-bin"
21    A["logfiledir"] = "logs"
22    A["htdocsdir"] = "htdocs"
23    A["sysconfdir"] = "conf"
24    A["iconsdir"] = "icons"
25    A["manualdir"] = "manual"
26    A["runtimedir"] = "logs"
27    A["errordir"] = "error"
28    A["proxycachedir"] = "proxy"
29
30    B["htdocsdir"] = A["ServerRoot"]"/"A["htdocsdir"]
31    B["iconsdir"] = A["ServerRoot"]"/"A["iconsdir"]
32    B["manualdir"] = A["ServerRoot"]"/"A["manualdir"]
33    B["errordir"] = A["ServerRoot"]"/"A["errordir"]
34    B["proxycachedir"] = A["ServerRoot"]"/"A["proxycachedir"]
35    B["cgidir"] = A["ServerRoot"]"/"A["cgidir"]
36    B["logfiledir"] = A["logfiledir"]
37    B["sysconfdir"] = A["sysconfdir"]
38    B["runtimedir"] = A["runtimedir"]
39}
40
41/^ServerRoot / {
42    print "Define SRVROOT \"SYS:/" BDIR "\""
43    print ""
44}
45/@@LoadModule@@/ {
46    print "#LoadModule access_compat_module modules/accesscompat.nlm"
47    print "#LoadModule actions_module modules/actions.nlm"
48    print "#LoadModule allowmethods_module modules/allowmethods.nlm"
49    print "#LoadModule auth_basic_module modules/authbasc.nlm"
50    print "#LoadModule auth_digest_module modules/authdigt.nlm"
51    print "#LoadModule authn_anon_module modules/authnano.nlm"
52    print "#LoadModule authn_dbd_module modules/authndbd.nlm"
53    print "#LoadModule authn_dbm_module modules/authndbm.nlm"
54    print "#LoadModule authn_file_module modules/authnfil.nlm"
55    print "#LoadModule authz_dbd_module modules/authzdbd.nlm"
56    print "#LoadModule authz_dbm_module modules/authzdbm.nlm"
57    print "#LoadModule authz_groupfile_module modules/authzgrp.nlm"
58    print "#LoadModule authz_user_module modules/authzusr.nlm"
59    print "#LoadModule authnz_ldap_module modules/authnzldap.nlm"
60    print "#LoadModule ldap_module modules/utilldap.nlm"
61    print "#LoadModule asis_module modules/mod_asis.nlm"
62    print "LoadModule autoindex_module modules/autoindex.nlm"
63    print "#LoadModule buffer_module modules/modbuffer.nlm"
64    print "#LoadModule cern_meta_module modules/cernmeta.nlm"
65    print "LoadModule cgi_module modules/mod_cgi.nlm"
66    print "#LoadModule data_module modules/mod_data.nlm"
67    print "#LoadModule dav_module modules/mod_dav.nlm"
68    print "#LoadModule dav_fs_module modules/moddavfs.nlm"
69    print "#LoadModule dav_lock_module modules/moddavlk.nlm"
70    print "#LoadModule expires_module modules/expires.nlm"
71    print "#LoadModule filter_module modules/mod_filter.nlm"
72    print "#LoadModule ext_filter_module modules/extfiltr.nlm"
73    print "#LoadModule file_cache_module modules/filecach.nlm"
74    print "#LoadModule headers_module modules/headers.nlm"
75    print "#LoadModule ident_module modules/modident.nlm"
76    print "#LoadModule imagemap_module modules/imagemap.nlm"
77    print "#LoadModule info_module modules/info.nlm"
78    print "#LoadModule log_forensic_module modules/forensic.nlm"
79    print "#LoadModule logio_module modules/modlogio.nlm"
80    print "#LoadModule mime_magic_module modules/mimemagi.nlm"
81    print "#LoadModule proxy_module modules/proxy.nlm"
82    print "#LoadModule proxy_connect_module modules/proxycon.nlm"
83    print "#LoadModule proxy_http_module modules/proxyhtp.nlm"
84    print "#LoadModule proxy_ftp_module modules/proxyftp.nlm"
85    print "#LoadModule rewrite_module modules/rewrite.nlm"
86    print "#LoadModule speling_module modules/speling.nlm"
87    print "#LoadModule status_module modules/status.nlm"
88    print "#LoadModule unique_id_module modules/uniqueid.nlm"
89    print "#LoadModule usertrack_module modules/usertrk.nlm"
90    print "#LoadModule version_module modules/modversion.nlm"
91    print "#LoadModule userdir_module modules/userdir.nlm"
92    print "#LoadModule vhost_alias_module modules/vhost.nlm"
93    if (MODSSL) {
94       print "#LoadModule socache_dbm_module modules/socachedbm.nlm"
95       print "#LoadModule socache_shmcb_module modules/socacheshmcb.nlm"
96       print "#LoadModule ssl_module modules/mod_ssl.nlm"
97    }
98    print ""
99    next
100}
101
102match ($0,/^#SSLSessionCache +"dbm:/) {
103    sub(/^#/, "")
104}
105
106match ($0,/^SSLSessionCache +"shmcb:/) {
107    sub(/^SSLSessionCache/, "#SSLSessionCache")
108}
109
110match ($0,/^# Mutex +default +file:@rel_runtimedir@/) {
111    sub(/file:@rel_runtimedir@/, "default")
112}
113
114match ($0,/@@.*@@/) {
115    s=substr($0,RSTART+2,RLENGTH-4)
116    sub(/@@.*@@/,A[s],$0)
117}
118
119match ($0,/@rel_.*@/) {
120    s=substr($0,RSTART+5,RLENGTH-6)
121    sub(/@rel_.*@/,A[s],$0)
122}
123
124match ($0,/@exp_.*@/) {
125    s=substr($0,RSTART+5,RLENGTH-6)
126    sub(/@exp_.*@/,B[s],$0)
127}
128
129match ($0,/@nonssl_.*@/) {
130    s=substr($0,RSTART+8,RLENGTH-9)
131    sub(/@nonssl_.*@/,B[s],$0)
132}
133
134match ($0,/^<IfModule cgid_module>$/) {
135    print "#"
136    print "# CGIMapExtension: Technique for locating the interpreter for CGI scripts."
137    print "# The special interpreter path \"OS\" can be used for NLM CGIs."
138    print "#"
139    print "#CGIMapExtension OS .cgi"
140    print "CGIMapExtension SYS:/perl/Perlcgi/perlcgi.nlm .pl"
141    print ""
142}
143
144{
145    print
146}
147
148END {
149    if ((ARGV[1] ~ /httpd.conf.in/) && !BSDSKT) {
150       print ""
151       print "#"
152       print "# SecureListen: Allows you to securely bind Apache to specific IP addresses "
153       print "# and/or ports (mod_nwssl)."
154       print "#"
155       print "# Change this to SecureListen on specific IP addresses as shown below to "
156       print "# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)"
157       print "#"
158       print "#SecureListen "SSLPORT" \"SSL CertificateDNS\""
159    }
160    print ""
161}
162