Specifications
Chapter 13 Configuring and Managing Web Technologies 217
web:Sites:_array_id:_ipaddr\:_port__servername:ErrorDocument:_array_index:0:
StatusCode = 404
web:Sites:_array_id:_ipaddr\:_port__servername:ErrorDocument:_array_index:0:
Document = "/nwesite_notfound.html"
web:Sites:_array_id:_ipaddr\:_port__servername:LogLevel = "warn"
web:Sites:_array_id:_ipaddr\:_port__servername:IfModule:_array_id:mod_ssl.c:
SSLEngine = no
web:Sites:_array_id:_ipaddr\:_port__servername:IfModule:_array_id:mod_ssl.c:
SSLPassPhrase = ""
web:Sites:_array_id:_ipaddr\:_port__servername:IfModule:_array_id:mod_ssl.c:
SSLLog = "/private/var/log/httpd/ssl_engine_log"
web:Sites:_array_id:_ipaddr\:_port__servername:DocumentRoot = "_docroot"
web:Sites:_array_id:_ipaddr\:_port__servername
To run the script:
$ addsite
ipaddress
port
name
root
If you get the message command not found when you try to run the script, precede the
command with the full path to the script file. For example:
/Users/admin/Documents/addsite 10.0.0.2 80 corpsite /Users/webmaster/Sites/
corpsite
Or, use cd to change to the folder that contains the file and precede the command
with ./. For example:
$ cd /Users/admin/Documents
$ ./addsite 10.0.0.2 80 corpsite /users/webmaster/sites/corpsite
Tuning Server Performance
A number of factors can affect server performance: CGI scripts can grow too large,
database queries exhaust your computer’s resources, there can be too much network
traffic, and so on.
Apache provides a basic benchmarking tool, ab. You can use ab to simulate hits to your
web server and get an idea of how long it takes your website to respond, as well as
other valuable statistics.
The following command simulates 1,000 requests to the specified URL with the user
name and password provided.
$ ab -n 1000 -c 1 -A
user
:
password
www.
studentnumber
.example.com/
Parameter Description
ipaddress
The IP address for the site
port
The port number to be used for HTTP access to the site
name
The name of the site
root
The root folder for the site’s files and subfolders