WebServer » History » Version 3

Version 2 (Anonymous, 10/01/2007 01:24 PM) → Version 3/6 (Anonymous, 03/28/2008 02:45 PM)

= Web Server Configuration =
Make the following changes to the Apache configuration file (''/etc/httpd/conf/httpd.conf''):
{{{
#
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, in addition to the default. See also the <VirtualHost>
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Port 80 : Stable production version (release)
#Port 8080: Stable test version (pre-release)
Listen 80
Listen 8080

User procksi
Group procksi
ServerAdmin procksi@cs.nott.ac.uk
ServerName procksi.cs.nott.ac.uk
DocumentRoot /home/procksi/latest/html
<Directory /home/procksi/latest/html">
AllowOverride AuthConfig
</Directory>
LogFormat "%t %h %l %u \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%t %h %l %u \"%r\" %>s %b" common
LogFormat "%t %{Referer}i -> %U" referer
LogFormat "%t %{User-agent}i" agent

#Exclude Logging of Ganglia Requests
SetEnvIf Request_URI "ganglia" ganglia

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there
and not here.
#
ErrorLog /home/procksi/logs/latest_error.log

#
# The location and
format of the access logfile (Common Logfile Format).
# If you do not define any access logfiles within a <VirtualHost>
# container, they will be logged here. Contrariwise, if you *do*
# define per-<VirtualHost> access logfiles, transactions will be
# logged therein and *not* in this file.
#

CustomLog /home/procksi/logs/latest_access.log /home/procksi/latest/logs/access.log common env=!ganglia

#
# If you would like to have agent and referer logfiles, uncomment the
# following directives.
#

CustomLog /home/procksi/logs/latest_referer.log /home/procksi/latest/logs/referer.log referer env=!ganglia
CustomLog /home/procksi/logs/latest_agent.log /home/procksi/latest/logs/agent.log agent env=!ganglia

#
# For a single logfile with access, agent, and referer information
# (Combined Logfile Format), use the following directive:
#
#CustomLog logs/access_log combined env=!ganglia

ScriptAlias /cgi-bin/ /home/procksi/latest/cgi-bin/

<Directory "/home/procksi/latest/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>

Alias /data/ /home/procksi/latest/data/
Alias /images/ /home/procksi/latest/images/
Alias /styles/ /home/procksi/latest/styles/
Alias /applets/ /home/procksi/latest/applets/
Alias /scripts/ /home/procksi/latest/scripts/
Alias /ganglia/ /usr/local/ganglia/html/

#Redirection
Redirect /trac https://psiren.cs.nott.ac.uk/projects/procksi/

AddLanguage de .de
AddLanguage en .en
AddLanguage es .es
AddLanguage fr .fr
LanguagePriority en es de fr

Alias /errordocs/ "/home/procksi/errordocs"
<IfModule mod_negotiation.c>
<IfModule mod_include.c>
<Directory /home/procksi/errordocs>
AllowOverride none
Options MultiViews IncludesNoExec FollowSymLinks
AddType text/html .shtml
<FilesMatch "\.shtml[.$]">
SetOutputFilter INCLUDES
</FilesMatch>
</Directory>

ErrorDocument 400 /errordocs/400_BAD_REQUEST
ErrorDocument 401 /errordocs/401_UNAUTHORIZED
ErrorDocument 403 /errordocs/403_FORBIDDEN
ErrorDocument 404 /errordocs/404_NOT_FOUND
ErrorDocument 405 /errordocs/405_METHOD_NOT_ALLOWED
ErrorDocument 406 /errordocs/406_NOT_ACCEPTABLE
ErrorDocument 408 /errordocs/408_REQUEST_TIMEOUT
ErrorDocument 410 /errordocs/410_GONE
ErrorDocument 411 /errordocs/411_LENGTH_REQUIRED
ErrorDocument 412 /errordocs/412_PRECONDITION_FAILED
ErrorDocument 413 /errordocs/413_REQUEST_ENTITY_TOO_LARGE
ErrorDocument 414 /errordocs/414_REQUEST_URI_TOO_LARGE
ErrorDocument 415 /errordocs/415_UNSUPPORTED_MEDIA_TYPE
ErrorDocument 500 /errordocs/500_INTERNAL_SERVER_ERROR
ErrorDocument 501 /errordocs/501_NOT_IMPLEMENTED
ErrorDocument 502 /errordocs/502_BAD_GATEWAY
ErrorDocument 503 /errordocs/503_SERVICE_UNAVAILABLE
ErrorDocument 506 /errordocs/506_VARIANT_ALSO_VARIES
</IfModule>
</IfModule>

<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from .cs.nott.ac.uk
</Location>

<Location /server-info>
SetHandler server-info
Order deny,allow
Deny from all
Allow from .cs.nott.ac.uk
</Location>

#
# Use name-based virtual hosting.
#
NameVirtualHost *:8080

<VirtualHost *:8080>
ServerName procksi.cs.nott.ac.uk
ServerAdmin webmaster@procksi.net
DocumentRoot /home/procksi/test/html
ServerName procksi.cs.nott.ac.uk:8080
ErrorLog /home/procksi/logs/test_error.log
CustomLog /home/procksi/logs/test_access.log common env=!dontlog
LogLevel debug
ScriptAlias /cgi-bin/ /home/procksi/test/cgi-bin/
Alias /data/ /home/procksi/test/data/
Alias /images/ /home/procksi/test/images/
Alias /styles/ /home/procksi/test/styles/
Alias /applets/ /home/procksi/test/applets/
Alias /scripts/ /home/procksi/test/scripts/
</VirtualHost>

}}}

* Add search path for programs. Modify ''/etc/init.d/httpd'' to read:
{{{
RETVAL=0
PATH="$PATH:/usr/local/bin"
}}}

* Make the apache daemon start at bootup. Enter at the command line of the master node:
{{{
/sbin/chkconfig --add httpd
/sbin/chkconfig httpd on
}}}

* Start the apache daemon. Enter at the command line of the master node:
{{{
/sbin/service httpd restart
}}}