WebServer » History » Version 6

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

1 6 Anonymous
2 6 Anonymous
h1. Web Server Configuration
3 6 Anonymous
4 6 Anonymous
In order to access the main RELEASE, make the following changes to the Apache configuration file (_/etc/httpd/conf/httpd.conf_):
5 6 Anonymous
<pre>
6 3 Anonymous
#
7 3 Anonymous
# Listen: Allows you to bind Apache to specific IP addresses and/or
8 3 Anonymous
# ports, in addition to the default. See also the <VirtualHost>
9 3 Anonymous
# directive.
10 3 Anonymous
#
11 3 Anonymous
# Change this to Listen on specific IP addresses as shown below to
12 3 Anonymous
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
13 3 Anonymous
#
14 1 Anonymous
#Port 80  :  Stable production version (release)
15 1 Anonymous
Listen 80
16 1 Anonymous
17 1 Anonymous
User  			procksi
18 1 Anonymous
Group 			procksi_dev
19 6 Anonymous
[[ServerAdmin]]		procksi@cs.nott.ac.uk
20 6 Anonymous
[[ServerName]] 		procksi.cs.nott.ac.uk
21 6 Anonymous
[[DocumentRoot]] /home/procksi/latest/html
22 1 Anonymous
<Directory /home/procksi/latest/html">
23 6 Anonymous
   [[AllowOverride]] AuthConfig
24 1 Anonymous
</Directory>
25 6 Anonymous
[[LogFormat]] "%t %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
26 6 Anonymous
[[LogFormat]] "%t %h %l %u \"%r\" %>s %b" common
27 6 Anonymous
[[LogFormat]] "%t %{Referer}i -> %U" referer
28 6 Anonymous
[[LogFormat]] "%t %{User-agent}i" agent
29 1 Anonymous
30 1 Anonymous
#Exclude Logging of Ganglia Requests
31 6 Anonymous
[[SetEnvIf]] Request_URI "ganglia" ganglia
32 1 Anonymous
33 3 Anonymous
#
34 6 Anonymous
# [[ErrorLog]]: The location of the error log file.
35 6 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 1 Anonymous
#
40 6 Anonymous
[[ErrorLog]] /home/procksi/logs/latest_error.log
41 3 Anonymous
42 1 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 3 Anonymous
#
49 1 Anonymous
50 6 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 3 Anonymous
57 6 Anonymous
[[CustomLog]] /home/procksi/logs/latest_referer.log referer env=!ganglia
58 6 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 6 Anonymous
[[ScriptAlias]] /cgi-bin/ /home/procksi/latest/cgi-bin/
67 1 Anonymous
68 1 Anonymous
<Directory "/home/procksi/latest/cgi-bin">
69 6 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 6 Anonymous
[[AddLanguage]] de .de
86 6 Anonymous
[[AddLanguage]] en .en
87 6 Anonymous
[[AddLanguage]] es .es
88 6 Anonymous
[[AddLanguage]] fr .fr 
89 6 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 6 Anonymous
            [[AllowOverride]] none
96 6 Anonymous
            Options [[MultiViews]] IncludesNoExec [[FollowSymLinks]]
97 6 Anonymous
            [[AddType]] text/html .shtml
98 1 Anonymous
            <FilesMatch "\.shtml[.$]">
99 6 Anonymous
                [[SetOutputFilter]] INCLUDES
100 1 Anonymous
            </FilesMatch>
101 1 Anonymous
        </Directory>
102 1 Anonymous
103 6 Anonymous
        [[ErrorDocument]] 400 /errordocs/400_BAD_REQUEST
104 6 Anonymous
        [[ErrorDocument]] 401 /errordocs/401_UNAUTHORIZED
105 6 Anonymous
        [[ErrorDocument]] 403 /errordocs/403_FORBIDDEN
106 6 Anonymous
        [[ErrorDocument]] 404 /errordocs/404_NOT_FOUND
107 6 Anonymous
        [[ErrorDocument]] 405 /errordocs/405_METHOD_NOT_ALLOWED
108 6 Anonymous
        [[ErrorDocument]] 406 /errordocs/406_NOT_ACCEPTABLE
109 6 Anonymous
        [[ErrorDocument]] 408 /errordocs/408_REQUEST_TIMEOUT
110 6 Anonymous
        [[ErrorDocument]] 410 /errordocs/410_GONE
111 6 Anonymous
        [[ErrorDocument]] 411 /errordocs/411_LENGTH_REQUIRED
112 6 Anonymous
        [[ErrorDocument]] 412 /errordocs/412_PRECONDITION_FAILED
113 6 Anonymous
        [[ErrorDocument]] 413 /errordocs/413_REQUEST_ENTITY_TOO_LARGE
114 6 Anonymous
        [[ErrorDocument]] 414 /errordocs/414_REQUEST_URI_TOO_LARGE
115 6 Anonymous
        [[ErrorDocument]] 415 /errordocs/415_UNSUPPORTED_MEDIA_TYPE
116 6 Anonymous
        [[ErrorDocument]] 500 /errordocs/500_INTERNAL_SERVER_ERROR
117 6 Anonymous
        [[ErrorDocument]] 501 /errordocs/501_NOT_IMPLEMENTED
118 6 Anonymous
        [[ErrorDocument]] 502 /errordocs/502_BAD_GATEWAY
119 6 Anonymous
        [[ErrorDocument]] 503 /errordocs/503_SERVICE_UNAVAILABLE
120 6 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 6 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 6 Anonymous
    [[SetHandler]] server-info
133 1 Anonymous
    Order deny,allow
134 5 Anonymous
    Deny from all
135 5 Anonymous
    Allow from .cs.nott.ac.uk
136 5 Anonymous
</Location>
137 5 Anonymous
138 6 Anonymous
</pre>
139 5 Anonymous
140 6 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 [[Networking|Firewall]] rules to allow access to the give _port nubmer_:
141 6 Anonymous
<pre>
142 5 Anonymous
#
143 5 Anonymous
# Listen: Allows you to bind Apache to specific IP addresses and/or
144 5 Anonymous
# ports, in addition to the default. See also the <VirtualHost>
145 5 Anonymous
# directive.
146 5 Anonymous
#
147 5 Anonymous
# Change this to Listen on specific IP addresses as shown below to
148 5 Anonymous
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
149 5 Anonymous
#
150 5 Anonymous
#Port 80  :  Stable production version (release)
151 5 Anonymous
#Port 8080:  Stable test       version (pre-release)
152 3 Anonymous
Listen 80
153 3 Anonymous
Listen 8080
154 3 Anonymous
155 3 Anonymous
#
156 3 Anonymous
# Use name-based virtual hosting.
157 3 Anonymous
#
158 6 Anonymous
[[NameVirtualHost]] *:8080
159 3 Anonymous
160 3 Anonymous
<VirtualHost *:8080>
161 6 Anonymous
    [[ServerName]] procksi.cs.nott.ac.uk
162 6 Anonymous
    [[ServerAdmin]] webmaster@procksi.net
163 6 Anonymous
    [[DocumentRoot]] /home/procksi/test/html
164 6 Anonymous
    [[ServerName]] procksi.cs.nott.ac.uk:8080
165 6 Anonymous
    [[ErrorLog]]  /home/procksi/logs/test_error.log
166 6 Anonymous
    [[CustomLog]] /home/procksi/logs/test_access.log common env=!dontlog
167 6 Anonymous
    [[LogLevel]] debug
168 6 Anonymous
    [[ScriptAlias]] /cgi-bin/ /home/procksi/test/cgi-bin/
169 3 Anonymous
    Alias /data/ /home/procksi/test/data/
170 1 Anonymous
    Alias /images/ /home/procksi/test/images/
171 5 Anonymous
    Alias /styles/ /home/procksi/test/styles/
172 2 Anonymous
    Alias /applets/ /home/procksi/test/applets/
173 2 Anonymous
    Alias /scripts/ /home/procksi/test/scripts/
174 2 Anonymous
</VirtualHost>
175 6 Anonymous
</pre>
176 2 Anonymous
177 6 Anonymous
* Add search path for programs. Modify _/etc/init.d/httpd_ to read:
178 6 Anonymous
<pre>
179 1 Anonymous
 RETVAL=0
180 1 Anonymous
 PATH="$PATH:/usr/local/bin"
181 6 Anonymous
</pre>
182 1 Anonymous
183 1 Anonymous
184 6 Anonymous
* Make the apache daemon start at bootup. Enter at the command line of the master node:
185 6 Anonymous
<pre>
186 1 Anonymous
 /sbin/chkconfig  --add httpd
187 1 Anonymous
 /sbin/chkconfig  httpd  on
188 6 Anonymous
</pre>
189 1 Anonymous
190 6 Anonymous
* Start the apache daemon. Enter at the command line of the master node: 
191 6 Anonymous
<pre>
192 1 Anonymous
 /sbin/service  httpd  graceful
193 6 Anonymous
</pre>