Cover | Table of Contents | Index | Colophon
Symbols/Numbers # for comments, 16 - (hyphen), to set options, 65 + (plus sign), to set options, 65 -1 flag (kill command), 45 -16 flag (kill command), 45 A access anonymous, 85-88 checking, 188-192 to configuration and request information, 156 controlling, 81, 149 access.conf file, 20, 29 AccessFileName directive, 48 ACTION attribute (HTML), 58 Action directive, 68 actions, 68 AddDescription directive, 100 AddHandler directive, 67, 93 AddIcon directive, 100 AddIconByEncoding directive, 102 AddIconByType directive, 101 addresses email, for automatic replies, 35 IP (see IP addresses) loopback, 23 web, 10 AddType directive, 93 adduser command, 22, 80 aliases alias command, 28 Alias directive, 108 ServerAlias directive, 35 All option, 64 allow from directive, 81 AllowOverride directive, 49-52 anonymous access, 85-88 Anonymous directives, 86-89 key exchange, 242 Apache API for, 152-174 compiling, 12 directives (see directives) history of, x loading, 15-19 multiple copies of, 39-41 technical support, 233 versions of, ix, 13 API, Apache, 152-174 append_arrays function, 159 array_cat function, 158 arrays, 158 asymmetric key encryption, 212 authentication, 3, 75-77 digest, 82-85 directives for, 71-73, 77-82 modules for, 149 passwords, 73-75 SSL protocol an, 241-244 AuthGroupFile directive, 72 AuthName directory, 72 AuthType directive, 71, 83 AuthUserFile directive, 72 B BADMMAP rule, 18 base URL, rewriting, 112 bastion hosts, 215-218 binary signatures, 209-214 BindAddress directive, 40 block_alarms function, 173 block directives, 38 blocking access, 149 BrowserMatch directive, 62 BrowserMatchNoCase directive, 62 browsers, 62 cookies and, 78 HTTP/1.1 and, 95 icons and, 100 images and, 91 languages and, 92 bugs, 4 keep-alives and Netscape, 37 -X flag (httpd), 21 bytes_in_free_blocks function, 164 bytes_in_pool function, 164 C -c flag (htpasswd), 74 CA (certificate authority), 213-214 CacheDefaultExpire directive, 125 CacheDir... directives, 125 CacheGcInterval directive, 125 CacheLastModifiedFactor directive, 125 CacheMaxExpire directive, 125 CacheRoot directive, 124 CacheSize directive, 125 caching, 124-128 call_exec function, 163 can_exec function, 169 "cannot determine local hostname", 23 carriage returns and line feeds (CRLF), 11 CD-ROM with this book, xi cern_meta_module, 17 certificates, 213-214 cfg_getline function, 167 CGI (Common Gateway Interface), 4, 53-55 directives for, 55 environment variables with, 61 scripts as server-side includes, 130, 133 cgi-script handler, 67 cgi-bin directory, 4 chdir_file function, 166 child servers, limits on, 44 chmod command, 26 cipher suites, 231 classes of networks, 6 cleanup_for_exec function, 161 cleanups, 160 clear_pool function, 157 clients, 10-11 cmd command, 131 cmd_how structure, 182 command table, 182-185 command_rec structure, 182 comments in Configuration file, 16 compiling Apache, 12 compress utility, 14 compression software, 13-15 conf directory, 4, 36 config command, 130 config file httpd.conf, 20, 22 inetd utility, 12 server, 20 configuration files, Apache, 15 configuring Apache, 17 modules, 153, 178-180 proxy servers, 126-128 construct_server function, 168 construct_url function, 168 content negotiation, 90-97 Content-encoding header, 95 Content-language header, 95 Content-length header, 95 Content-type header, 54, 95 cookies, 78 CookieTracking directive, 78 copy_array function, 158 copy_array_hdr function, 158 copy_table function, 159 "couldn't determine user name", 22 count_dirs function, 166 counters, 149 CRLF (carriage returns and line feeds), 11 cryptography (see encryption) D -d flag (httpd), 20, 25, 36 db_auth_module, 17 DBM files, 111 dbm_auth_module, 17 dbmmanage utility, 79 debugging, -X flag for (httpd), 21 decryption (see encryption) deleting pools, 156 demonstration web sites, xi deny from directive, 81 destroy_pool function, 156 destroy_sub_req function, 172 Diffie-Hellman key exchange, 243 digest authentication, 82-85 digital signatures, 209-214 directives, xiii, 35-43, 44, 48-52 anonymous access, 86-89 Apache-SSL, 229-232 authentication, 71-73, 77-82 browsers, 62 caching, 125 for CGI scripts, 55 for environment variables, 61 expiration, 96 handlers, 67 for HTTP headers, 64-67 indexing, 99 limiting application of, 72 logging, 143-145 overriding, 49-52 proxy, 122-124 rewriting, 110-114 (see also under specific directive name) directories execute permission for, 25 iconifying, 100 per-directory module configuration, 154, 179 web site, 4 Directory directive, 38 DirectoryIndex directive, 93, 104-106 dld_module, 17 DMB files, 79-81 DNS, reverse lookup, 37 document root directory, 23 documentation AddDescription directive for, 100 ReadmeName directive for, 102 technical support, 233 E echo command, 130, 134 echo.c program, 59-61 echo2.c program, 235-238 email address for automatic replies, 35 encoding, 95, 102 encryption, 210-212 digest authentication, 82-85 national security and, 220 encryption (see authentication) env utility, 58 environment variables, 61, 130, 134 browsers and, 62 error messages, 3 errors HTTP codes for, 146 image maps, 117 passwords and Anonymous directives, 88 ServerAdmin directive, 35, 42 escape_html function, 168 escape_path_segment function, 168 escape_shell_cmd function, 167 escape_uri function, 168 /etc/hosts file, 28 /etc/inetd.conf file, 12, 46 exec command, 130, 133 ExecCGI option, 64-66 execute permission (see permissions) expirations, 96, 125 default time, 97 ExpiresActive directive, 96 ExpiresByType directive, 96 ExpiresDefault directive, 97 extensions, filename, 67, 93-95 external users, 206-208 F -f flag (httpd), 25, 36 FancyIndexing directive, 99, 103 files DBM files, 79-81 on enclosed CD-ROM, xii filename extensions, 67, 93-95 filename functions, 165 including in other, 131, 133 indexing, 98-106 limits on, 43 permissions, 25-27 size, 131, 132 *.var (see type maps) Files directive, 39 filters Action directive for, 68 packet filtering, 215 find_token function, 167 firewalls, 214-218 fixed-length buffers, 204 flastmod command, 131, 132 FollowSymLinks option, 64, 67 FollowSymLinksIfOwnerMatch option, 67 format of log files, 144-147 formatted menus, 120 forms, 58 authentication with, 75-77 echo.c program, 59-61 Fortezza encryption keys, 243 FQDNs (fully qualified domain names), 28 FreeBSD UNIX, 13 freeware, 5 fsize command, 131, 132 functions, 156-174 G get_client_block function, 171 get_gmtoff function, 164 get_local_host function, 170 get_time function, 164 get_token function, 167 get_virthost_addr function, 169 getparents function, 165 getword function, 166 getword_conf function, 167 getword_nulls function, 166 getword_white function, 166 gm_timestr_822 function, 164 gname2id function, 169 groups creating, 22 permissions (see permissions) gzip utility, 13-15 H -h flag (httpd), 25 handlers, 67, 176, 195 handshake protocol, 241-245 hard_timeout function, 173 Header directive, 64 HeaderName directive, 102 headers CGI, 54 HTTP response, 64-67 help, 233 history of Apache, x Host header, 35 HostNameLookups directive, 37 hostnames, 10 "cannot determine local hostname", 23 controlling access from, 81 mapping several to one address, 35 reverse-DNS lookup, 37 hosts, 2 /etc/hosts file, 28 host numbers, 6 nonrouting (bastion), 215-218 virtual (see virtual hosts) \windows\hosts file, 28 ht_time function, 164 .htaccess file, 47-52, 106 htdigest utility, 84 htdocs directory, 4 HTML (Hypertext Markup Language), 33 forms, 58 image maps, 118-121 htpasswd utility, 73 HTTP (Hypertext Transfer Protocol), 2 methods, 2, 72 response headers, 64-67 status codes, 146, 176-178 version 1.1 and browsers, 95 HTTP_ACCEPT variable, 91 HTTP_ACCEPT_LANGUAGE variable, 92 httpd, 4, 19 flags, 25 restarting, 45 virtual, number of, 43 httpd.conf file, 20, 22 hyphen (-), to set options, 65 I icons, 100-102 IconsAreLinks option, 103 IDEA (International Data Encryption Algorithm), 212 identd daemon, 77 IdentityCheck directive, 77 ifconfig utility, 9 IfModule directive, 17 ignoring files in index, 99 image maps, 116-121 image negotiation, 91 imap-file handler, 67 ImapBase directive, 116 ImapDefault directive, 117 ImapMenu directive, 120 include command, 131, 133 includes (see server-side includes) IncludesNoExec option, 65 index.html file, 34 Indexes option, 65 IndexIgnore directive, 99 indexing, 98-106 icons with, 100-102 image maps, 116-121 IndexOptions directive, 103 inetd mode (ServerType), 46 inetd utility, 12, 46 inetd.conf file, 12 initializer, 185 installing Apache, 15-19 interfaces, 8 internal users, 206-208 internal_redirect function, 172 internal_redirect_handler function, 172 International Data Encryption Algorithm (IDEA), 212 internationalization, modules for, 150 IP addresses, 6, 8 binding to specific, 40 controlling access from, 81 loopback, 23 mapping several hostnames to, 35 restricting attention to, 40 IRIXNIS rule, 18 is_directory function, 169 is_matchexp function, 165 is_url function, 169 ISMAP attribute, 118 K KeepAlive directive, 37, 63 keepalive_timeout function, 173 KeepAliveTimeout directive, 37 key escrow system, 221 key exchange, 241-244 keys, encryption (see encryption) kill command, 24, 36 -1 and -16 flags, 45 kill_cleanup function, 161 kill_cleanups_for_fd function, 161 kill_timeout function, 173 L language negotiation, 91 languages, modules for, 150 legal issues, 218-221 level numbers, 94 license, Apache, x Limit directive, 72 Listen directive, 40 ln command, 33, 66 loading Apache, 15-19 local networks, 27 Location directive, 39 Location header, 54 LogFormat directive, 144-147 logging, 143-147 cache documents (see caching) CGI script information, 55 logs directory, 4, 36 module for, 196 RewriteLog, RewriteLogLevel directives, 110 TransferLog directive, 42 loopback addresses, 23 M MAC (Message Authentication Code), 244-246 Mail Exchange (MX) records, 217 make_array function, 158 make_dirstr function, 166 make_full_path function, 169 make_sub_pool function, 156 make_table function, 159 Makefile file, 15 making Apache, 15-19 MaxClients directive, 44 MaxRequestsPerChild directive, 44 MaxSpareServers, 44 MD5 function, 83 memory for pools, 157 menus, 120 merger modules, 180-182 messages, error (see error messages) <METHOD> tag (HTML), 58 methods, HTTP, 2, 72 MIME types, 95, 192-194 icons by, 101 MinSpareServers directive, 44 modification time/date cache, 125 expirations and, 96 flastmod command for, 131, 132 indexing, 103 modules, 5, 16, 148, 175 authentication, 149 for blocking access, 149 configuring, 153 counter, 149 example of, 197-204 mod_access, 188 mod_alias, 107 mod_auth_anon, 85 mod_cgi, 107 mod_expires, 96 mod_include, 129-135 mod_rewrite, 109 mod_simultaneous, 150 mod_speling, 150 mod_status, 136-147 for rewriting URLs, 109, 150 structure of, 178-197 (see also under specific module name) msql_auth_module, 17 multiple copies of Apache, 39-41 multitasking, 2 multithreading, 204 multiviews, 90-92 MultiViews option, 65 mutual-failure option, 81 MX records, 217 N names FQDNs, 28 hostnames (see hostnames) national security, 220 NCSA server, 239 negotiation, content, 90-97 netmask command, 28 Netscape, 30 cookies, 78 echo.c program, 59-61 keep-alive bug, 37 languages and, 92 networks classes of, 6 local, 27 network numbers, 6, 28 physically separate, 215-218 no2slash function, 165 NoCache directive, 126 nokeepalive variable, 63 nonce, 83 nonrouting hosts, 215-218 note_cleanups_for_fd function, 161 note_cleanups_for_file function, 162 note_subprocess function, 162 numbers host, 6 network, 6, 28 port, 8 O obtaining Apache, 15 FreeBSD UNIX, 13 gzip utility, 13-15 operating system, 18 Options directive, 64 order directive, 81 os_escape_path function, 168 overlay_tables function, 160 overriding directives, 49-52 P packet filtering, 215 palloc function, 157 parseHTTPdate function, 174 PassEnv directive, 62 passwords, 73-75 Anonymous directives and, 88 DBM files for, 79-81 patents, 218 pathnames, xiii, 10, 169 paths, 35 pcalloc function, 157 pclosef function, 162 performance caching, 124-128 modules to improve, 150 PK encryption, 212 permissions, 25-27 per-server configuration, 153 persistent-state cookies, 78 pfclose function, 162 pfdopen function, 162 pfopen function, 162 PidFile directive, 36 PIDs (process identifiers), 21, 36 ping command, 28 PK encryption, 210-212 plus sign (+), to set options, 65 pools, 152, 156 popenf function, 161 Port directive, 40 ports, 2, 8, 40 pregcomp function, 162 pregsub function, 165 privacy (see encryption; security) process identifiers (see PIDs) processes, killing, 24 protocols, 8 proxy servers, 3, 122-128 ProxyPass directive, 123 ProxyRemote directive, 123 ProxyRequests directive, 123 ps utility, 21 pstrcat function, 157 pstrdup function, 157 pstrndup function, 157 public key encryption, 210-212 push_array function, 158 Q quality scores (qs values), 94 R read permission (see permissions) ReadmeName directive, 102 realms, authentication, 72 Redirect directive, 109 redirection, 107-116, 172 register_cleanup function, 160 regular expressions for URLs, 109-116 remote proxies, 123 requests maximum wait time, 37 per-request module configuration, 154 redirecting, 107-116 simultaneous, maximum for, 44 status information, 137 require directive, 73 reset_timeout function, 173 response codes, HTTP, 146, 176-178 response headers, 64-67 restarting httpd, 45 resuming sessions, 244 reverse-DNS lookups, 37 Rewrite module, 109-116 RewriteBase directive, 112 RewriteCond directive, 112 RewriteEngine directive, 110 RewriteLog directive, 110 RewriteLogLevel directive, 111 RewriteMap directive, 111 RewriteRule directive, 113 rewriting, modules for, 109, 150 root directory, 23 root user, 9, 22 routers, 7 rputc function, 170 rputs function, 170 RSA algorithm, 219, 242 run_cleanup function, 170 run_sub_req function, 172 rvprintf function, 171 rvputs function, 171 S ScanHTMLTitles option, 103 ScriptAlias command, 107 ScriptAlias directive, 55 ScriptLog directive, 55 ScriptLogBuffer directive, 55 ScriptLogLength directive, 55 scripts, CGI (see CGI) security, 3, 205-218 allow/deny from directives, 81 authentication (see authentication) blocking access, 149 certificates, 213-214 cipher suites, 231 encryption, 210-212 file permissions, 25-27 firewalls, 214-218 fixed-length buffers, 204 handshake protocol and, 244 IgnoreIndex directive and, 99 legal issues, 218-221 national, 220 passwords, 73-75, 88 proxy servers, 122-128 SSL, 222-232 suEXEC program, 63 semiformatted menus, 120 send-as-is handler, 67 send_fd function, 170 send_fd_length function, 170 send_http_header function, 174 server-info handler, 67 server-parsed handler, 67 server-status handler, 67 ServerAdmin directive, 35, 42 ServerAlias directive, 35 ServerName directive, 35 ServerPath directive, 35 ServerRoot directive, 36 servers, 12 child, setting limits on, 44 config file, 20 getting information about, 136-143 maximum wait for requests, 37 per-server configuration, 153 per-server module configuration, 178 proxy, 3, 122-128 server-side includes, 129-135 IncludesNoExec option, 65 scripting modules, 150 ServerType directive, 46 sessions, resuming, 244 SetEnv directive, 61 SetHandler directive, 68 setup_client_block function, 171 shapes of image map hotspots, 119 should_client_block function, 171 Simple Mail Transfer Protocol (SMTP), 217 simultaneous requests, 44 size cache, 125 files, 131, 132 pool, 164 SMTP (Simple Mail Transfer Protocol), 217 SOCKS rules, 17 soft_timeout function, 173 spawn_child function, 163 spawn_child_err function, 163 spelling module, 150 srm.conf file, 20, 29, 93 SSI (see server-side includes) SSL protocol specification, 222-229, 241-246 directives for, 229-232 standalone mode, 12 standalone mode (ServerType), 46 StartServers directive, 45 status codes, HTTP, 146, 176-178 STATUS rule, 18 status, server, 136-143 strcasecmp_match function, 165 strcmp_match function, 165 strings functions for, 165 in pools, 157 sub_req_lookup_file function, 172 sub_req_lookup_uri function, 172 subnet masks, 7 suEXEC program, 63 superuser, 9, 22 SuppressDescription option, 103 SuppressLastModified option, 103 SuppressSize option, 103 symbolic links, 33, 66 SymLinksIfOwnerMatch option, 65 T tables command table, 182-185 table _ functions for, 159-160 TCP (Transmission Control Protocol), 7 TCP/IP, 5-9 technical support, 233 telnet, 11 time caching-related, 125 expirations, 96 functions for, 164 TimeOut directive, 37 timeouts, functions for, 173 tm2sec function, 174 token encryption key (TEK), 243 TransferLog directive, 42, 143 translating URLs to names, 186 type checker, 192-194 type-map handler, 67 type maps, 93-95 U UDP (User Datagram Protocol), 7 uname2id function, 169 unblock_alarms function, 174 unescape_url function, 168 unformatted menus, 121 UNIX versions, 13 URIs (uniform resource identifiers), 1 URLs (uniform resource locators), 1, 10 digest authentication and, 82-85 functions for, 168 image maps and, 116 limiting Apache directives to, 39 rewriting, 109-116 translating to names, 186 user agents, 82 User-Agent header, 82 users checking if access allowed, 190-192 "couldn't determine user name", 22 creating, 22 DBM files, 79-81 identifying, 77 permissions (see permissions) security and, 206-208 validating, 209 uudecode function, 170 V -v flag (httpd), 25 validating users, 209 *.var files (see type maps) variables environment, 61 printing values of, 130, 134 version rollback attacks, 244 versions Apache, ix, 13 SOCKS, 17 UNIX, 13 virtual cash, 209-214 virtual hosts, 7, 30, 41-45 HTTP/1.1 and, 46 VirtualHost directive, 38 W WANTHSREGEX rule, 17 web addresses (see URLs) web sites, 4 demonstration, xi Windows 95, 28 \windows\hosts file, 28 write permissions (see permissions) X -X flag (httpd), 21, 25, 43 XBitHack facility, 134 XSSI facility, 134
Return to Apache: The Definitive Guide