WebServer » History » Version 3

Anonymous, 03/28/2008 02:45 PM
Changed Apache configuration file for logging and test release

1 1 Anonymous
= Web Server Configuration =
2 1 Anonymous
Make the following changes to the Apache configuration file (''/etc/httpd/conf/httpd.conf''):
3 1 Anonymous
{{{
4 3 Anonymous
#
5 3 Anonymous
# Listen: Allows you to bind Apache to specific IP addresses and/or
6 3 Anonymous
# ports, in addition to the default. See also the <VirtualHost>
7 3 Anonymous
# directive.
8 3 Anonymous
#
9 3 Anonymous
# Change this to Listen on specific IP addresses as shown below to
10 3 Anonymous
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
11 3 Anonymous
#
12 3 Anonymous
#Port 80  :  Stable production version (release)
13 3 Anonymous
#Port 8080:  Stable test       version (pre-release)
14 3 Anonymous
Listen 80
15 3 Anonymous
Listen 8080
16 3 Anonymous
17 1 Anonymous
User  			procksi
18 1 Anonymous
Group 			procksi
19 1 Anonymous
ServerAdmin		procksi@cs.nott.ac.uk
20 1 Anonymous
ServerName 		procksi.cs.nott.ac.uk
21 1 Anonymous
DocumentRoot /home/procksi/latest/html
22 1 Anonymous
<Directory /home/procksi/latest/html">
23 1 Anonymous
   AllowOverride AuthConfig
24 1 Anonymous
</Directory>
25 1 Anonymous
LogFormat "%t %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
26 1 Anonymous
LogFormat "%t %h %l %u \"%r\" %>s %b" common
27 1 Anonymous
LogFormat "%t %{Referer}i -> %U" referer
28 1 Anonymous
LogFormat "%t %{User-agent}i" agent
29 1 Anonymous
30 1 Anonymous
#Exclude Logging of Ganglia Requests
31 1 Anonymous
SetEnvIf Request_URI "ganglia" ganglia
32 1 Anonymous
33 1 Anonymous
#
34 3 Anonymous
# ErrorLog: The location of the error log file.
35 3 Anonymous
# If you do not specify an ErrorLog directive within a <VirtualHost>
36 3 Anonymous
# container, error messages relating to that virtual host will be
37 3 Anonymous
# logged here.  If you *do* define an error logfile for a <VirtualHost>
38 3 Anonymous
# container, that host's errors will be logged there and not here.
39 3 Anonymous
#
40 3 Anonymous
ErrorLog /home/procksi/logs/latest_error.log
41 3 Anonymous
42 3 Anonymous
#
43 1 Anonymous
# The location and format of the access logfile (Common Logfile Format).
44 1 Anonymous
# If you do not define any access logfiles within a <VirtualHost>
45 1 Anonymous
# container, they will be logged here.  Contrariwise, if you *do*
46 1 Anonymous
# define per-<VirtualHost> access logfiles, transactions will be
47 1 Anonymous
# logged therein and *not* in this file.
48 1 Anonymous
#
49 1 Anonymous
50 3 Anonymous
CustomLog /home/procksi/logs/latest_access.log common env=!ganglia
51 1 Anonymous
52 1 Anonymous
#
53 1 Anonymous
# If you would like to have agent and referer logfiles, uncomment the
54 1 Anonymous
# following directives.
55 1 Anonymous
#
56 1 Anonymous
57 3 Anonymous
CustomLog /home/procksi/logs/latest_referer.log referer env=!ganglia
58 3 Anonymous
CustomLog /home/procksi/logs/latest_agent.log agent env=!ganglia
59 1 Anonymous
60 1 Anonymous
#
61 1 Anonymous
# For a single logfile with access, agent, and referer information
62 1 Anonymous
# (Combined Logfile Format), use the following directive:
63 1 Anonymous
#
64 1 Anonymous
#CustomLog logs/access_log combined env=!ganglia
65 1 Anonymous
66 1 Anonymous
ScriptAlias /cgi-bin/ /home/procksi/latest/cgi-bin/
67 1 Anonymous
68 1 Anonymous
<Directory "/home/procksi/latest/cgi-bin">
69 1 Anonymous
    AllowOverride None
70 1 Anonymous
    Options None
71 1 Anonymous
    Order allow,deny
72 1 Anonymous
    Allow from all
73 1 Anonymous
</Directory>
74 1 Anonymous
75 1 Anonymous
Alias  /data/ 	  /home/procksi/latest/data/
76 1 Anonymous
Alias  /images/   /home/procksi/latest/images/
77 1 Anonymous
Alias  /styles/   /home/procksi/latest/styles/
78 1 Anonymous
Alias  /applets/  /home/procksi/latest/applets/
79 1 Anonymous
Alias  /scripts/  /home/procksi/latest/scripts/
80 1 Anonymous
Alias  /ganglia/  /usr/local/ganglia/html/
81 1 Anonymous
82 1 Anonymous
#Redirection
83 1 Anonymous
Redirect /trac https://psiren.cs.nott.ac.uk/projects/procksi/
84 1 Anonymous
85 1 Anonymous
AddLanguage de .de
86 1 Anonymous
AddLanguage en .en
87 1 Anonymous
AddLanguage es .es
88 1 Anonymous
AddLanguage fr .fr 
89 1 Anonymous
LanguagePriority en es de fr
90 1 Anonymous
91 1 Anonymous
Alias /errordocs/ "/home/procksi/errordocs"
92 1 Anonymous
<IfModule mod_negotiation.c>
93 1 Anonymous
    <IfModule mod_include.c>
94 1 Anonymous
        <Directory /home/procksi/errordocs>
95 1 Anonymous
            AllowOverride none
96 1 Anonymous
            Options MultiViews IncludesNoExec FollowSymLinks
97 1 Anonymous
            AddType text/html .shtml
98 1 Anonymous
            <FilesMatch "\.shtml[.$]">
99 1 Anonymous
                SetOutputFilter INCLUDES
100 1 Anonymous
            </FilesMatch>
101 1 Anonymous
        </Directory>
102 1 Anonymous
103 1 Anonymous
        ErrorDocument 400 /errordocs/400_BAD_REQUEST
104 1 Anonymous
        ErrorDocument 401 /errordocs/401_UNAUTHORIZED
105 1 Anonymous
        ErrorDocument 403 /errordocs/403_FORBIDDEN
106 1 Anonymous
        ErrorDocument 404 /errordocs/404_NOT_FOUND
107 1 Anonymous
        ErrorDocument 405 /errordocs/405_METHOD_NOT_ALLOWED
108 1 Anonymous
        ErrorDocument 406 /errordocs/406_NOT_ACCEPTABLE
109 1 Anonymous
        ErrorDocument 408 /errordocs/408_REQUEST_TIMEOUT
110 1 Anonymous
        ErrorDocument 410 /errordocs/410_GONE
111 1 Anonymous
        ErrorDocument 411 /errordocs/411_LENGTH_REQUIRED
112 1 Anonymous
        ErrorDocument 412 /errordocs/412_PRECONDITION_FAILED
113 1 Anonymous
        ErrorDocument 413 /errordocs/413_REQUEST_ENTITY_TOO_LARGE
114 1 Anonymous
        ErrorDocument 414 /errordocs/414_REQUEST_URI_TOO_LARGE
115 1 Anonymous
        ErrorDocument 415 /errordocs/415_UNSUPPORTED_MEDIA_TYPE
116 1 Anonymous
        ErrorDocument 500 /errordocs/500_INTERNAL_SERVER_ERROR
117 1 Anonymous
        ErrorDocument 501 /errordocs/501_NOT_IMPLEMENTED
118 1 Anonymous
        ErrorDocument 502 /errordocs/502_BAD_GATEWAY
119 1 Anonymous
        ErrorDocument 503 /errordocs/503_SERVICE_UNAVAILABLE
120 1 Anonymous
        ErrorDocument 506 /errordocs/506_VARIANT_ALSO_VARIES
121 1 Anonymous
    </IfModule>
122 1 Anonymous
</IfModule>
123 1 Anonymous
124 1 Anonymous
<Location /server-status>
125 1 Anonymous
    SetHandler server-status
126 1 Anonymous
    Order deny,allow
127 1 Anonymous
    Deny from all
128 1 Anonymous
    Allow from .cs.nott.ac.uk
129 1 Anonymous
</Location>
130 1 Anonymous
131 1 Anonymous
<Location /server-info>
132 1 Anonymous
    SetHandler server-info
133 1 Anonymous
    Order deny,allow
134 1 Anonymous
    Deny from all
135 1 Anonymous
    Allow from .cs.nott.ac.uk
136 1 Anonymous
</Location>
137 3 Anonymous
138 3 Anonymous
#
139 3 Anonymous
# Use name-based virtual hosting.
140 3 Anonymous
#
141 3 Anonymous
NameVirtualHost *:8080
142 3 Anonymous
143 3 Anonymous
<VirtualHost *:8080>
144 3 Anonymous
    ServerName procksi.cs.nott.ac.uk
145 3 Anonymous
    ServerAdmin webmaster@procksi.net
146 3 Anonymous
    DocumentRoot /home/procksi/test/html
147 3 Anonymous
    ServerName procksi.cs.nott.ac.uk:8080
148 3 Anonymous
    ErrorLog  /home/procksi/logs/test_error.log
149 3 Anonymous
    CustomLog /home/procksi/logs/test_access.log common env=!dontlog
150 3 Anonymous
    LogLevel debug
151 3 Anonymous
    ScriptAlias /cgi-bin/ /home/procksi/test/cgi-bin/
152 3 Anonymous
    Alias /data/ /home/procksi/test/data/
153 3 Anonymous
    Alias /images/ /home/procksi/test/images/
154 3 Anonymous
    Alias /styles/ /home/procksi/test/styles/
155 3 Anonymous
    Alias /applets/ /home/procksi/test/applets/
156 3 Anonymous
    Alias /scripts/ /home/procksi/test/scripts/
157 3 Anonymous
</VirtualHost>
158 1 Anonymous
}}} 
159 1 Anonymous
160 2 Anonymous
 * Add search path for programs. Modify ''/etc/init.d/httpd'' to read:
161 2 Anonymous
 {{{
162 2 Anonymous
 RETVAL=0
163 2 Anonymous
 PATH="$PATH:/usr/local/bin"
164 2 Anonymous
 }}}
165 2 Anonymous
166 1 Anonymous
167 1 Anonymous
 * Make the apache daemon start at bootup. Enter at the command line of the master node:
168 1 Anonymous
 {{{
169 1 Anonymous
 /sbin/chkconfig  --add httpd
170 1 Anonymous
 /sbin/chkconfig  httpd  on
171 1 Anonymous
 }}}
172 1 Anonymous
173 1 Anonymous
 * Start the apache daemon. Enter at the command line of the master node: 
174 1 Anonymous
 {{{
175 1 Anonymous
 /sbin/service  httpd  restart
176 1 Anonymous
 }}}