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

Parameter

Description

ipaddress

The IP address for the site.

 

 

port

The port number to be used to for HTTP access to the site.

 

 

name

The name of the site.

 

 

root

The root folder for the site’s files and subfolders.

 

 

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 the Server Performance

When trying to analyze the server’s performance, keep in mind that a lot of factors can affect performance: CGI scripts growing too large, database queries exhausting your computer’s resources, 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 thus get an idea of how long it takes your website to respond, as well as other valuable statistics. The following command will simulate 1000 requests to the specified URL with the user name and password provided.

$ ab -n 1000 -c 1 -A user:password www.student number.example.com/

Chapter 13 Working with Web Technologies

213

Page 213
Image 213
Apple Mac OS X Server manual Tuning the Server Performance, To run the script