root/main/trunk/greenstone2/runtime-src/packages/apache-httpd/httpd.conf.in @ 26541

Revision 26541, 14.4 KB (checked in by ak19, 7 years ago)

Kathy said that the apache server really only needs to give access to the collect and web folders (and cgi-bin for remote scripts), and that the rest of GS2 can just be inaccessible. This will deny access to the user databases too and the apache logs. Still need to test as a remote GS against a client-GLI, then will commit the windows version.

Line 
1#
2# This is the main Apache HTTP server configuration file.  It contains the
3# configuration directives that give the server its instructions.
4# See <URL:http://httpd.apache.org/docs/2.2> for detailed information.
5# In particular, see
6# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
7# for a discussion of each configuration directive.
8#
9# Do NOT simply read the instructions in here without understanding
10# what they do.  They're here only as hints or reminders.  If you are unsure
11# consult the online docs. You have been warned. 
12#
13# Configuration and logfile names: If the filenames you specify for many
14# of the server's control files begin with "/" (or "drive:/" for Win32), the
15# server will use that explicit path.  If the filenames do *not* begin
16# with "/", the value of ServerRoot is prepended -- so "logs/foo_log"
17# with ServerRoot set to "**APACHE_HOME_OS**" will be interpreted by the
18# server as "**APACHE_HOME_OS**/logs/foo_log".
19
20#
21# ServerRoot: The top of the directory tree under which the server's
22# configuration, error, and log files are kept.
23#
24# Do not add a slash at the end of the directory path.  If you point
25# ServerRoot at a non-local disk, be sure to point the LockFile directive
26# at a local disk.  If you wish to share the same ServerRoot for multiple
27# httpd daemons, you will need to change at least LockFile and PidFile.
28#
29ServerRoot "**APACHE_HOME_OS**"
30
31#
32# Listen: Allows you to bind Apache to specific IP addresses and/or
33# ports, instead of the default. See also the <VirtualHost>
34# directive.
35#
36# Change this to Listen on specific IP addresses as shown below to
37# prevent Apache from glomming onto all bound IP addresses.
38#
39#Listen 12.34.56.78:80
40Listen **PORT**
41
42# http://httpd.apache.org/docs/1.3/mod/mod_env.html#passenv
43# Linux systems run user accounts as nobody, and so the crucial
44# dynamically linked library path environment variable doesn't
45# get passed through to apache. We make it do so here: PassEnv
46# is set to DYLD_LIBRARY_PATH for Macs, else to LD_LIBRARY_PATH.
47# Also pass the LANG so that the locale/encoding that the apache
48# web server is running with is the same as on the server machine
49PassEnv **LIBRARY_PATH_VAR** LANG
50
51#
52# Dynamic Shared Object (DSO) Support
53#
54# To be able to use the functionality of a module which was built as a DSO you
55# have to place corresponding `LoadModule' lines at this location so the
56# directives contained in it are actually available _before_ they are used.
57# Statically compiled modules (those listed by `httpd -l') do not need
58# to be loaded here.
59#
60# Example:
61# LoadModule foo_module modules/mod_foo.so
62#
63
64<IfModule !mpm_netware_module>
65<IfModule !mpm_winnt_module>
66#
67# If you wish httpd to run as a different user or group, you must run
68# httpd as root initially and it will switch. 
69#
70# User/Group: The name (or #number) of the user/group to run httpd as.
71# It is usually good practice to create a dedicated user and group for
72# running httpd, as with most system services.
73#
74User daemon
75Group daemon
76
77</IfModule>
78</IfModule>
79
80# 'Main' server configuration
81#
82# The directives in this section set up the values used by the 'main'
83# server, which responds to any requests that aren't handled by a
84# <VirtualHost> definition.  These values also provide defaults for
85# any <VirtualHost> containers you may define later in the file.
86#
87# All of these directives may appear inside <VirtualHost> containers,
88# in which case these default settings will be overridden for the
89# virtual host being defined.
90#
91
92#
93# ServerAdmin: Your address, where problems with the server should be
94# e-mailed.  This address appears on some server-generated pages, such
95# as error documents.  e.g. admin@your-domain.com
96#
97ServerAdmin you@example.com
98
99#
100# ServerName gives the name and port that the server uses to identify itself.
101# This can often be determined automatically, but we recommend you specify
102# it explicitly to prevent problems during startup.
103#
104# If your host doesn't have a registered DNS name, enter its IP address here.
105#
106#ServerName www.example.com:80
107
108#
109# DocumentRoot: The directory out of which you will serve your
110# documents. By default, all requests are taken from this directory, but
111# symbolic links and aliases may be used to point to other locations.
112#
113DocumentRoot "**APACHE_HOME_OS**/htdocs"
114
115#
116# Each directory to which Apache has access can be configured with respect
117# to which services and features are allowed and/or disabled in that
118# directory (and its subdirectories).
119#
120# First, we configure the "default" to be a very restrictive set of
121# features. 
122#
123<Directory />
124    Options FollowSymLinks
125    AllowOverride None
126    Order deny,allow
127    Deny from all
128</Directory>
129
130#
131# Note that from this point forward you must specifically allow
132# particular features to be enabled - so if something's not working as
133# you might expect, make sure that you have specifically enabled it
134# below.
135#
136
137#
138# This should be changed to whatever you set DocumentRoot to.
139#
140<Directory "**APACHE_HOME_OS**/htdocs">
141    #
142    # Possible values for the Options directive are "None", "All",
143    # or any combination of:
144    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
145    #
146    # Note that "MultiViews" must be named *explicitly* --- "Options All"
147    # doesn't give it to you.
148    #
149    # The Options directive is both complicated and important.  Please see
150    # http://httpd.apache.org/docs/2.2/mod/core.html#options
151    # for more information.
152    #
153    Options Indexes FollowSymLinks
154
155    #
156    # AllowOverride controls what directives may be placed in .htaccess files.
157    # It can be "All", "None", or any combination of the keywords:
158    #   Options FileInfo AuthConfig Limit
159    #
160    AllowOverride None
161
162    #
163    # Controls who can get stuff from this server.
164    #
165    Order allow,deny
166    Allow from all
167
168</Directory>
169
170#
171# DirectoryIndex: sets the file that Apache will serve if a directory
172# is requested.
173#
174<IfModule dir_module>
175    DirectoryIndex index.html
176</IfModule>
177
178#
179# The following lines prevent .htaccess and .htpasswd files from being
180# viewed by Web clients.
181#
182<FilesMatch "^\.ht">
183    Order allow,deny
184    Deny from all
185    Satisfy All
186</FilesMatch>
187
188#
189# ErrorLog: The location of the error log file.
190# If you do not specify an ErrorLog directive within a <VirtualHost>
191# container, error messages relating to that virtual host will be
192# logged here.  If you *do* define an error logfile for a <VirtualHost>
193# container, that host's errors will be logged there and not here.
194#
195ErrorLog "logs/error_log"
196
197#
198# LogLevel: Control the number of messages logged to the error_log.
199# Possible values include: debug, info, notice, warn, error, crit,
200# alert, emerg.
201#
202LogLevel warn
203
204<IfModule log_config_module>
205    #
206    # The following directives define some format nicknames for use with
207    # a CustomLog directive (see below).
208    #
209    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
210    LogFormat "%h %l %u %t \"%r\" %>s %b" common
211
212    <IfModule logio_module>
213      # You need to enable mod_logio.c to use %I and %O
214      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
215    </IfModule>
216
217    #
218    # The location and format of the access logfile (Common Logfile Format).
219    # If you do not define any access logfiles within a <VirtualHost>
220    # container, they will be logged here.  Contrariwise, if you *do*
221    # define per-<VirtualHost> access logfiles, transactions will be
222    # logged therein and *not* in this file.
223    #
224    CustomLog "logs/access_log" common
225
226    #
227    # If you prefer a logfile with access, agent, and referer information
228    # (Combined Logfile Format) you can use the following directive.
229    #
230    #CustomLog "logs/access_log" combined
231</IfModule>
232
233<IfModule alias_module>
234    #
235    # Redirect: Allows you to tell clients about documents that used to
236    # exist in your server's namespace, but do not anymore. The client
237    # will make a new request for the document at its new location.
238    # Example:
239    # Redirect permanent /foo http://www.example.com/bar
240
241    #
242    # Alias: Maps web paths into filesystem paths and is used to
243    # access content that does not live under the DocumentRoot.
244    # Example:
245    # Alias /webpath /full/filesystem/path
246    #
247    # If you include a trailing / on /webpath then the server will
248    # require it to be present in the URL.  You will also likely
249    # need to provide a <Directory> section to allow access to
250    # the filesystem path.
251
252    #
253    # ScriptAlias: This controls which directories contain server scripts.
254    # ScriptAliases are essentially the same as Aliases, except that
255    # documents in the target directory are treated as applications and
256    # run by the server when requested rather than as documents sent to the
257    # client.  The same rules about trailing "/" apply to ScriptAlias
258    # directives as to Alias.
259    #
260    ScriptAlias /cgi-bin/ "**APACHE_HOME_OS**/cgi-bin/"
261
262</IfModule>
263
264<IfModule cgid_module>
265    #
266    # ScriptSock: On threaded servers, designate the path to the UNIX
267    # socket used to communicate with the CGI daemon of mod_cgid.
268    #
269    #Scriptsock logs/cgisock
270</IfModule>
271
272#
273# "**APACHE_HOME_OS**/cgi-bin" should be changed to whatever your ScriptAliased
274# CGI directory exists, if you have that configured.
275#
276<Directory "**APACHE_HOME_OS**/cgi-bin">
277    AllowOverride None
278    Options None
279    Order allow,deny
280    Allow from all
281</Directory>
282
283#
284# DefaultType: the default MIME type the server will use for a document
285# if it cannot otherwise determine one, such as from filename extensions.
286# If your server contains mostly text or HTML documents, "text/plain" is
287# a good value.  If most of your content is binary, such as applications
288# or images, you may want to use "application/octet-stream" instead to
289# keep browsers from trying to display binary files as though they are
290# text.
291#
292DefaultType text/plain
293
294<IfModule mime_module>
295    #
296    # TypesConfig points to the file containing the list of mappings from
297    # filename extension to MIME-type.
298    #
299    TypesConfig conf/mime.types
300
301    #
302    # AddType allows you to add to or override the MIME configuration
303    # file specified in TypesConfig for specific file types.
304    #
305    #AddType application/x-gzip .tgz
306    #
307    # AddEncoding allows you to have certain browsers uncompress
308    # information on the fly. Note: Not all browsers support this.
309    #
310    #AddEncoding x-compress .Z
311    #AddEncoding x-gzip .gz .tgz
312    #
313    # If the AddEncoding directives above are commented-out, then you
314    # probably should define those extensions to indicate media types:
315    #
316    AddType application/x-compress .Z
317    AddType application/x-gzip .gz .tgz
318
319    #
320    # AddHandler allows you to map certain file extensions to "handlers":
321    # actions unrelated to filetype. These can be either built into the server
322    # or added with the Action directive (see below)
323    #
324    # To use CGI scripts outside of ScriptAliased directories:
325    # (You will also need to add "ExecCGI" to the "Options" directive.)
326    #
327    #AddHandler cgi-script .cgi
328
329    # For type maps (negotiated resources):
330    #AddHandler type-map var
331
332    #
333    # Filters allow you to process content before it is sent to the client.
334    #
335    # To parse .shtml files for server-side includes (SSI):
336    # (You will also need to add "Includes" to the "Options" directive.)
337    #
338    #AddType text/html .shtml
339    #AddOutputFilter INCLUDES .shtml
340</IfModule>
341
342#
343# The mod_mime_magic module allows the server to use various hints from the
344# contents of the file itself to determine its type.  The MIMEMagicFile
345# directive tells the module where the hint definitions are located.
346#
347#MIMEMagicFile conf/magic
348
349#
350# Customizable error responses come in three flavors:
351# 1) plain text 2) local redirects 3) external redirects
352#
353# Some examples:
354#ErrorDocument 500 "The server made a boo boo."
355#ErrorDocument 404 /missing.html
356#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
357#ErrorDocument 402 http://www.example.com/subscription_info.html
358#
359
360#
361# EnableMMAP and EnableSendfile: On systems that support it,
362# memory-mapping or the sendfile syscall is used to deliver
363# files.  This usually improves server performance, but must
364# be turned off when serving from networked-mounted
365# filesystems or if support for these functions is otherwise
366# broken on your system.
367#
368#EnableMMAP off
369#EnableSendfile off
370
371# Supplemental configuration
372#
373# The configuration files in the conf/extra/ directory can be
374# included to add extra features or to modify the default configuration of
375# the server, or you may simply copy their contents here and change as
376# necessary.
377
378# Server-pool management (MPM specific)
379#Include conf/extra/httpd-mpm.conf
380
381# Multi-language error messages
382#Include conf/extra/httpd-multilang-errordoc.conf
383
384# Fancy directory listings
385#Include conf/extra/httpd-autoindex.conf
386
387# Language settings
388#Include conf/extra/httpd-languages.conf
389
390# User home directories
391#Include conf/extra/httpd-userdir.conf
392
393# Real-time info on requests and configuration
394#Include conf/extra/httpd-info.conf
395
396# Virtual hosts
397#Include conf/extra/httpd-vhosts.conf
398
399# Local access to the Apache HTTP Server Manual
400#Include conf/extra/httpd-manual.conf
401
402# Distributed authoring and versioning (WebDAV)
403#Include conf/extra/httpd-dav.conf
404
405# Various default settings
406#Include conf/extra/httpd-default.conf
407
408# Secure (SSL/TLS) connections
409#Include conf/extra/httpd-ssl.conf
410#
411# Note: The following must must be present to support
412#       starting without SSL on platforms with no /dev/random equivalent
413#       but a statically compiled-in mod_ssl.
414#
415<IfModule ssl_module>
416SSLRandomSeed startup builtin
417SSLRandomSeed connect builtin
418</IfModule>
419
420  ScriptAlias /greenstone/cgi-bin "**GSDLHOME**/cgi-bin/**GSDL_OS_ARCH**"
421  <Directory "**GSDLHOME**/cgi-bin/**GSDL_OS_ARCH**">
422     Options None
423     AllowOverride None
424     Order deny,allow
425     **CONNECTPERMISSION** from all
426     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
427  </Directory>
428
429  Alias /greenstone/collect "**COLLECTHOME**"
430  <Directory "**COLLECTHOME**">
431     Options Indexes MultiViews FollowSymLinks
432     AllowOverride None
433     Order deny,allow
434     **CONNECTPERMISSION** from all
435     Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
436  </Directory> 
437 
438  # Deny access to all except collect and web folder
439  <Directory />
440    Order Deny,Allow
441    Deny from all
442  </Directory>
443
444  Alias /greenstone/web "**GSDLHOME**/web"
445  <Directory "**GSDLHOME**/web">
446    Order Deny,Allow
447    **CONNECTPERMISSION** from all
448    Allow from 127.0.0.1 **HOST_IP** **HOSTS** localhost
449  </Directory>
Note: See TracBrowser for help on using the browser.