NetAirt Installation ===================== 1. Run './configure'. The following parameters may be useful: --prefix (defines the installation root) and --with-mpm (selects MPM), for example: './configure --prefix=/usr/local/netairt --with-mpm=worker' All the parameters are forwarded to the Apache's 'configure' script, so if you want to use any Apache-specific options, do it here. Note that NetAirt only works with ``prefork'' or ``worker'' MPM. Other MPMs are not supported at the moment. 2. Compile everything with 'make'. 3. Install Netairt with 'make install'. In case anything goes wrong, try again with newer versions of GNU tools (make, patch, configure, etc. ). NetAirt Configuration ====================== 1. The NetAirt configuration is appended to the main Apache configuration file (httpd.conf). 2. All NetAirt-related directives start with ``NetAirt.'' 3. Default values mean values inside the binary code. They can be overidden with the values from the configuration file. Directives: NetAirtMode {NONE|HTTP|DNS|BOTH} NetAirt redirection mode: ``NONE'' disables NetAirt; ``HTTP'' activates HTTP-based redirection (302 Moved); ``DNS'' activates internal DNS server (requires access to port 53, so you probably must be root); and ``BOTH'' activates both HTTP and DNS redirection modes. Default is NONE. NetAirtMaintListen 127.0.0.1:1053 NetAirtMaintPassword "magicword" These options activate a maintenance port, which provides a simple way to modify the set of replicas. A short help is available after connecting to this port and typing in the password. Disabled by default. NetAirtResetOnRestart On Specifies, whether the database content should be cleared each time Apache is restarted. Makes sense only when NetAirt is statically-linked with the rest of Apache. Default is On. NetAirtMaxSites 8 NetAirtMaxReplicas 32 These directives define the size of the database. MaxSites is the maximum number of different host/domain names that NetAirt is going to support. MaxReplicas is the maximum total number of replicas defined for all the sites together. Default are 8 and 32, respectively. NetAirtMaxIPCount 3 The number of different IP addresses returned in a single DNS response. Default is 3. Site definitions: ================= .. For all site-defining directives, multiple instances regarding the same host/domain name are merged. can be either an IP address or a hostname. For hostnames, their corresponding IPs are resolved during the server startup. can be either a hostname, or a domain name (starting with ``.''). If is a domain name, the entry is used only by the DNS redirector, which treats all hosts inside it 2nd-level DNS servers. IPs of different DNS servers are returned depending on the policy defined by (Static/RR/AS). To find out more about 2-level DNS redirection, read this article: J.Dilley at al., ``Globally Distributed Content Delivery'' http://www.computer.org/internet/ic2002/w5050abs.htm NetAirtSite www.static.com 192.168.0.1 192.168.0.2 192.168.0.3 A static site definition. Each time a DNS query regarding a static site arrives, the DNS redirector returns the sequence of maximum first IP addresses defined for the site, always in the same order. No default. NetAirtSiteRR www.roundrobin.com 10.0.0.1 round-robin.com 10.0.0.3 10.0.0.4 10.0.0.5 NetAirtSiteRR www.roundrobin.com 10.0.0.6 www5.roundrobin.com www7.roundrobin.com Round-Robin site definition. For each DNS query regarding a round-robin site the DNS redirector returns the sequence of maximum IP addresses defined for the site. Subsequent queries regarding the same round-robin site get responses starting at subsequent IP addresses. The list of all addresses in the site is cyclic. No default. NetAirtSiteAS www.global.com 212.77.100.101 130.37.129.100 194.153.110.129 NetAirtSiteAS www.global.com 212.251.81.22 193.144.152.138 61.120.4.36 NetAirtSiteAS www.global.com 129.78.64.24 18.181.0.31 146.164.2.70 137.215.97.20 AS-based site definition. The response of the DNS redirector depends on the distance between the querying client and each of the site replicas. The DNS redirector returns a maximum of IP addresses of replicas, ordered according to the distance from the client, starting from the closest one. Using AS-based sites requires a BGP data file, which can be downloaded from the site of the RouteViews project (www.routeviews.org). Based on this file, NetAirt creates a map of the Internet, and then uses it to calculate the distance between clients and replicas. In general, only the most recent BGP data file needs to be downloaded from the RouteViews site. Its usual name is 'oix-full-snapshot-latest.dat'. If the BGP data file is unavailable or corrupted, this directive is equivalent to ``NetAirtSite.'' No default. NetAirtBGPDataFile /etc/oix-full-snapshot-latest.dat Full path to the UNCOMPRESSED BGP data file (see www.routeviews.org). Default is /dev/null. NetAirtBGPReloadAfter 86400 Time in seconds, after which NetAirt re-reads the BGP data file. This file should be replaced with a newer version in the mean time. Note that NetAirt does not retrieve the file from the RouteViews site, you have to do it yourself. wget+cron can be useful here. Default is 86400 (1 day). NetAirtBGPSlotSize 3145728 Size (in bytes) of a shared memory chunk, used to store the BGP data. Note that NetAirt allocates _two_ such chunks. Default is 3mb. HTTP redirection: ================= The HTTP redirector uses hostnames as they are found in the configuration file. It always redirects clients to the host whose address would be returned as the first one by the DNS redirector. For example, assume the directive: NetAirtSiteAS www.my-cdn.com www.europe.my-cdn.com www.asia.my-cdn.com where www.europe.my-cdn.com has address 10.0.0.1 and www.asia.my-cdn.com has address 10.0.0.2. This directive redirect each client to one of two replicas, depending on the client location. The DNS redirector will redirect an European client to 10.0.0.1, whereas the HTTP redirector -- to www.europe.my-cdn.com. When redirected by the HTTP redirector, each client will see ``http://www.xxxxx.my-cdn.com/'' in his browser, where xxxxx depends on the replica which that client finally reached. On the other hand, the DNS redirector will also scatter the clients across the same two replicas, but all clients will see the same ``http://www.my-cdn.com/'' in their browsers. The DNS redirector establishes the addresses of the two replicas during server startup. TTL values: =========== In seconds. Make sense only for DNS redirection. Define for how long a redirecting DNS response may remain cached on other DNS servers. Warning: TTLs below 600 may reduce the redirection efficiency. NetAirtTTL 86400 A TTL value for all DNS responses regarding static sites. Default is 86400 (1 day). NetAirtTTL_RR 300 A TTL value for all DNS responses regarding round-robin sites. Default is 1800 (30 minutes). NetAirtTTL_AS 30 Default TTL value for all DNS responses regarding AS-based sites. Default is 600 (10 minutes). NetAirtNS_TTL 3600 A TTL value for DNS responses that redirect clients to the 2nd-level DNS servers. Default is 3600 (1 hour).