WebServer » History » Version 5

Anonymous, 08/05/2008 12:27 PM
Improved Installation Guide

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