Вы находитесь на странице: 1из 330

Web$


Web Apache

,


: Unix,
Linux, Windows
MacGSX


'


WEB APACHE

""
, ,
2001

32.973.26 018.2.75
68
681.3.07
""
. ..
..
"c"
: info@williamspublishing.com, http://www.wiiliamspublishing.com

, .
68

Web Apache
. : . .
. :
"", 2001. 336 . : . . . .
ISBN 5 8459 0212 6 (.)

Web Apache.
,
. ,
,
, Web
. IP , TCP/IP

. , Web

.

32.973.26 018.2.75

.
,
, ,
Prentice Hall, PTR.
Authorized translation from the English language edition published by Prentice Hall, PTR,
Copyright 2001
All rights reserved. No part of this book may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopying, recording or by any information storage re
trieval system, without permission from the Publisher.
Russian language edition published by Williams Publishing House according to the Agreement
with R&I Enterprises International, Copyright 2001
ISBN 5 8459 0212 6 (.)
ISBN 0 13 089873 2 (.)

"", 2001
Prentice Hall PTR, 2001

I.
1.

19

25
26

2. WEB APACHE

34

3. WEB APACHE
4. ,

45
61

II. WEB

71

5. WEB

72

5. PROXY

82

7.

90

8.

99

9. WEB

117

10.

127

11.

132

12.

142

III.

151

13.

152

14.

156

15.

166

IV.

183

184

203

. TCP/IP

247

. IP

254

. ,

256

. UNIX
. WINDOWS NT

262
266

3. HTTP
.

268
273

. MOD_PERL API

276

280

319

19

I.

25

1.

26

1.1.
26
1.2.
26
1.3.
27
1.4.
27
1.4.1. <Directory> <DirectoryMatch>
28
1.4.2. .htaccess
29
1.4.3. URL: <Location> <LocationMatch>
30
1.4.4.
30
1.4.5. <Files> <FilesMatch> 30
1.5.
31
1.6.
32
1.7.
32
1.8. MIME
33

2. WEB$ APACHE

34

2.1.
2.2.

34
34

2.2.1.

34

2.2.2.
2.3.
2.3.1. Unix
2.3.2. Unix
2.3.3. Unix
2.3.4. Windows
2.3.5. Mac OS X
2.4. Web Apache
2.4.1. Unix
2.4.2. Windows
2.5. Apache
2.5.1. : make
2.5.2. APACI
2.6. Web Apache

35
36
36
36
37
38
38
38
39
39
39
39
40
43

2.6.1. Unix

43

2.6.2. Windows .

43

2.6.3. Mac OS X

44

2.7.

3. WEB$ APACHE
3.1.
3.2.
3.2.1.
3.3. httpd.conf

3.3.1. ServerType
3.3.2. TCP : Port
2.3.3. ClearModuleList
3.3.4. AddModule

44

45
45
46
46

46
47
48
48

3.3.5. : HostnameLookups
3.3.6. Unix: User Group
3.3.7. : BrowserMatch
3.3.8. : ServerAdmin
3.3.9. : ServerRoot
3.3.10. IP : BindAddress

3.3.11. : ErrorLog
3.3.12. : TransferLog
3.3.13. : PidFile
3.3.14. : ScoreBoardFile
3.3.15. : ServerName
3.3.16. CacheNegotiatedDocs
3.3.17. : Timeout
3.3.18. : KeepAlive
3.3.19. MaxKeepAliveRequests .
3.3.20. KeepAliveTimeout
3.3.21. : MinSpareServers
3.3.22. : MaxSpareServers
3.3.23. : StartServers
3.3.24. : MaxClients
3.3.25. : MaxRequestsPerChild
3.3.26. : <Directory>
3.3.27. Location
3.3.28. Options
3.3.29. AllowOverride
3.3.30. order
3.3.31. allow
3.3.32. deny
3.3.33. HTML: DocumentRoot
3.3.34. : UserDir
3.3.35. / : Directorylndex
3.3.36. Fancylndexing
3.3.37. Addlcon, AddlconByType, AddlconByEncoding
3.3.38. Defaultlcon

48
48
48
49
49
49

50
50
50
50
51
51
51
51
51
52
52
52
52
52
52
53
53
53
54
54
55
55
55
55
55
56
56
56

3.3.39. AddDescription

56

3.3.40. ReadmeName
3.3.41. HeaderName
3.3.42. Indexlgnore
3.3.43. AccessFileName
3.3.44. DefaultType
3.3.45. AddLanguage
3.3.46. LanguagePriority
3.3.47. Alias
3.3.48. ScriptAlias
3.3.49. AddType

56
56
56
56
57
57
57
57
57
57

3.3.50. AddHandler
3.4. Windows
3.4.1. Unix
3.4.2. MaxRequestsPerChild
3.4.3. ThreadsPerChild

3.5 Mac OS X
3.5.1.
3.5.2.

57
58
58
59
59

59
59
60

4. ,

61

4.1.
4.1.1. Win32
4.2. Apache

61
61
62

4.2.1. inetd

63

4.2.2. Windows
4.2.3. Mac OS X
4.3.
4.4. Apache

63
64
65
66

4.4.1.

67

4.4.2.
4.4.3. Windows
4.4.4. Mac OS X
4.5. Apache

67
68
68
68

4.5.1.

69

4.5.2. Windows
4.5.3. Mac OS X
4.6.

II. WEB$
5. WEB$
5.1.
5.2.
5.2.1. UserDir some_directory
5.2.2. UserDir /an/absolute/path
5.2.3. UserDir /an/absolute/*/with/wildcard
5.3. IP

69
69
69

71
72
72
73
73
74
74
74

5.3.1. IP : BindAddress address


5.3.2. IP : Port portnum
5.3.3. IP : Listen
5.3.4. IP
5.4.
5.4.1.
5.5. Apache
5.5.1. IP : NameVirtualHost
5.5.2. : VirtualHost
5.5.3.
5.5.4. IP ?
5.6. IP
5.6.1. , IP
5.7.

5. PROXY$
6.1.
6.2. ?
6.2.1.
6.3. proxy
6.3.1. Web
6.3.2. proxy
6.3.3.

75
75
75
75
76
76
78
78
79
79
80
80

82
82
83
84
84
84
85
85

6.3.4.
6.3.5.
6.3.6.
6.4.
6.4,1. : CacheRoot

85
85
85
86
86

6.4.2. : CacheSize
6.4.3. : CacheDirLevels
6.4.4. : CacheDirLength
6.4.5.
6.4.6. : CacheGclnterval
6.4.7. : NoCache
6.5. proxy

86
86
86
86
87
87
87

6.5.1. Netscape Communicator


6.5.2. Internet Explorer

88

7.

90

7.1.
7.1.1.

90

90

7.1.2.

90

7.2.
7.3.
7.3.1.
7.3.2. : TransferLog
7.3.3.
7.3.4.
7.4. mod_status

91
92
92
92
93
94
94

7.4.1. Apache mod_status


7.4.2. :
IP
7.4.3. :
7.4.4.
7.4.5.
7.5. mod_info
7.5.1.

8.

94
96
96
96
96
97

98

99

8.1.
8.2.

8.2.1.

99
99

8.2.2.

8.2.3.

8.2.4.
8.2.5.
8.2.6. CGI

100
100
100
100
100
101

8.2.7.
8.2.8.
8.2.9.

101
101
101

8.2.10.
8.2.11.
8.3.
8.3.1. : mod_access
8.3.2. order

102
102
102
102
102

8.3.3. allow
8.3.4. allow from env
8.3.5. deny
8.3.6. deny from env
8.4.
8.4.1. : AuthName
8.4.2. ; require
8.4.3. : AuthType

102
104
104
104
104
104
104
105

8.4.4. mod_auth
8.4.5. htpasswd
8.4.6. : AuthUserFile
8.4.7. : AuthGroupFile
8.4.8. :
AuthAuthoritative
8.4.9. : mod_auth
8.4.10. mod_auth_dbm
8.4.11. : dbmmanage
8.4.12. DBM:

105
105
106
106
106
106
107
108

AuthDBMUserFile
8.4.13. Auth_Dbm_Authoritative
8.4.14. AuthDbmGroupFile
8.4.15. mod_auth_db
8.4.16. mod_auth_anon
8.4.17. : Anonymous
8.4.18. : Anonymous_LogEmail
8.4.19. :
Anonymous_MustGiveEmail
8.4.20. :
Anonymous_VerifyEmail
8.4.21. Anonymous_NoUserlD
8.4.22. Anonymous_Authoritative
8.5. SSL
8.5.1.
8.5.2. SSL
8.5.3. mod_ssl
8.5.4.
8.5.5. SSL
8.5.6. SSL: SSLEngine

108
108
109
109
109
109
109
110
110
110
110
110
111
112
112
113
114
114

8.5.7. : SSLCertificateFile
8.5.8. : SSLCertificateKeyFile
8.5.9. SSLCACertificatePath

114
114
114

8.5.10. SSLCACertificateFile
8.5.11. : SSLLog
8.5.12. SSL: SSLLogLevel
8.5.13. SSLVerifyClient
8.5.14. SSLVerifyDepth

9. WEB$

114
115
115
115
116

117

9.1.
117
9.2. (SSI)
117
9.2.1. SSI
118
9.2.2. SSI
118
9.2.3. SSI
118
9.2.4. SSI : AddHandler 119
9.2.5. SSI : AddType
119
9.2.6. SSI: XBitCrack
119
9.3.
119

9.3.1. SSI: config


9.3.2. : echo
9.3.3. : exec
9.3.4. : fsize
9.3.5. : flastmod
9.3.6. : if elif
9.3.7. : include
9.3.8. : printenv

10

119
120
120
120
120
120
120
121

9.3.9. : set

121

9.4. CGI
9.4.1. CGI

121
121

9.4.2. Apache

122

9.4.3. CGI: Options +ExecCGI

122

9.4.4. : ScriptAlias
9.4.5. : SetHandler

122
123

9.4.6. : AddHandler
9.4.7. MIME : AddType
9.4.8. CGI: ScriptLog
9.5.
9.5.1. mod_perl
9.6. FastCGI
9.6.1. FastCGI
9.6.2. : FastCgilpcDir

10.
10.1.
10.1.1. vmstat
10.1.2. httpd
10.1.3.
10.1.4. .htaccess
10.1.5. DNS
10.1.6.

10.1.7.
10.1.8.
10.1.9. KeepAlives
10.1.10. CGI
10.1.11. : mod_mmap_static
10.2. Windows

11.

123
123
123
124

124
125

125
.

126

127
127
127
128
129
129
129

130
130
130
130
130
130

132

11.1.
11.2. mod_rewrite
11.2.1. modjewrite: RewriteEngine

11.2.2. URL : RewriteRule


11.2.3. : RewriteCond
11.3. modjewrite
11.3.1. : RewriteMap
11.3.2. : RewriteLog, RewriteLoglevel
11.3.3. : RewriteOptions

11.3.4. : RewriteBase

12.
12.1.
12.1.1. mod_perl
12.2. mod_perl
12.2.1. mod_perl
12.3. Apache API
12.4.
12.4.1. Perl
12.4.2.
12.4.3.
12.4.4.
12.5. Perl API

12.6.
12.7.

132
132

133
133
134
138

138
140
141

141

142
142

142
143
145
146
146

146
147
147
148
148

149
150

11

III.
13.
13.1.
13.2.
13.2.1.
13.3.
13.4. ,

151
152
152
152

152
153
153

13.4.1. e Cash
13.4.2. CyberCash
13.5. SET

14.
14.1.
14.2.
14.2.1. MySQL

153
154
154

156
156
156

157
157

14.2.2. Oracle
14.2.3. Informix
14.3. ,
14.3.1. CGI mod.perl Perl DBI
14.3.2. PerlDBI
14.3.3.
14.3.4. ColdFusion
14.4 PHP

157
158
158
158
158
160
162

14.4.1.
14.4.2.
14.4.3.
14.4.4.

15.
15.1.
15.2.

15.2.1.
15.2.2.
15.3.
15.3.1.
15.3.2. 1:
15.3.3.
15.3.4. 2:
15.3.5.
15.4.

163
163
164
165

166
166
167

167
167
168
168
168
169
169
172
172

15.4.1. index.php
15.4.2. catalog.php
15.4.3. result.php
15.4.4. item.php
15.4.5. cart.php
15.4.6. checkout.php
15.4.7. mk_order.php

173
174
175
176
177
178
180

IV.

183

184

.1.
.2.

.2.1. AccessConfig
.2.2. AccessFileName

.2.3. AddModule

12

184
184

184
185

185

.2.4. AllowOverride
.2.5. AuthName
.2.6. AuthType
.2.7. BindAddress
.2.8. ClearModuleList
.2.9. DefaultType
.2.10. <Directory>
.2.11. DocumentRoot
.2.12. ErrorDocument
.2.13. ErrorLog
.2.14. <Files>
.2.15. Group
.2.16. HostNameLookups
.2.17. IdentityCheck
.2.18. <lfModule>
.2.19. KeepAlive
.2.20. KeepAliveTimeout
.2.21. Listen
.2.22. <Limit>
.2.23. <Location>
.2.24. LockFile
.2.25. MaxClients

.2.26. MaxKeepAliveRequests
.2.27. MaxRequestsPerChild
.2.28. MaxSpareServers
.2.29. MinSpareServers
.2.30. Options
.2.31. PidFile
.2.32. Port
.2.33. require
.2.34. ResourceConfig
.2.35. RLimitCPU
.2.36. RLimitMEM
.2.37. RLimitNPROC
.2.38. Satisfy
.2.39. ScoreBoardFile
.2.40. SendBufferSize
.2.41. ServerAdmin
.2.42. ServerAlias
.2.43. ServerName
.2.44. ServerPath
.2.45. ServerRoot

.2.46. ServerType
.2.47. StartServers
.2.48. TimeOut
.2.49. User
.2.50. VirtualHost

.
.1. mod_access
.1.1. allow
.1.2. allow from env
. 1.3, deny
.1.4. deny from env
. 1.5. order
.2. mod_actions

185
186
186
187
187
187
188
189
189
190
190
190
191
191
191
192
192
192
193
193
193
194
194
194
195
195
196
196
197
197
197
198
198
198
199
199
199
199
200
200
200
201
201
201
202
202

203
204
204
204
205
205
206
206

13

.2.1. Action

206

.2.2. Script
.. mod_alias
.3.1. Alias
.3.2. Redirect
.3.3. RedirectTemp
.3.4. RedirectPermanent
.3.5. ScriptAlias
.4. mod_auth

207
207

207
208
208
209
209
209

.4.1. AuthGroupFile

210

.4.2. AuthUserFile

210

5.4.3. AuthAuthoritative

210

.5. mod_auth_anon

211

.5.1. Anonymous

211

.5.2. Anonymous_Authoritative
.5.3. Anonymous_LogEmail
.5.4. Anonymous_MustGiveEmail

211
212
212

.5.5. Anonymous_NoUserlD

212

.5.6. Anonymous_VerifyEmail
.6. mod_auth_db

213
213

.6.1. AuthDBGroupFile

213

.6.2. AuthDBUserFile
.6.3. AuthDBAuthoritative
.7. mod_auth_dbm

214
214
.214

.7.1. AuthDbmGroupFile

215

.7.2. AuthDBMUserFile
.7.3. AuthDBMAuthoritative
.8. mod_browser
.8.1. BrowserMatch

215
215
216

216

.8.2. BrowserMatchNoCase

216

.9. mod_cern_meta

217
217

.9.2. MetaSuffix
.10. mod_cgi

217
217

.9.1. MetaDir

.10.1. ScriptLog

217

.10.2. ScriptLogLength

218

.10.3. ScriptLogBuffer

218

5.11. mod_digest

218

.11.1. AuthDigestFile

219

.12. mod_dir

.12.1.
.12.2. AddAltByEncoding
.12.3. AddAltByType
.12.4. AddDescription
.12.5. Addlcon
.12.6, AddlconByEncoding
.12.7. AddlconByType
.12.8. Defaultlcon
.12.9. Directorylndex
.12.10. Fancylndexing
.12.11. HeaderName

.12.12. Indexlgnore
.12.13. IndexOptions
.12.14. ReadmeName
.13. mod_env

14

219

AddAlt

219
219
220
220
220
221
221
221
222
222
222

223
223
224
224

.13.1. PassEnv

224

.13.2. SetEnv

225

.13.3. UnsetEnv

225

.14. mod_expires
.14.1, ExpiresActive

225
225

.14.2. ExpiresByType

226

.14.3. ExpiresDefault
.15. mod_headers

226
226

.15.1. Header
.16. modjmap
.16.1. ImapMenu
.16.2. ImapDefault

226
227
227
228

.16.3. ImapBase
.17. mod include

228

.17.1. XBitHack
.18. mod info
.18.1. AddModulelnfo
.19. modjsapi

229
229
229
229

.20. mod log agent

.20.1.

230

gentLog

230

.21. mod_log_common

230

.22. mod_log_config
.22.1. CookieLog

230
230

.22.2. Custom_Log
.22.3. LogFormat
.22.4. TransferLog
.23. mod_log_referer

.24. mod_mime
.24.1. AddEncoding
.24.2. AddHandler
.24.3. AddLanguage
.24.4. AddType
.24.5. ForceType
.24.6. SetHandler

.24.7. TypesConfig
.25. mod_mime_magic
.25.1. MimeMagicFile

.26. mod_mmap_static
.26.1. MMapFile
.27. mod_negotiation

.27.1. CacheNegotiatedDocs
.27.2. LanguagePriority
.28. mod_proxy

.29. mod_rewrite
.29.1. RewriteEngine
.29.2. RewriteOptions

.29.3. RewriteLog
.29.4. RewriteLogLevel
.29.5. RewriteLock

.29.6. RewriteMap
.29.7. RewriteBase
.29.8. RewriteCond
.29.9. RewriteRule

.30. mod_setenvif
.30.1. BrowserMatch

231
231
232
232

232
232
232
233
233
234
234

234
235

235
235
235
236

236
236
236

236
236
237

237
238
238

238
239
239
241

242
242

15

.30.2. BrowserMatchNoCase

242

.30.3. SetEnvlf
.30.4. SetEnvlfNoCase
.31. mod_so

242
243
243

.31.1. LoadFile

243

.31.2. LoadModule
.32. mod_speling

244
244

.32.1. CheckSpelling

244

.. mod_status

244

.33.1. ExtendedStatus

244

.34. mod_unique_id
.35. mod_userdir

245
245

.35.1. UserDir
.36. mod_usertrack
.36.1. CookieExpires

245
245
245

.36.2. CookieName
.36.3. CookieTracking

246
246

. TCP/IP

247

.1.
8.2. IP
8.3.

247
247
248

8.3.1.

250

8.3.2.
8.3.3.
8.3.4.
8.3.5. IP
8.4. IP

. IP$

250
252
252
252
253

254

.1.
.1.1. /etc/hosts
.1.2. nslookup

. ,
.1.
.2.
.. Unix/Linux
.4. , ""'

254

255
255

256
256
257
257
259

.4.1.
.5.
""
.5.1.
.5.2. ?
.5.3. root

. UNIX

260
260
260
261
261

262

.1.
.2.
..

. WINDOWS NT
.1.

262
263
264

266

266

. 1.1.

3. HTTP
3.1.
3.2.1:

267

268
268
268

3.2.1. 100 Continue

16

268

3.2.2. 101 Switching Protocols


3.3. 2xx:
3.3.1. 200 OK: HTTP_OK
3.3.2. 201 Created: HTTP_CREATED
3.3.3. 202 Accepted: HTTP_ ACCEPTED
3.3.4. 203 Non Authoritative Information: HTTP_NON_AUTHORITATIVE
3.3.5. 204 No Content: HTTP_NO_CONTENT
3.3.6. 205 Reset Content

268
269

269
269
269
269
269
269

3.3.7. 206 Partial Content


3.4. :
3.4.1. 300 Multiple Choices: HTTP_MULTIPLE_CHOICES
3.4.2. 301 Moved Permanently: HTTP_MOVED_PERMANENTLY
3.4.3. 302 Found: HTTP_FOUND
3.4.4. 303 See Other: HTTP_SEE_OTHER

269
269

269
269
269
270

3.4.5. 304 Not Modified: HTTP_NOT_MODIFIED


3.4.6. 305 Use Proxy: HTTP_USE_PROXY
3.4.7. 307 Temporary Redirect: HTTP_TEMPORARY_REDIRECT
3.5. 4xx:
3.5.1. 400 Bad Request
3.5.2. 401 Unauthorized
3.5.3. 402 Payment Required
3.5.4. 403 Forbidden

270
270
270
270

270
270
270
270

3.5.5. 404 Not Found


3.5.6. 405 Method Not Allowed
3.5.7. 406 Not Acceptable
3.5.8. 407 Proxy Authentication Required
3.5.9. 408 Request Time out

270
270
270
271
271

3.5.10. 409 Conflict


3.5.11. 410 Gone
3.5.12. 411 Length Required
3.5.13. 412 Precondition Failed
3.5.14. 413 Request Entity Too Large

271
271
271
271
271

3.5.15. 414 Request URI Too Large


3.6. 5xx:
3.6.1. 500 Internal Server Error
3.6.2. 501 Not Implemented
3.6.3. 502 Bad Gateway

271
271

271
271
271

3.6.4. 503 Service Unavailable


3.6.5. 504 Gateway Time out
3.6.6. 505 HTTP Version not supported

271
272
272

273

.1.

.1.1.

.1.2.
.1.3.
.1.4.

274
274

. MOD_PERL API
. 1.
.1.1.
.1.2.

.1.3.
.1.4.
.1.5.
.1.6 Apache::Log

273
274

275

276
276

276
276

277
277
277
277

17

.1.7.
.1.8. mod_perl

278

278

.1.9. Apache::SubRequest

278

.1.10. Apache::Server
.1.11. Apache::Connection
.1.12. Apache::Table

278
279

.1.13. Apache::URI

279

.1.14. Apache::Util
.
.1. Apache
.2.
.,
.4. GZlib
.5. DBM
.6.
.7. dBase
.8. DBM
.9.
.10.
.11.

.12. FilePro
.13. File System Functions
.14. FDF

.15. FTP
.16.
.17. HTTP

.18. Informix
.19.
.20.
.21. MS SQL
.22.
.23. mSQL
.24. , MySQL
.25.
.26. NIS
.27. ODBC
.28. Oracle
.29. Oracle 8
.30. Perl
.31. POSIX
.32.
.33. Recede
.34. ,
.35. SNMP
.36.
.37. Sybase
.38. URL
.39. ,

18

279
280
281
281
281
283
284
285
286
286
287
287
287

288
288
291

292
293
293

293
295
295
297
298
299
301
303
304
304
307
307
309
309
311
311
313
316
316
317

319

Web
Apache.
, .
,
,
, Web .
IP , TCP/IP
. , Web
.

Apache
Web Apache "
". .
,
Web . 61,5 Web
Apache.
" "
Linux sendmail
"Time"
DOS ,

/dev/null . Apache ,
.
Apache
: ,
. ,
Microsoft, Linux Win
dows 2000, Windows . ,
, Linux:
, , .
.
, , Apache,
. ,
, ,
.
, ,
, ,
, , .
, .


Apache httpd,
(Rob McCool) (National
Center for Supercomputing Applications NCSA). 1995 httpd
Web , 1994

NCSA, .
Web ,

"Apache group".
(BrianB ehlendorf)
. (Roy T. Fielding)
(Rob Hartill)
(David Robinson)
(Cliff Skolnick)
(Randy Terbush)

(Robert S. Thau)
(Andrew Wilson)
(Eric Hagberg),
(Frank Peters) (Nicolas Pioch), "Apache group incorporated"
httpd 1.3,
1995 Apache O.6.2.
"Apache group", ,
.
, Unix
.
Web Apache
.

, Apache ,
.
Web www.apache.org:
" Apache ,
HTTP. ,
,
, . ,
Internet , ,
, ,

. , ""
, ,

. "" ,
. , ,
Internet, "",
. ,
" "

, ,
, ."


Web Apache
.
, ,
. Apache
,
, .
.
.

20

,
. .
, ,
, .

. , , .
, .
,
. , , ,
, ,
. .
, " " .
,
Apache, ,
1
2 , ,
. Web , ,
, , , .
Web Apache, "
",
. , ""
,
, .
, ,
. ,
"" ,
. , " "
.
, ,
, , .


Apache
. ,
. Web
. , Apache,
, , ,
.

( ).
,
. .
Apache .
.
,
. ,
. ,
Apache.

, .
Apache , .
1

21

, ,
. Apache ,
Apache , Web

. ,
.

I, ""
I
Apache. Apache,
.
Apache , , ,
, 1, " ". ,
1 4, , ,
.
*

II, " Web$"


II Apache.
, ,
. ,
.

III, " "


III ,
,
Internet.

IV, ""
, ,
( ),
(
, " Unix").
, .


, ,
, ,
.
. ,
, " ", , '" ". ,
.
Apache
, ,
.
, , .
, .

. , 8,
"", 4, ", ".

22

,
.
,
Unix Linux .
,
Linux ,
Windows NT, Windows 95 Mac OS X.
Unix, ,
Apache,
. .
Unix $APACHE, ,
Web Apache. (
ServerRoot.)


, , Unix
:

.

D
,
, . ,

Apache ,
(, AddModule Port), ,
Web Apache,
( DocumentRoot).
, ,

s_hawkins@mindspring.com.

, ,
. ,
(Tom Post).
, , "Prentice
Hall". , Apache.
Apache,
, . ?

(Miles Williams), ,
, .

23

...
1.
2. Web Apache
3. Web Apache
4. ,

1

...
1.1.

26

1.2.

26

1.3.

27

1.4.

27

1.5.

31

1.6.

32

1.7.

32

1.8. MIME

33

1.1.
,
Web Apache.
, , , ,
, .., , , .
, Web Apache,
. ,
Web Apache,
.

1.2.
Web Apache .
.
, Unix DOS, ,
. , ,
, . ,
Web

Apache, ,
.
, Web , .
httpd.conf

26

, ,
.

I.

srm.conf

access.conf

,
, ,
.
,
, .


.
Web Apache.

httpd.conf.
conf,
Apache. Web Apache,
,
. 3,
" Web Apache"
Web Apache.

1.3.
,
. .
Apache (90 %) ,
1
, , .
,
Apache. ,
. .
,
Apache.
, :
, .
, :
httpd 1

, 2, "
Web Apache" 4, ", ''
.
"".

1.4.
.
,
.
,
Web . 5, "
Web " ,
( www.christiffnsite.org www.muslimsite.org)
.
, , , .

1.

27

( )
:
<Directory>, <DirectoryMatch>
.htaccess.
URL (Unified Resource Locator) <Location>
<LocationMatch>.
<Files> <FilesMatch>.

1.4.1.

<Directory> <DirectoryMatch>
,
/home/ site2 .
, , ,
, /home/site2,
, .
DirectiveA.
DirectiveA /home/site2 ,
, <Directory>:
<Directory /home/site2>
DirectiveA
</Directory>

. 1.1. DirectiveA
<DirectoryMatch>
<Directory> ,
, .
<DirectoryMatch
"/home/site[1 3]">
DirectiveA
</DirectoryMatch>
/home/sitel, /home/site2 /home/site3.
28

I.

1.4.2.
.htaccess

,
.
.htaccess. ,
AccessFileName.
, .htaccess, , Apache
, .
AllowOverride.
AllowOverride .
,
.htaccess. . 1.1.
1.1.

AllowOverride

None

AuthConfig AuthDBMGroupFile,
AuthDBM UserFile, AuthGroupFile, AuthName, AuthType,
AuthU serFile, require
FileI nfo

AddEncoding, AddLanguage,

AddType, DefaulType,

ErrorDocument, LanguagePriorty
Indexes

AddDescription, AddIcon,
AddIconByEncoding, AddIconByType, D efaultI con,
D irectoryIndex, FancyIndexing, H eaderN ame, IndexI gnore,
IndexOptions, ReadM eName

Limit
Options

allow, deny order


options XBitHack

. ,

Options Filelnfo .htaccess,


:
A llowO verride Options F ilelnfo

, .htaccess , ,
, , ,
/home/site2/cgi bin, Apache
.htaccess ( )

, .
, . ,
.htaccess,
:
Al l owOverri de

none

1.

29

1.4.3. URL:
< Location> < LocationM atch>
<Directory>
, <Location>
Web . <Location> <Directory>
.
, <Location>
.
,
. , ,
www.example.com :
<Location / status>
SetH andler server status
</ Location>

Apache ,
:
http:/ / www.example.com/ status

He , .
Apache, ,
, , ,
. . ,
, , ,
.

1.4.4.


. Apache,
,
, . ,
Web ,
Web ,
Apache. ()
,
, .
, 5, " Web ".

1.4.5.

< Files> < FilesM atch>


<Files> <FilesMatch>
<Directory> <DirectoryMatch>. ,
, , ,
<FilesMatch>, ,
. , , , .htaccess
:
<Files .htaccess>
Order deny, allow

30

I.

Deny from all


</ Files>

, ,
, <Files> <FilesMatch>

.htaccess.

1.5.
, Apache ,
. ,
, ,
.
, , , " ",
Apache.
, Apache ,
.
.
,
.
, 1:

httpd 1

AddModule ClearModuleList,
( ).
Load
Module (. " " ).
.
(, , ,
) ClearModuleList :
Cl ear Modul eLi st

AddModule:
AddM odule mod_access.c

,
httpd .
CGI , Web , httpd,
, ,
. ,
, .
Apache .
httpd , ,
, "" ,
http . .
, .
Apache . ,

, Web
Apache. 12,
" "

1.

31

1.6.
Unix ,
, . ,
.

Apache.
, ,
apxs (APache eXtenSion). (mod_perl,
mod_php)
. Apache

(DSO).
,
.
,
:
$$enabl e$rul e=SHARED_CORE
,
httpd, 2, " Web Apache".
mod_so ,
LoadModule.

:
LoadM odule perl_module libexec/ libperl.so
( )
libexec, ServerRoot.

1.7.
,
.
,

.
. 1.2.

1.2.

send as is

m od_asis



CGI

c g i s c rip t

m od cgi

im a p file

mod imap

s e rve r in fo

m od in fo

server p arsed

s e rve r s ta tu s
type m ap

32

m od in c lu d e

m o d status
m od n e g o tia tio n

I.

"" . 1.2,
, httpd
.
AddHandler. ,


AddHandler cgi scrip t .pl

.l

cgi script.

SetHandler. SetHandler
<Directory> <Location>. , , ,
/images
, :
<Location /images>
SetH andler im ap file
</ Location>

1.8. MIME$
MIME Multimedia Internet Mail Extensions
( Internet). ,
MIME , ,
, , . MIME

Apache
mime.types, conf.
. TypesConfig.
TypesConfig / etc/ mime.types
mime . types /etc.

MIME
AddType. ,
AddType application/x httpd php

.php

, , .php,
HTML 4. MIME Apache ,
.
MIME AddType
mime.types.
DefaulType.
,

. , DefaultType
:
D efaultType text/ html

1.

33

2
WEB
APACHE
...
2.1.

34

2.2.

34

2.3.
2.4. Web Apache

36
38

2.5. Apache

39

2.6. Web Apache

43

2.7.

44

2.1.
,
Web Apache. ,
,
. , Red Hat Linux
. , ,

2.2.
,
Web . ,

, .
Apache "" 486
. Web
www.apache.org, HP UX, AIX
"" .

2.2.1.
, ,
. Apache, Unix,
34

I.

. ,
,
.
,
( )
/ / ,
"".

, .
httpd.
, ,

1,5. ,
, ,
.
,
.
1

2.2.2.
IDE SCSI. IDE
.
.
/ ,
.
.

SCSI. SCSI ( "") ""
IDE. ,
( , ),
.
,
IDE, , .
SCSI.
, Apache.
.
, ,
.
/ .
/
.

RAID (Redundant Array of In
expensive Disks ). RAID 2,
,
.
. RAID 5
,
. ,
RAID.

(. 3 10)

2. Web Apache

35

2.3.
, .
Unix Linux . Unix
"" Apache, Unix
. ,
Windows 95, Windows 98, Windows 2000, Windows NT, Apple
.

. ,
.
( )
, Unix. ,
Win32, .
,
Unix. Unix
( , "/"
).
, ,
Unix, .
Unix
Windows c. , , Unix
.
OS X Windows 2000 750 1000 , L inux (Unix
) .

2.3.1. Unix
Apache ,
.
, . .
,
Apache, .
( nobody).
. ,
, ,
, .

2.3.2. Unix
Apache (
), . mkdir
( /usr/local, /opt).
cd / opt; mkdir apache

, .
Web .
( Linux cfdisk),
( mkfs) mount.
Apache, . 2.1,
mkdir.

36

I.

2.1. Apache

b in

Apache (httpd)
.

logs

Apache.

conf

Apache.

Apache root.

. .
chown, chgrp chmod.

2.3.3.
Unix
,
, Unix. ,
, Linux. Linux,

, /etc/passwd /etc/group.
/etc/group, . 2.2:

group:password:GID:user_list
2.2. /etc/group

group
password
GID

user_list

( Apache).
.
.
, ,
/etc/passwd file .

/etc/passwd, . 2.3:
user:en crypted password:U I D :GI D :user name:home d i r ect o r y :sh el l

2.. Apache /etc/passwd

user
encrypted_password

( Apache).
. ,
,
Apache.
,
root,
su Apache.
.

2. Web Apache

37

. 2.3

UID

,
,
Apache.

GID

,
, /etc/group.

user_name

, , Sue Smith Bob


Wilson. Apache.

home_directory

shell

,
Apache (/opt/apache
).
/ bin/ false


/etc/passwd /etc/group,
.
,
. Linux, :
groupadd apache
Apache, Apache:
useradd g apache apache
,
root:
chown 0:0 R /opt/apache

2.3.4. Windows
, Windows,
,
.

2.3.5. Mac OS X
Mac OS X Apache.

2.4. Web$ Apache


Web Apache
, . CD ROM,
, ( )
, . , ,
. CD ROM ,
CD ROM ( c Windows)
( Unix) , .
. Web
Apache
http://www.apache.org/dist. (
38

I.

) /dist.
/dist/binaries.
, ,
( Win32 Windows 95/98/NT, Solaris Solaris).

, . Unix
.
Win32 , ,
.

2.4.1. Unix
, ,
(
1 ).
mv apache_X.Y.Z.tar.Z /
.
tar xvzf apache_X.Y.Z .tar.gz

, .
mv apache_X.Y.Z / opt/ apache

2.4.2. Windows
Windows NT , Service Pack 3
. Win32
.

2.5. Apache

.
, ,
.

2.5.1. : make
Unix make.
:
. Apache, Web
( ) .
, .
Makefile. ,
, ,
( ,
).
Apache
Makefiles. ,
, , , .
make .

2. Web$ Apache

39

2.5.2. APACI
Apache
, src, ,
, .
, .
Apaci .
,

httpd, .
, ,
, src. ,
.
, ,
.
12, " ".

Apaci .
,
Apache. configure.
, configure

prefix, ,
Apache.
/opt/apache. , ,
:
./ configure prefix = / opt/ apache

:
Configuring for Apache, Version 1.3.12
+ using in stallatio n path layout: Apache (config.layout)
Creating M akefile
Creating Configuration.apaci in src Creating M akefile in src
+ configured for Linux platform
+ setting com piler to gcc
+ settin g pre processor to gcc E
+ checking for system header files
+ adding selected m odules
+ checking size of various data types
+ doing sanity check on compiler and options
Creating M akefile in src/ support
Creating M akefile in src/ regex
Creating M akefile in src/ os/ unix
Creating M akefile in src/ ap
Creating M akefile in src/ main

Makefile. ,
make,

. , :
make

40

I.

,
2
httpd . , :
make i n st all
:
Y ou n ow h ave successfully built and installed the
Apache 1.3 HTTP server. To verify that Apache
actually works
correctly you now should f i r st check
the
(initially created
or preserved)
configuration
fi les
/ opt / apache/ conf / ht t pd. conf
and t hen you shoul d be abl e t o i mmedi at el y f i re up
Apache t he f i rst
t i me by r unni ng:
/ opt / apache/ bi n/ apachect l
st ar t
Thanks f or
usi ng Apache.
The Apache Gr oup
ht t p: / / www. apache. or g/

HTTP
Apache 1.3.


(
)

/ opt / apache/ conf / ht t pd. conf

Apache
:
/ opt/ apache/ bin/ apachectl st ar t
Apache,
Apache
http:/ / www.apache.org/
. .
httpd , . 2.4.
2.4. h ttp d

http_core.
mod_env.
mod_log_config.
mod_mime.

.
CGI .
.
.

mod_negotiation.

mod_status.

Web
.

, ,

, makefile.
( ).
makefile, , , .

.
find / type f print | grep <missing file>, <missing
f ile> .
2. Web$ Apache

41

. 2.4

m od_include.

mod_autoindex.

mod_dir.

mod_cgi.

mod_asis.

HTTP .

mod_imap.
mod_actions.

.
CGI
.

mod_userdir.

mod_alias.

URL
.

mod_access.c

mod_auth.

mod_setenvif.


Apache .

,
configure , , . con
figure , , ,
configure h.
enable module disable module. , httpd,
mod_proxy,
:
./ configure prefix = / opt/ apache \
enable module = proxy
make . ,
disable, . ,
, ,
mod_asis:
. / conf i gure $$pref i x=/ opt / apache \
$$di sabl e$modul e=asi s
, configure ,
, .
, .

42

I.

2.6. Web$ Apache


2.6.1. Unix
Apache .
( )
.
/ opt/ apache/ src/ httpd / usr/ sbin
apachectl .
bin .
HTTPD .
, httpd.
HTTPD=/usr/sbin/httpd

2.6.2. Windows
Windows NT
. , Web
3
www.apache.org, .
(.
. 2.1). ,
,
Apache.
C:\Program Files\Apache Group\Apache.
Apache Windows NT,
. 2.1.
:\Apache. ,

.
Windows
,
,
. Finish. , .
Windows NT Apache
. ,

, , ,
. Install Apache as Service
Apache Start. :
apache i
Apache Apache.
Windows NT, , 1.3.7, .
, Apache Windows NT ,
.
apache i n "httpd" f "\ \ Odin\ Apache\ conf\ httpd.conf"

,
\\Odin\Apache\conf\httpd.conf, httpd.

.
2. Web$ Apache

43

Web Apache Windows NT


. Windows NT
Start >Settings >Control Panel >Services (. . 2.2).

. 2.2. Windows NT
Apache. ,
Startup. .
:
. Apache
.
. Apache .
. Apache .

2.6.3. Mac OS X
Mac OS X Web Apache.

2.7.
.
Apache
.
3, " Web Apache", , ,
4, ", ".

44

I.

WEB APACHE
...
3.1.

45

3.2.

46

3.3. httpd.conf

46

3.4. Windows

58

3.5 Mac OS X

59

3.1.
Apache :
httpd.conf, access.conf, srm.conf mime.types.
,

( access.conf,

srm.conf). ,
.
httpd.conf.

. . dist ,

. , .
,
.


. ,
, , ,
, Proxy virtual
Host ( ).
,
.

mod_perl, , .

3. Web$ Apache

45

3.2.
Apache
AddModule ClearModuleList,
, , ,
.
12, " ".

3.2.1.
,
, ,
, .
httpd.conf. , .
, AccessConfig ResourceConfig
httpd.conf. Apache .

. , .

3.3. httpd. conf


httpd.conf ,
web : ,
, ..

3.3.1. ServerType
: inetd, standalone.
, Unix.
, Unix,
( , ).
.
telnetd, telnet
syslogd.
, .
, ,
.
Internet.
, ,
, ,
. , , , "" ,
, .
. ,

, . ,
, inetd.
inetd
, Apache .
, .
.
, , ,
Web 28 ,
.
46

I.

Apache
standalone. ,
inetd. inetd
( ,
Unix tcpd),
Apache standalone.
Ser ver Type st andal one

3.3.2. TCP$:

Port

IP : IP ,
( 192.168.1.10), ,
. Unix
/etc/services. ,
,
. ,
, "
2
". (http
hypertext transfer protocol) 80.
Port 80
, .
,
,
. Proxy .
, 80 ,
(. 6,
"Proxy "). ,
, . ,
, 80.
,
Secure Socket Layer (SSL), TCP 443.
Port 443
SSL 8, "".
Unix,
1023 root,
.
httpd.conf root
, .

. "
" " ". ,
,
, , "Request For
Comment" RFC. RFC TCP (RFC 793), telnet (RFC 854).
, .
, , , , RFC
, . ,
""
. : , , ,
, (, "
", , , ).
3. Web$ Apache

47

2.3.3. ClearM oduleList


Apache .
, AddModule
, ClearModuleList.
Cl earModul eLi st

3.3.4. AddM odule


, ,
AddModule. , mod_auth_dbm,

:
AddModule mod_auth_dbm.

3.3.5. :
HostnameLookups
, ,
IP (, 204.62.129.132), ,
(, \vww.apache.org). ,
. ,
, ,
.
HostnameLookups .
Host nameLookups

of f

3.3.6. Unix:
User Group
2, " Web Apache",
Unix Apache.
,
Apache root.

( apache), , Apache.
, .
User apache
Gr oup 506

3.3.7. :
BrowserMatch
,
, ,
User Agent HTTP. ,
, . ,
, Netscape,
Internet Explorer. ,
CGI ,
, .
nokeepalive, Netscape 2.x:

BrowserMatch Mozilla/2 nokeepalive

48

I.

3.3.8. : ServerAdmin
,
.
.
ServerAdmin you@yousite.org

3.3.9. : ServerRoot
ServerRoot , .. ,
. ServerRoot ,

, ,
ServerRoot. , 2, "
Web Apache", ServerRoot :
ServerRoot

/ opt / apache

3.3.10. IP : BindAddress
, Apache IP
. ,
. Apache
.
,
3
. , Apache IP
192.168.1.10, :

Bi ndAddr ess

192.168.1.10

Apache ,
, BindAdress loopback : BindAd

dress 127.0.0.1.
BindAddress "*",
IP ,
.
DNS,
. IP
( ) :
Bi ndAddress

IP ,
, Listen. BindAd
dress .

Unix

netstat i. Windows =>=> =>.


3. Web Apache

49

3.3.11. :
ErrorLog
, Apache
.
, .
"/", ,
ServerRoot. , ,
ServerRoot /opt/apache,

ErrorL og logs/ error_log


, /opt/ apache/logs/error_log.
,
ErrorL og / var/ logs/ apache
, /var/logs/apache.
, , ,
.

3.3.12. : $
TransferLog
,
. ,
.
T ransferL og logs/ access_log

3.3.13. $:

PidFile

,
Unix. ,
Unix . Apache
(httpd), ,
. , .
PidFile logs/ httpd.pid

3.3.14. :

ScoreBoardFile

Apache ( ),
,
, . (
)
. Unix
. ScoreBoardFile.
, .
ScoreBoardFile logs/ apache_status

Windows, Unix. ,
Windows
"\", ,
Unix "/".
4

50

I.

3.3.15. : ServerName
,
.
www. , ,
, ServerNam e, DNS .
ServerName www.example.com

3.3.16. CacheN egotiatedD ocs


HTTP 1.1 , Apache
proxy ( ,
HTTP 1.1), ,
, .
. ,
proxy .
CacheNegot i at edDocs

3.3.17. :
Timeout
,
, , Apache .
. ,
, :
GET
,

HTTP PUSH PUT .
, 300 , .
, (
), . :
Timeout 150

3.3.18. : KeepAlive
.
.
, ,
IP ,
, , , .
KeepAl i ve On

3.3.19. M axKeepAliveRequests
,
(. KeepAlive).
. 0
"".
MaxKeepAl i veRequest s

3. Web Apache

51

3.3.20. K eepAliveTimeout
,
Apache .
KeepAliveTimeout 15

3.3.21. :
MinSpareServers

Apache, . ,
,
. MinSpareServers
Apache,
.
MaxSpareServers.
M inSpareServers 5

3.3.22. :

MaxSpareServers

, . . MinSpareServers.
M axSpareServers 10

3.3.23. :

startservers

httpd,
. , ,
MinSpareServers,
. , .
St art servers 5

3.3.24. :

MaxClients


.
. ,
. , ,

, ,
httpd .
,
HARD_SERVER_LIMIT,
. HARD_SERVER_LIMIT 256.
MaxCl i ent s

150

3.3.25. :
MaxRequestsPerChild
,
, . ?
,

52

I.

,
. :
M axRequestsPerChild 30

3.3.26. :
<Directory>
1, " ", ,
(Options, AllowOverride), ,
(<Directory>). , ,
, ,

/opt/apache/htdocs:
<D irectory / opt/ apache/ htdocs>
</ D irectory>

, , .

3.3.27.

Location

, URI
(Uniform Resource Identifier), . ,
URI secure_ stuff , ,

:
<Location / secure_stuff>
order deny, allow
deny from all

al l ow

f rom

127.0.0.1

</ Locat i on>

3.3.28.

Options

.htaccess
<Directory> <Location> ,
. Options,
. 3.1.
3.1.
< Location>

ll
ExecCGI
FollowSymLinks

Includes

.htaccess, <Directory>

Multiviews.
CGI .

. ,
, ,
<Directory>.
.

3. Web Apache

53

. 3.1

IncludesNOEXEC

,
#exec # include CGI .

indexes

, URL ,
DirectoryIndex (
index.html),
.
Multiviews.

Multiviews

SymLinksIfOwnerMatch ,

.
, ,
. . ,
Options "+" "", :
, "+",

, "",

3.3.29.

AllowOverride

" " 1, "


" ,
.htaccess. ,
, , Options (. ),
, ,
AllowOverride. All, None
Options, FileInfo, AuthConf ig Limit.
, " ".
AllowOverride None

,
.htaccess. AccessFileName.
, AllowOverride on
Apache
(, /apache/htdocs/index.html
/, /apache /apache/htdocs). A
, , .

3.3.30.

order

mod_access. order
allow deny. , ,
, :
. , :

order allow, deny

54

I.

:
order deny, allow

3.3.31. allow
allow ,
. (192.168.20)
(righthere.net). ,
, . , ,
. ,
(.sample.org, sample.org).
al l ow f rom al l

3.3.32. deny
deny ,
. (192.168.20)
.
(.sample.org, sample.org).
deny from all

3.3.33. HTML: DocumentRoot


,
. ,
,
. , (,
root, "/") ""
.
DocumentRoot. , 2, " Web
Apache", :
DocumentRoot / opt/ apache/ htdocs

3.3.34. :
UserDir
,
user.
U serD ir public_html

3.3.35. / :
Directory Index
Apache URL ,
, .
index.html, . ,
Apache , .
D irectoryI ndex index.html index.htm index.cgi index.shtml

, Apache
. .

3. Web Apache

55

, ,
"Not found", .

3.3.36. Fancylndexing
Fancylndexing on, ,
Icon, Name, Last Modified, Size D escription.
Fancylndexing on

3.3.37. AddIcon, AddIconByType,


AddIconByEncoding
Addlcon
.
.
, " ".

3.3.38. DefaultIcon
,
, Addlcon
.
DefaultIcon /icons/unknown.gif

3.3.39. AddD escription


.
AddDescription "Access Policy" README.HTML

3.3.40. ReadmeName
README
mod_autoindex,
.
ReadmeName README.html

3.3.41. HeaderName
,
.
HeaderName HEADER

3.3.42. IndexIgnore
,
.
Indexlgnore */ .??* *~ *# */HEADER* */README* */RCS

3.3.43. AccessFileN ame


, ,
, .
AccessFileN ame .htaccess
56

I.

3.3.44. DefaultType
, MIME
, .
:
D efaultType text/ plain

3.3.45. AddLanguage

. ,
AddLanguage en .en .english
, filename.html.en filename.html.english
.
, ,
.

3.3.46. LanguagePriority
.
.
LanguagePriority en fr de

3.3.47. Alias

. :
Alias / icons/ / usr/ local/ etc/ httpd/ icons/

3.3.48. ScriptAlias
, .
: ScriptAlias _.
:
ScriptAlias / cgi bin/ / usr/ local/ etc/ httpd/ cgi bin/

3.3.49. AddType
AddType MIME .

mime.types. Apache .
,
Apache.

3.3.50. AddHandler
Apache
Unix
Windows. AddHandler
.
. 3.2.

3. Web Apache

57

3.2. Apache

cgi script

URL CGI.

knap file

URL .

isapi isa

Windows. URL
(DLL) ISA.

server info

,
.

server parsed

server status

,
.

type map

URL .

, .
, 12, " ".
CGI
.pl . ksh:
AddH andler cgi script .pl .ksh
,
:
<Locat i on /cgi >
AddHandl er cgi $scri pt
</ Locat i on>

3.4. Windows
Apache Windows
Unix. conf,
Apache,
httpd.conf srm.conf. ,
Unix .
, ,
Windows ,
Unix, Apache
. , ,

"/". .
Apache , ,
Apache.

3.4.1. Unix
Unix Apache , ,
. Windows ,
Apache .

58

I.

Apache, Windows .
Windows Apache (
).
. ,
Apache, .

3.4.2. M axRequestsPerChild

. Windows
,
.

3.4.3. ThreadsPerChild

. ,
.
50, .

3.5 Mac OS X
, , OS X
Unix BSD 4. ,
. ,
OS X Apache ,
OS X .
Apache, OS X,
ASCII. , :
1. Desktop, ;
2. File New Finder;

3. Terminal..

3.5.1.
Apache Mac OS .
Network System Preferences,
Services .
Apache, Unix,
, OS X.
Unix

httpd
httpd.conf
srm.conf
access . conf

OS X

/ usr/ sbin / apache


/ L ocal/ L ibrary/ Webserver/ Configuration/ apache.conf
<He CM . apache.conf>
<He . apache.conf >

apachectl

/ usr/ sbin/ apachectl

, Apache,
Unix, OS X.

3. Web Apache

59

$APACH E/ conf
$APACH E/ cgi bin
$APACHE/ htdocs
$APACH E/ htdocs

OS X

/ local/ library/ Webserver/ Configuration


/ local/ library/ Webserver/ CG I Executables
/ local/ library/ Webserver/ D ocuments
/ local/ library/ Webserver/ L ogs

OS X ,
. /System/Library/Apache/Modules.
, :
httpd.exp
libdav.so
libproxy.so
li bssl.so
mod_access.so
mod_actions.so
mod al i as.so
m od_asis.so
mod_auth.so
m od_auth_anon.so
m od_auth_dbm .so
mod_autoindex.so
mod_cern_meta.so
mod_cgi.so
mod_digest.so
mod_dir.so
mod_env.so

m od_expires.so
m od_headers.so
mod_imap.so
m od_in clude.so
mod_info.so
mod_log_config.so
mod m im e.so
mod_mime_magic.so
mod_negotiation.so
mod_rewrite.so
m od_setenvif.so
mod_speling.so
mod_status.so
mod_unique_id.so
m od_userdir.so
m od_usertrack.so
mod_vhost_alias.so

LoadModule.
.

3.5.2.
OS X inetd, , .
"standalone".

60

I.

4
,

...
4.1.
4.2. Apache
4.3.

61
62
65

4.4. Apache

66

4.5. Apache

68

4.6.

69

4.1.
, Web
Apache. ,
, ,
. ,
, apachectl,
Web 1.3.
$APACHE/ bin/ apachectl [ start | stop | r est ar t ]

Apache
configtest.
$APACH E/ bin/ apachectl configtest

apachectl start, stop, restart configtest.


.

4.1.1. Win32

Windows Unix, Apache
Win32 Unix.
Windows ,
Windows.

4. ,

61

4.2. Apache
Web- Apache :
1
inetd .
ServerType, standalone inetd (. 3,
" Web- Apache").
apachectl .
apachect l
conf i gt est
, start . (
"Syntax OK"), Apache :
apachect l

st art


. URL. Web . 4.1.

. 4.1. Web

, , .
ps ax | grep httpd
, Apache:
26358 ?? I
26638 ?? S

26711
26712
26976
26993
27018
27020
27412
28361

??
??
??
??
??
??
??
??

0:00.21 / usr/ local/ apache/ bin/ httpd


0:01.15 / usr/ local/ apache/ bin/ httpd

I
I
I
I
I
S
I
Ss

0:00.17 / usr/ local/ apache/ bin/ httpd


0:00.08 / usr/ local/ apache/ bin/ httpd
0:00.08 / usr/ local/ apache/ bin/ httpd
0:00.06 / usr/ local/ apache/ bin/ httpd
0:00.11 / usr/ local/ apache/ bin/ httpd
0:00.06 /usr/local/apache/bin/httpd
0:00.01 / usr/ local/ apache/ bin/ httpd
2:45.46 / usr/ local/ apache/ bin/ httpd

(httpd) , Web , , , . , IP- http:/ / 192.168.100.1.

62

inetd , " Unix"


I.

.
DNS (Domain Name Service) (
intranet ),
. .
.

IP .
Unix /etc, Windows
, .
.
_I_ [],
:
192.168.100.1 www.fakesite.com fake

Apache ,
, "
", .

4.2.1. inetd
Apache
. , ,
tcp, inetd,
Apache /etc/inetd. conf:
httpd stream tcp nowait httpd / opt/ apache/ bin/ httpd f
/ opt/ apache/ conf/ httpd.conf
.

4.2.2. Windows
Windows Apache Start.
Start Apache. Apache
(. 4.2).

. 4.2. Apache
Window.

4. ,

63

, Apache.
.
Apache
. ,
. , Windows 95 Windows 98
Apache .
Windows NT Apache (. 3,
" Web Apache"). ,

, , . ,
. Apache Windows NT
:
NET

START

APACHE

Apache :
NET

STOP

APACHE

, Windows NT
Apache : Start=>Settings=>Control Panel=>Services.
,
Start. Apache
Windows NT (
<Ctrl+Alt+Delete>). . 4.3.

. 4.3. Windows NT

4.2.3. Mac OS X
Apache Mac OS Net
work System Preferences Services
Web Server Off . ,
apachectl :
apachect l

64

st art

I.

OS X Apache apache, httpd.


:
ps aux i grep apache
Web Off On
( 2, " Web Apache") .

c. ,
"Powered by Mac OS X".

4.3.
, Apache .
, , ,
, .
,
.

. 4.1.
4.1. apache

d serverroot

serverRoot. ,
, ,
, ,
.
: Unix /usr/local/apache; Win
dows /apache; OS/2 /os2httpd; OS X

/Local/Library/Webserver.
D name

f config_f lie

,
if Define.
/ .

,
.
.

httpd. conf, conf,


.

"directive"


Apache.
(
);
.
Web .
.
, ,
.

4. ,

65

. 4.1

, ,
( Apache
1.3.4 ).

Apache 1.3.4 .

. Apache 1.2 1.3.3:


,
.
h

Apache 1.3.4
.

vhost
, .
t

k option


, .
,
"Syntax OK" .

.
.
.
.
.
, .
,
"Syntax OK" ,
0.
.
.
t.
, Windows.
Apache ,
("shutdown" "restart"),
.
1.3.4,
httpd.

h.

4.4. Apache
,
, . ,
, "Apache",
, . ,
( , ,

66

I.

MaxClients), Apache .

httpd, .

ps aux I grep httpd


,
.
, Unix.
.
, .

4.4.1.
Unix .
. ,
. ( csh, ksh,
bash ..)
fork(). ()
, ,
, .

,
.. , , ,
.
exec().
? Apache PID
(Process IDentification number )
. ,
, .
PID .
logs httpd.pld ,
PidFile.

/opt/apache/logs/httpd.pid

$APACH E/ logs/ httpd.pld

, .

4.4.2.
Unix .
,
, ,
. Apache
. . 4.2.
4.2.

TERM

HUP

,
,
.

4. ,

67

. 4.2

USR1

,
(, ),
.
,
.

kill(). PID
, .
:
kill TERM 12345
PidFile (
$APACHE/logs/httpd.pld). :
kill TERM 'cat $APACHE/logs/http.pid'
.
:

tail f /opt/apache/logs/error_log

4.4.3. Windows
Windows 95 Windows 98 Apache
:
Apache k restart
Windows NT .
Apache http
Apache n "http" k restart
.
, Apache, .
Apache, Start.

4.4.4. Mac OS X
Mac OS X

apachectl:
apachectl restart

4.5.

Apache

Apache
kill.

kill

TERM

'cat $APACHE/logs/http.pid'

, apachectl:
$APACHE/bin/apachectl stop

68

I.

4.5.1.
, Unix
, .
:
TERM. ,
. ,
.
,
.
HUP. TERM, HUP
.
,
2
,
.
USR1. USR1 .
,
, , .

, .

4.5.2. Windows
Windows Stop Apache
Start

apache k
MS DOS. Windows NT
( ).
apache n "http" k shutdown

Apache <Ctrl+C>.

4.5.3. Mac OS X
Apache, Mac OS X,
, Network System Preferences Services,
Stop.

apachectl.
apachect l

st op

4.6.
.

ErrorLog httpd.conf. Apache
.

, HUP
. ,
, t httpd.
2

4. ,

69

, ,
. ,
, .

.
:
fcntl: F_SETLKW: No record locks available.
, Apache
.
,
( httpd) ,
,
.
(.
LockFile).
, ,
, .
Cannot, determine host name. Use ServerName directive to set it manu
ally. . Apache ,
.
httpd. conf ,
(.., #) :
ServerName www.example.com

ServerName localhost
setgid: Invalid argument. , Group,
.
Group ,
.
Linux Problems. Apache ,
Linux shmget: function not found,
, Sys V IPC
(InterProcess Communication).
Linux .
windows Problems. Apache ,
Windows 95, Unable to Locate WS2_32. DLL,
winsock2. .
htt p://www.microsoft.com/windows 95/downloads.
Error 1067.
Windows NT
.

70

I.

II

Web

...
5. Web
6. Proxy
7.
8.
9. Web
10.
11.
12.

5

WEB
...
5.1.

72

5.2.

73

5.3. IP

74

5.4.

76

5.5. Apache

77

5.6. IP

79

5.7.

80

5.1.
.
Apache
IP ,
Web . .
, ,
.
Apache
IP (. BindAddress Listen). IP
1
. IP
.
Apache :
1. .
2. .
3. IP .
,
, .
, User ,
Apache .

72

IP , " ".

II. Web

Apache,
Web .
, , IP
. Apache ,
(, , ).
virtualHost.
.
virtualHost.
.

.
. .
IP .
, ,
IP . IP
.
, , , IP ,
, IP .

,
2
. IP
(NIC). ,
IP .
, Apache, ,
.

5.2.
UserDir ,
URL , . 5.1.

5.2.1. U serD ir som e_directory


, , Web
.
, Apache :
http:/ / www.example.com/ ~userguy


userguy. , /home, ,
userguy /home/userguy.
,
U serD ir some_directory,

Apache Web
3
some_directory /home/userguy .

/home/userguy/some_director

, HTTP , 1.1, ,
, .
3
public_html

5. Web

73

. 5.1.

5.2.2. UserDir / an/ absolute/ path


,
, Web .
, ,
UserDir. , Apache URL
http://www.example.com/~timmy/x flies.html,

UserDir /var/user/webspace,

/var/user/webspace/timmy/x files.html

5.2.3. UserDir / an/ absolute/ * / with/ wildcard


UserDir
. ,
Web . "*".
Apache

http://www.example.com/~susie,
( "~")
. ,
UserDir:
UserDir /home/*/public_html,
Apache URL
/home/susie/public_html

5.3. IP$
,
. Apache IP
74

II. Web$

80 IP , . ,
, . ,
, .

5.3.1. IP$:
BindAddress address
BindAddress Apache
IP .
Apache 192.168.1.10:
Bi ndAddr ess

192.168.1.10

IP ,
Bi ndAddress *

5.3.2. IP$: Port portnum


Apache IP 80 IP .
, 80 " ",
HTTP, Web .
, ,
, ,
. Apache
proxy,
intranet. ,
Listen ( ),
Port . , Apache
4444,
Port 4444

5.3.3. IP$: Listen


Port, Listen
Listen. Apache 80 ( HTML)
( ),
Li st en

80

Li st en
, Listen IP .
, IP 192.168.1.2.
Listen :
Li st en 192.168.1.2:80
Li st en 192.168.1.2:

5.3.4. IP$
IP :
.

IP ifconf ig.

5. Web

75

,
. ifconfig .
ifconfig (interface configuration ) :
.
.
,
. ifconfig .
/home/root> ifconfig eth0
(,
):
eth0 Link encap:Ethernet HWaddr 00:20:78:17:9A:
inet addr:192.168.1.1 Beast:192.168.1.255 mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 M etric:!
RX packets:260652 errors:0 dropped:0 overruns:0 frame:0
TX packets:565370 errors:0 dropped:0 overruns:0 carrier:0 collisions:0
, ifconfig
. , eth0:l.
IP (192.168.100.2).
/home/root> ifconfig eth0:1 192.168.1.2 netmask 255.255.255.0
, eth0:1 ,
, pings
, 50 .

5.4.

HTTP. IP
. ,
IP .
HOST, , .

, ,
Internet. ,
HOST , HTTP 1.1.

.
:
.
DNS , IP
.
Apache ,
.

5.4.1.
(DNS) Inter
net. IP .
Internet
. DNS, URL
, IP DNS.
76

II. Web

Internet,
.
, .
.
http://www.networksolutions.com (. . 5.2).

. 5.2.
, ,
.
. DNS
.
DNS , ..
. ,
. ,
DNS ,
.

5.5.
Apache
,
. , , ,
.
1. NameVirtualHost IP ,
.
2. VirtualHost ,
Web .

5. Web

77

5.5.1. IP :
NameVirtualHost
NameVirtualHost IP
httpd.conf.
NameVi r t ual Host

192.168.1.1

Apache ,
192.168.1.22 , .
Apache ,
VirtualHost , .
NameVirtualHost.
NameVi r t ual Host

192.168.1.1:80

Web ,
HTTP 1.1 . ,
HTTP 1.1 HOST, ( ). Web
. ,
Web IP , .

5.5.2. : VirtualHost
VirtualHost " ".
,
. , :
<VirtualH ost 192.168.1.1>
ServerName www.examplel.org
DocumentRoot/some/other/directory
</VirtualHost>
, ,
<VirtualHost>, ,
ServerName. , <VirtualHost>,
, IP .
, <VirtualHost>, .
(. . 5.1).
5.1. ,

BindAddress

Listen

BindAddress ,
IP ,
.
Listen , IP
, , .
.

MaxSpareServers

,
,
.

MinSpareServers

,
,
.

78

II. Web

. 5.1

MaxRequestsPerChild

PidFile

, PID
.

ServerRoot

ServerType

inetd
.

TypesConfig

MIME .

NameVirtualHost


Vi rt ual Host .

5.5.3.
_default_ IP
,
,
. , ,
. ,
,
.

<VirtualHost _default_>

... ...
</VirtualHost>

5.5.4. IP$ ?
,

(VirtualHost, BindAddress ..), ,


, IP .
<VirtualHost www.idiots_anonymous.org>

... ...

</VirtualHost>
,
IP . , .
Apache, ,
DNS, .

5.6. IP$
IP ,
Host ( ,
HTTP 1.1), , , ,
. IP :
1. .
2. ,

IP (. "IP " ).
5. Web

79

3. DNS IP .
4. Apache , ,
.
. ,
, "
" . .
DNS
IP .
, IP ,
"IP " .
Apache
IP ,
NameVirtualHost.
www.example2.com 192.168.1.2, :
<Vi rt ual Host
192.168.1.2>
ServerName www. exampl e2. com
</ Vi rt ual Host >

5.6.1. ,
IP$
,
. ,
.
NameVirtualHost IP ,
.

5.7.

<VirtualHost> .
,
, . ,
, .
,
Apache.
, .
, ServerName
:
ServerName www.site2.com

DocumentRoot,
. , , Web
, .
DocumentRoot / home/ site2

ServerAdmin
. ,
, .
ServerAdmin admin@site2.com

80

II. Web$

ErrorLog TransferLog,
. , Unix
( Linux) ,
.
. ,
, ,
,
. , syslog .
Unix .

5. Web

81

PROXY

...
6.1.
6.2. ?
6.3. proxy
6.4.
6.5. proxy

82
83
84
86
87

6.1.
Proxy- ,
.
. ,
,
, . Proxy
,
Web , .
Odin, . 6.1, ,
proxy .
Odin :
Apache proxy.
Odin (IP 192.168.100.1),
Internet (IP 135.186.123.123).
proxy (Loki Fenris) ,
Odin (192.168.100), , Internet
Odin.
, ,
Apache proxy ,
.
.

82

II. Web

135.186.123.123

192.168.100.80

192.168.100.10

. 6.1. Proxy

6.2. ?
Proxy , , .
, Apache proxy .
. , Web
, .
. proxy
,
. , ,
, . ?
, proxy
: . ,
Internet , Internet
6. Proxy

83

.
,
Internet.
, ,
.

6.2.1.
proxy , ,
(80). ,
. proxy

proxy .
8888
proxy . , Listen
.
L isten 8888 <VirtualH ost l92.168.100.1:8888>
. . . ...
</ VirtualH ost>

6.3. proxy$
, proxy, .
, ,
mod_proxy . mod_proxy
Apache.
1
httpd . .
proxy .
Proxy Requests On

Apache ,
Internet, .
, .

8888.
proxy.asgard.com.
L isten

8888

<Vi r t ual Host


ServerName

192. 168. 100. 1: 8888>


proxy. asgard. com

ProxyRequest s On

</ Vi rt ual Host >

6.3.1. Web$
, ,
Apache proxy,
. ,
. Apache , ,
ProxyBlock. ,
ProxyBlock kiddiporn.com snuffilm.org

84

2 4.

II. Web$

6.3.2. proxy$
proxy ,
. ProxyRemote

, .
ProxyRemote ftp http://ftpsrvr.local.com:8080

6.3.3.
proxy
: .
" / ",
, NoProxy.
N oProxy .example.com


proxy .

6.3.4.
/ ,
. ProxyPass
URL ,
.
, www.example.edu,
, /distant/mirror www.example.edu.

ProxyPass /distant/mirror http://www.tuchman.edu


http://www.example.edu/distant/
mirror proxy http://www.tuchman.edu.

6.3.5.
.
. ProxyDomain ,
, ,
.
ProxyDomain .example.com
URL, http://www,
http://www.example.com.

6.3.6.
proxy
, proxy.
<Directory proxy:*>
order deny,allow
deny from [ IP ]
allow from [ IP ]
<Directory>

6. Proxy$

85

6.4.
Web (
), ,
, .
,
, ,
.
, .
.

6.4.1. : CacheRoot
.
CacheRoot .
, ,
.
CacheRoot / cache

6.4.2. : CacheSize
5 .
, CacheSize.
.
CacheSi ze 10240
10 . , CacheSize
, , , .
, .
CacheSize , 70%
, .

6.4.3. :
CacheDirLevels
CacheRoot
CacheDirLevels.
CacheRoot
CacheDi rLevel s 3

6.4.4. : CacheDirLength
:
.
25
CacheDi r Lengt h

25

6.4.5.

. Apache
. , ,
Web , Apache

86

. Web

,
. . 6.1.
6.1. ,

CacheMaxExpire
CacheDefaultExpire

,
. 24 .
,
, .

1.
CacheLastModifiedFactor

,

,

CacheLastModifiedFactor
, ,
.

6.4.6. :
CacheGcInterval
,
. .
Apache
, Cachesize.
CacheGdlnterval. ,
( ).
CacheGdlnterval .5
, 30 .

6.4.7. : NoCache
,
, NoCache.
. NoCache ,
, ,
, , ,
NoCache news www.fool.com
, NoCache (*)

NoCache *

6.5.
proxy$
, Apache
proxy .
,
proxy. Netscape Navi

6. Proxy$

87

gator Microsoft Internet Explorer ,


Internet proxy.
serverodin. asgard. com p roxy .

6.5.1. Netscape Communicator


Netscape Communicator proxy
:
1. Edit Preferences.
, . 6.2.

. 6.2. Preferences Netscape


2. , , "+",
Advanced. .
Proxies.
3. Manual, View, .
, . 6.3.
4. URL proxy , .
, .
, .

6.5.2. Internet Explorer


Internet Explorer proxy
:
1. Internet Explorer. View
Internet Options. Internet Options.

2. Internet Options Connection.


3. Access the Internet using a Proxy Server,
Proxy Settings, . 6.4, Advanced.

88

II. Web$

4. URL proxy , .
.

. 6.3.
pa Netscape proxy

6. Proxy$

. 6.4. Internet
Explorer proxy

89

7

...
7.1.
7.2.
7.3.

90
91
92

7.4. mod_status

94

7.5. mod_info

97

7.1.
, ,
1
. ,
,
.
, . ,
, ,
, .

7.1.1.
Apache :
.
, .
,
, .
, ,
.

7.1.2.
Apache ,
.
mod_sta tus.

. mod_inf.
. HTML,
Web .


, . , ,
. , , .

90

II. Web

7.2.
,
, , ( )
. " " .
"" ,
.
error_log, logs,
2
ServerRoot .
$APACHE/logs/error_log
Unix
. ErrorLog
syslog.
ErrorLog sysl og
,
3
/dev/null .
ErrorLog /dev/null
, .
,
.
.
, ,
ErrorLog . ,
/var/log/httpd.error_log,
ErrorLog / var/ log/ httpd.error_log
, Apache .
. 7.1. LogLevel
, .
7.1.

debug
info
notice

.
.

, .

warn

, .

error

, .

c rit

. .

alert
emerg

.
.

2 ServerRoot UNIX $APACHE.


/dev/null UNIX,
.
3

7.

91

LogLevel warn error.



, .

7.3.
( )
.
mod_log_config,
mod_log_common.
, .
,
.
.

7.3.1.
.
/
virtualHost.
(
), .

7.3.2. :
TransferLog
Trans ferLog
(
ServerRoot).
acc ess.log logs ServerRoot.
Tr ansf er Log l ogs/ access_l og
7 .
. 7.2.
7.2. ,

host
ident

authuser
date

IP .
.
, IdentityCheck,
.
,
, .
"dd/mm/yy:hh:mm: ss zone",

request

, .

status

, .

bytes

, .

92

. Web

7.3.3.
access.log LogFormat.
( . 7.3),
.
. , LogFormat
, (%h), (%t)
(%b).
LogFormat

"%h

%t

%b"

,
.
LogFormat "Host=%h Date=%t BytesReturned=%b"
7.3.

IP
.
IP .
Content Length, .
.

%f

.
IP .
HTTP .

%l

. ,
IdentityCheck.
, Apache
.
().

, .
TCP, .

%r

%s

HTTP ( ).
HTTP .
HTTP .

%T

%t
%U

%u

, .
.
URL, .

.

7.

93

. 7.3

%v

UseCanonicalName.

%v

serverName.

7.3.4.
,
Apache ,
.
, Apache
. . Apache
. ,
offset, , , ,
. , Apache
, .
, ,
,
. , , .
,
, HUP.
k i l l 1 'c at h ttp .p ld '

7.4. mod status


mod_status .
, , ASCII,
.

ExtendedStatus. , ,
ExtendedStatus
. .

7.4.1. Apache

mod_status
mod_status .
, .
Apache /
2, " Web Apache"
mod_status ,
. ,
mod__status HTML.
, ( Location).
server status.
httpd.conf :
<L ocation / server status>
SetH andler server status
</Location>

94

II. Web$

,
/server status . . 7.1.

. 7.1.

.
ASCII . . 7.4.
7.4.
ASCII

.
.

&

, .

.
( 4, ", ")

7.

95

. 7.4
ASCII

, .

IP .

7.4.2. :
IP
,
IP .
.
( VirtualHosts)
, IP .
,
, .
, DNS ( ),
.
D.
: , ,
IP .

7.4.3. :
, (
L),
.

.

7.4.4.
, mod_status ,
.

. ,
, mod_status,
. ,
ExtendedStatus On.
, . 7.2.
, .

7.4.5.
Apache (, USR1
Unix), .
HUP TERM.

96

II. Web$

. 7.2.

7.5. mod_inf
mod_inf .
:
.
, .
mod_status, ,
. ( ,
" Apache mod_status", ,
mod_inf .)
mod_inf httpd,
URL,
. ,
<Location / server info>
SetH andler server info
</Location>

Apache ,
server info mod_info.
, , Location.
, . 7.3.
7.

97

. 7.3.
.
, .
.

mod_inf , ,
httpd, .

7.5.1.
mod_info (
HTML), AddModulelnfo.
AddModulelnfo mod custom. "<A HREF=/docs/mod custom/index.html>Notes</A>"

98

II. Web

...
8.1.
8.2.

99
99

8.3.

102

8.4.

104

8.5. SSL

110

8.1.
, ,
( , <Directory> ..)
. ,
.
.
, .
,
, .
.
Apache .

"" .
.
Apache .
, ,
. .
.
;
. ,
Apache SSL (Secure Sockets
Layer ).

8.2.

.

Apache.
8.

99

8.2.1.
Apache root. , root ,
, .
,
root, root:
$

$APACHE/bin
$APACHE/logs

$APACHE/conf

, , ,
apache.

8.2.2.

, ,
.

. ,
,
.

8.2.3.

,
. Web
, . ,
,
"" , .

8.2.4.
,
, ,
.

. .

8.2.5.
,
root:
<Di rect ory/ >

Order deny,
Deny f rom
</ Di rect ory>

al l ow
al l

, ,
:

100

II.

Web

<Di r ect or y / opt / apache/ ht docs>


Order deny, al l ow
Al l ow f rom al l
</ Di rect ory>

8.2.6. CGI$
CGI , .
, .
, CGI .
,
. ,
, , ,
.
Web ,
. :
ht t p: / / www. l Opht . com
ht t p: / / www. pr i vacy. or g

ht t p: / / www. hi deaway. net


ht t p: / / www. genoci de2600. com
Internet,
.
CGI .
.
,
, , ,
.

8.2.7.
,

. . ,
, .

8.2.8.
,
. ,
Options.
Options IncludesN OEXEC

8.2.9.
mod_autoindex
index.html.
, .
ClearModuleList.

8.

101

8.2.10.
,
. , .htaccess
. AllowOverrides None.
AllowOverrides None

8.2.11.
, ,
( , )
, . ,
,
. , ,
Web http://www.mit.edu/network/pgp.html.

8.3.
Apache ,
.
.

8.3.1. : mod__access
mod_acccess .
.
,
. IP ,
.

8.3.2. order
order ,
Apache deny allow.
. 8.1.
8.1. order

order deny, allow

order allow, deny

order m utual failure

, ..


, .

8.3.3. allow
,
.

102

Web$

/some/directory , , .
<Directory /some/directory>
allow from all
</Directory>
, order deny.
/some/directory asgard.com :
<Directory /some/directory>
order deny, allow
deny from all
allow from .asgard.com
</Directory>
.
Apache , .
, /some/directory 192.168.100, :
<Directory /some/directory>
order deny, allow
deny from all
allow from 192.168.100
</Directory>
/some/directory
192.168, :
<Directory /some/directory>
order deny, allow
deny from all
allow from 192.168
</Directory>
(
255.255.252.0).

<Di rect ory

/ some/ di rect ory>

order deny,
al l ow
deny f rom al l

al l ow

f rom

153. 168. 242. 0/ 255. 255. 252. 0

</ Di rect ory>


, :

<Di rect ory / some/ di rect ory>


order deny,
al l ow
deny f rom al l

al l ow

f rom

f enri s. asgard. com

</ Di rect ory>


IP :

<Di rect ory / some/ di rect ory>


order deny,
al l ow
deny f rom al l

al l ow f rom
</ Di rect ory>

8.

192.168.100.80

103

8.3.4. allow from env


allow
.
BrowserMatch .
,
BrowserMatch ^M ozilla netscape_yes
<Directory /opt/apache/htdocs >
order deny, allow
deny from all
allow from env= netscape_yes
</ D irectory>

, SetEnviIf
allow from env deny from env.

8.3.5.

deny

deny (IP , , IP ,
, all) allow.
, allow.

8.3.6. deny from env


,
(. allow from env),
.

8.4.
, ,
.

.
, .
AuthName
AuthType .

8.4.1. : AuthName
AuthName
, .
, . ,
"Restricted Site", :
AuthName "R estricted Site"

8.4.2. : require
require.

, valid user.
require valid user

104

II.

Web$

, ,
( ).
require valerie joey bobby

,
. Auth
GroupFile
. , Valerie, Joey Bobby
mathdept. ,
requi re mat hdept
, . ,
AuthGroupFile, .

8.4.3. : AuthType
AuthType ,

(basic digest). basic () ,


. ,
.
.
digest ()
MD5 . ,
,
.
, :
Aut hType basi c

8.4.4. mod_auth
mod__auth .

,
.

8.4.5.

htpasswd
mod_auth
, ,
. Apache
htpasswd, .
:
htpasswd passwordfile username

, .
username . htpasswd
. :
/ etc/ security> htpasswd local__passwd userguy
Adding password for userguy.
N ew password:
Re type new password:
/ etc/ security>

8.

105

crypt()
.
,
.

8.4.6. :
AuthUserFile
,
Apache, . AuthUserFile.
,
, htpasswd.
AuthU serFile / etc/ security/ local_passwd

8.4.7. :
AuthGroupFile
require
. ,
, , ,
. , Apache , grouplist
/etc/security, :
AuthG roupFile / etc/ security/ .grouplist

require
, .

8.4.8. :

AuthAuthoritative
, mod_auth ,


. AuthAuthoritative ,
1
, .
AuthAuthoritative off

8.4.9. :

mod_auth

,
AuthName AuthType mod_auth
require. , www.site2.com
, , .
<D irectory / home/ site2>
AuthN ame "Example of Access Control"
AuthType Basic
AuthU serFile / etc/ security/ .htpasswd
R equire valid user
</ D irectory>

106

II.

Web$

, /home/site2 www.site2.com
DocumentRoot. www. site2.com,
, . 8.1.

. 8.1. mod_auth

. , ,
. 8.2.

. 8.2.
, , ,
, .
errordocument.
ErrorD ocument 401 / site_error.html

8.4.10. mod_auth_dbm
, mod_auth_*
. , mod_auth
,
,
. , Apache
,
.
, ,
.

8.

107

,
,
.

8.4.11. :

dbmmanage
mod_auth_dbm
. ,
,
. ,
dbmmanage . :
dbmmanage filename [command] [username],
command . 8.2.
8.2. dbmmanage

adduser
check
d e le te

.
.
.

im port

update

view

, usertwo dbm,
/etc/security/httpdbase,
dbmmanage / etc/ security/ httpdbase adduser usertwo
,
.

8.4.12.
DBM: AuthDBMUserFile
DBM
Apache. DBM
AuthDBMUserFile.

AuthDBMUserFile /etc/security/httpdbase

8.4.13. Auth_D bm_Authoritative


AuthDbmAuthoritative
mod_auth_dbm.
AuthDbmAuthoritative on

108

II.

Web

8.4.14. AuthDbmGroupFile
mod_auth, mod_auth_dbm
. DBM ,
.

8.4.15. mod_auth_db
mod_auth_db.
DB
. DBM,
. , ,
, mod_auth_dbm,
. .

AuthDBUserFile

< D >

AuthDBGroupFile

< >

AuthDBAuthoritative

<on|off>

8.4.16. mod_auth_anon
mod_auth_anon

, . ,
. ,
,
"anonymous", .
.
,
"@" ".". ,

. ,
, mod_auth_anon
.

8.4.17. :

Anonymous
, ,
, "anonymous". ,
"guest".
, , Internet.
"anonymous" "guest", :
Anonymous anonymous guest

8.4.18. : Anonymous_LogEmail
,
.
Anonymous_LogEmail.

Anonymous_LogEmail on

8.

109

8.4.19.
:
Anonymous_Must Gi veEmai l

, on. :
,
.
Anonymous_MustGiveEmail on

8.4.20. :
Anonymous_VerifyEmail
, "@"
".", .
Anonymous_VerifyEmail on

8.4.21. Anonymous_NoUserlD
,
, . ,
,
Anonymous_NoUserID.
Anonymous_NoUserID on

8.4.22. Anonymous_Authoritative
on ,

. mod_auth_anon.
Anonymous_Authoritative on

,

Anonymous_Authoritative off

8.5. SSL
TCP/IP
.
,
. ,
,
. ,
,

. , .
, HTTP
.
Secured
Sockets Layer SSL. SSL Netscape Corporation

.
110

II. Web-

, .
, .

. ,
, ( ),
.


Web . ,
SSL Apache.
.
,
.
, , .
(1987 1993) ,
, , ,
, .
2
. 1994 ,
1950 .

" " ("Applied Cryptography" Bruce
Schemer). , ,
3
Internet, .
, , (
),
.
, ,
4
(Phil Zimmerman),
. , ,
SSL, . SSL
Apache .

8.5.1.

.
, .
, ,
, , , .

. , , .
, , (

),
. , , ,
, .
, , , .
3
, . " " ("Applied
Cryptography") 13 6 ,
"
" ("The Modern Housewife's Guide to Refining Fissionable Material").
4

PGP Internet,

8.

111

, ,
.
( " "),
( " ").
,
. ,
, , .

8.5.2. SSL
, , ,
. , .
, Apache,
SSL, , , ,
.
Linux
, .
( ) Apache,
SSL. , , ,
. Linux Caldera.
80 . .
, ,
Apache.
Stronghold. Apache,
, SSL
.
http://www.c2.net.
Raven. Apache,
SSL. http://www.covalent.net.

8.5.3. mod_ssl
,
SSL . mod_ssl Apache
SSL. Web
http://www.modssl.org.
.
mod_ssl, SSL.
http://www.openssl.org.
, ,
/opt ( ).
openssl X_Y_Z_tar.gz / opt
tar xvfz openssl X_Y_Z_tar.gz

INSTALL,
.
SSL :
./ config
make

make
make

112

t est
i nst al l

II. Web

/usr/local/ssl.
, mod_ssl.
,
Apache (, , ).
mod_ssl A_B_C X_Y_Z_tar.tar /opt/apache
tar xvfz mod__ssl A_B_C X_Y_Z_tar.tar
mod_ssl, ,

Apache. INSTALL,
.
:
. / conf i gure \
$wi t h$apache=. . / apache_l . 3. \
$$wi t h$ssl =. . / openssl $0. 9. \
$$wi t h$rsa=. . / rsaref $2. 0/ l ocal
\
$$wi t h$mm=. . / mm$1. 0. \
with crt= / path/ to/ your/ server.crt \
with key= / path/ to/ your/ server.key \
prefix= / path/ to/ apache \
Makefile ( Apache) ,
/path/to/apache. ,
, .
, /path/to/apache,
make
make cert i f i cat e
make i nst al l
make Apache ,
mod_ssl. ,
Apache mod_ssl.

8.5.4.
Web ,
, .
. , ,
,
SSL .
,
. ,
:
,
.
.
, ,
, .
. ,
. ,
. ,
, , .
.

8.

113

, , , ,
.
http://www.verisign.com
http://www.thawte.com.

8.5.5. SSL
, ,
www.securesite.com. ,

mod_ssl .
SSL .
NameVirtualHost <VirtualHost>.
.
(
5, " Web ").
NameVi rt ual Host 64. 82. 73. 226
<Vi rt ual Host
64. 82. 73. 226>
ServerName www. securesi t e. com
Document Root
/ home/ si t e3
</ Vi rt ual Host >

8.5.6. SSL: ssLEngine


SSL, .
SSLEngine.
SSLEngi ne

on

8.5.7. :

SSLCertificateFile
SSL, ,
.
. SSLCertificateFile.
SSL C ertificateF ile / var/ ssl/ server.crt

8.5.8. : ssLCertif icateKeyFile


,
. , , ,
,
, .
SSL CertificateK eyFile.
SSL C ertificateK eyF ile / var/ ssl/ server.key

8.5.9. SSLCACertif icatePath


, .

SSLCACertificatePath /some/secure/director

8.5.10. SSLCACertificateFile
, ,

.
SSLCACertificateFile / path/ to/ certificate

114

II. Web

8.5.11. : ssLLog
SSL . ,
, ,
. SSLLog
,
ServerRoot. ,
SSL (. SSLLo
gLevel ).
SSLLog /var/log/ssllog

8.5.12. SSL:
SSLLogLevel
Apache, SSL .
. 8.3.
8.3. SSL

.
.

error
warn

,
.

info

trace

, , .

debug


warn.
SSLLogLevel
warn
:
NameVi rt ual Host 64. 82. 73. 226
<Vi rt ual Host
64. 82. 73. 226>
ServerName www. securesi t e. com
Document Root
/ home/ si t e3
SSLEngi ne on
SSLCert i f i cat eFi l e / var/ ssl / server. crt
SSLCert i f i cat eKeyFi l e / var/ ssl / server. key
SSLLog / var/ l og/ ssl l og
SSLLogLevel war n
</ Vi rt ual Host >

8.5.13.

SSLVerifyClient


. : 0 ( ), 1
() 2 ().
SSLVeri f yCl i ent
8.

1
115

8.5.14. SSLVerifyDepth

. ,
.
.
.
SSLVer i f yDept h 3

116

II. Web$

9
WEB
...
9.1.

117

9.2. (SSI)

117

9.3.

119

9.4. CGI
9.5.

121
124

9.6. FastCGI

125

9.1.
Web
. Web :
, ,
, .. Web ,
.
Apache
. , ,
httpd, HTML
SSI,
. CGI , Apache
, Perl (Practical Extraction and Report Language)
, ,
HTML .
,
Apache . , ,
CGI SSI,
Web .

9.2. (SSI)
(SSI)
Web .
, ,
SSI, HTML.
Apache
SSI
.
9. Web

117

9.2.1. SSI
.
,
. , Apache,
,
, ,
.
SSI / .

9.2.2. SSI
mod_include.
, server parsed.
, MIME text/x server parsed html text/x
server parsed htmlS
mod_include.
mod_include
Apache. , Apache
.
SSI . SSI,
:
Options + Include

SSI
includeNOEXEC, Apache .
Options + IncludeN OEXEC

SSI ,
. , AllowOverride ,
SSI .
,
Web SSI SSI. .
,
, SS1. ,
.
SSI ,
( .htaccess, <Location> <Directory>),
.
DocumentRoot , ,
SSI .

9.2.3. SSI
<Location>,
<Directory>, .htaccess,
.
<Locat i on / ssi di r>
Opt i ons +I ncl ude
</ Locat i on>

118

II. Web

9.2.4. SSI
: AddHandler
,
Apache , ,
, SSI. , SSI
.shtml,
AddHandier.
AddHandier server parsed .shtml
,
. shtml
SSI. . shtml ,
.
, AddHandier SSI
.
Apache. CGI
.

9.2.5. SSI
: AddType
. shtml ,
, .
. AddType
, .
, ,
.shtml, text/html.
AddType text/html .shtml
, AddType
AddHandier. :
AddType application/ x server parsed .shtml

9.2.6. SSI: XBitCrack


mod_include XBitCrack.
on, , ,
MIME text/html SSI .
XBi t Crack on
off on, XBitCrack fall,
Last Modified .
proxy .

9.3.
SSI .

9.3.1. SSI: config


config :
errmsg ,
SSI.
9. Web

119

sizefmt [bytes | abbrev] .


timefmt ,
.

<! #config rrmsg=" SSI" >

9.3.2. : echo
echo .

<! #echo var="$APACHEDIR" >

9.3.3. : exec
SSI.

. cmd:
<! # cmd="/bin/date" >
, CGI.
cgi:

<! # cgi = "/cgi bin/program.pl" >


, CGI

, .

9.3.4. : f size
,

config sizefmt, fsize.


<! #config sizefmt="bytes" >
<! #fsize file= "/ bin/ date"
>

9.3.5. :
flastm od
,
config timefmt, :
<! #config timefmt="%m %d %h:%m" >

<! #flastmod file="/bin/whatever" >

9.3.6. : if e lif
SSI () .

if. elif.

<! #if expr= "$var1 = true"


V ar 1 is true

>

<! $$#el i f
expr="$var1
Var 1 i s f al se
<! $$#endi f " $$>

f al se"

$$>

9.3.7. : include

( ) include:

120

II. Web

<! #include file= "/ etc/ motd" >


:
<! #include virtual= "http:/ / www.some.com" >

9.3.8. :
printenv

( ).
<! #printenv
>

9.3.9. : set
set .
<! $$#set

var="v1"

val ue="t he

val ue"

$$>

9.4. CGI
CGI .
CGI .

, ""
COBOL Perl, HTML.
CGI ,
. , Perl ,
HTML .

9.4.1. CGI
CGI , ,
. Apache ,
. 9.1.
9.1. CGI

PATH_INFO

PATH_TRANSLATED .
QUERY_STRING

, .

REMOTE_HOST

,
MINIMAL_DNS.

REMOTE_IDENT

, IdentityCheck
on.

REQUEST_METHOD (GET, POST).

REMOTE_USER

, CGI
.

SCRIPT_NAME

9. Web

121

9.4.2.

Apache

CGI .
, HTML ,
. , ,
, . .
, .
CGI .

9.4.3. CGI:

options +ExecCGI

MIME
.
CGI , ScriptAlias, Set Handler
AddHandler. Options. ,

< D irectory / usr/ local/ cgi bin >
Options + ExecCGI
<D irectory>

CGI , /usr/local/
cgi bin. "+ ", ExecCGI, ,
ExecCGI.
"+" , ExecCGI
, .
, , ,
, , ( )
CGI . .

9.4.4. :
ScriptAlias
ScriptAlias mod_alias.
Alias, ,
DocumentRoot. Alias
, ScriptAlias .
ServerRoot /opt/apache.
CGI cgi bin.
CGI
.
ScriptAlias / cgi bin/ / usr/ local/ cgi bin/

/opt/apache/cgi bin

/ usr/ l ocal / cgi $bi n
, Apache , ,
, , .
Alias
SetHandler / AddHandler. , ,
CGI .

122

II. Web

9.4.5. :
Set Handl er
,
ScriptAlias, SetHandler
.
<Directory> <Location>, .htaccess.
Apache, , ,
. :
<D irectory / usr/ local/ cgi bin>
SetH andler cgi script
</Directory>

9.4.6. :
AddHandler
, Apache
. .
1, " ".
, , Apache,
.l . cgi CGI ,
(, , )
CGI , mod_cgi.
AddHandler cgi script .pl .cgi

9.4.7. MIME : AddType


, Apache MIME ,
. , , application/x
httpd cgi. , .pl.
MIME ,
AddType application/x httpd cgi .pl
MIME 1, " ".

9.4.8. CGI: ScriptLog


, CGI ,
. CGI .
mod_cgi ,
CGI , .
:
ScriptLog. , ,
CGI , . ,
.
, .
ScriptLog / var/ logs/ cgilog
ScriptLogBuffer. ,
PUT POST.
1024 .
ScriptLogBuffer 256

9. Web

123

ScriptLogLength. ,
.
. .
, , 10385760.
ScriptLogLength 20000000

9.5.
CGI ,
.

.
Apache .
, CGI.
RLimitCPU ,
CGI .
RLi mi t CPU

20

RLimitMEM ,
.
RLimitMEM

10000000

RLimitNPROC
, .
RLi mi t NPROC

9.5,1.

200

mod_perl

Perl, ,
,
HTML . CGI Perl.
, Perl,
mod_perl.
mod_perl, - (Doug MacEachern),
Perl,
Apache.
, Web Apache.
, 12, " ".
CGI ,
mod_perl, ,
httpd.
.
mod_perl CGI
, :
<Locat i on / perl >
Set Handl er peri $scri pt
Perl Handl er Apache: : Regi st ry
Opt i ons +ExecCGI
</ Locat i on>

124

II. Web$

9.6. FastC G I
CGI . CGI
httpd,
.
,
( , ).
FastCGI.
CGI ,
. , FastCGI FastCGI,
, FastCGI.

9.6.1. FastCGI
FastCGI http://www.fastcgi.com.
.
tar xvzf mod_fastcgi_X.X.X.tar.gz
httpd mod_f astcgi, , ,
/ sr/ modules/ fastcgi.
mv mod_fastcgi.X.X.X /opt/apache/src/modules/fastcgi
/opt/apache ./configure
:
activate module= / src/ modules/ fastcgi/ libfastcgi.a
Apache.
make

make

i nst al l

mod_fastcgi
(), .
apxs.
apxs mod_fastcgi.so *.
.
apxs i a n fastcgi mod_fastcgi.so
, httpd.conf .
LoadModule
libexec/mod_fastcgi.so
, ClearModuleList
AddModule mod_fastcgi:
AddModule mod_fastcgi.
FastCGI , (fastcgi
script) CGI (cgi script). ,
,
IfModule.
<IfModule mod_fastcgi.>
AddH andler fastcgi script .fcgi
</IfModule>

9. Web

125

FastCGI ,
.

FastCgiServer.
FastCgiServer / opt/ apache/ cgi bin/ handy.fcgi

FastCGI suexec,
.
, :
FastCgiSuexec on

9.6.2. :
FastCgiIpcDir
Apache FastCGI .
, .
.
, , /tmp/fcgi,
FastCgilpcDir .
FastCgilpcD ir / some/ directory

126

II. Web$

10


...
10.1.

127

10.2. Windows

130

10.1.

,
. ,
,
.
.

10.1.1. vmstat
vmstat (virtual memory status
) .
,
,
.
, .
. ,
, .

Unix vmstat. ,
Unix (
man) , :
procs
memory
swap
io system
r b w swpd free buff cache si so bi bo in cs us sy id
0 0 0 19076 8704 13940 30740 0 0 1
1 108 45 0 0 99

cpu

si so ,
/ / . ,
0, , , . ,
.

10.

127

,
.

10.1.2. httpd
, httpd
,
. , ,
httpd 1

, .
,
:
1. , .
2. ,

.
apaci . 2,
" Web Apache".
,
httpd ,
httpd,
.
.

10.1.3.
AAppaacchhee ,

.
. 10.1.
10.1. ,

startservers

httpd,
.
,
MaxSpareServers MinSpareServers.

MaxSpareServers


. , httpd,
,
httpd ,
.

MinSpareServers

MaxClients

128


, .
,
MinSpareServers. ,
256,
HARD_SERVER_LIMIT Apache.

II. Web$

. 10.1

MaxRequestsPerChild
.
( ) ,
.
(>1000)
( 0 ).

10.1.4. .htaccess
.htaccess Apache ,
.htaccess , ,
.
, , ,
.
.htaccess .
AllowOverride None
.htaccess
(<Directory> <Location>).
,
.

10.1.5. DNS

. .
,
. , IP .
.
,
. ,
DNS , ,
DNS .
,
, . 10.2.
10.2. ,

IP .

allow, deny
HostNameLookups

ProxyBlock, NoProxy, NoCache

off.

IP .

10.1.6.
: ,
. ,
, .
LogLevel

Er r or

10.

129

,
,
.

10.1.7.
ExtendedStatus mod_status on
Apache .
,
, .
.

10.1.8.
proxy
,

. proxy (. 6, "Proxy
") .

10.1.9. KeepAlives
Apache
HTTP . ,
.
. ,
, :
KeepAlive off # . .

10.1.10. CGI
Apache ,
CGI (RLimitCPU, RLimitMEM, RLimitNPROC).

9, " Web ".

10.1.11. :

mod_mmap_static
mod_mmap_static ,
Unix.
, MMapFile, Apache ,
. ,
.
. ,
CGI .
M M apFile / opt/ apache/ htdocs/ index.html

mod_mmap_static ,
.

10.2. Windows
, MaxClients StartServers,
Windows, ,
, .

130

II. Web


ThreadsPerChild, ,
Windows, .
ThreadsPerChild Windows
MaxClients, Unix.
128 , :
ThreadsPerChild 128

10.

131

11

...
11.1.
11.2.

132
mod_rewrite

11.3.

132

mod_rewrite

138

11.1.
mod_rewrite
, .

Apache, .
mod_rewrite,
:
AddM odule mod_rewrite.
LoadModule rewrite_module libexec/ m od_rewrite.so

mod_rewrite .
, Apache,
, , sendmail
. ,
mod_rewrite
. ,
.
, " ".

mod_rewrite .
, Directory Virtu alH o st,
I . .htaccess.

11.2. mod_rewrite
, mod_rewrite
, . ,
, , . 11.1,
mod_rewrite.
132

II. Web

11.1. mod_rewrite

Rew riteEng ine

/ URL

Rew riteRule

URL .

RewriteCond

,
URL.

11.2.1. mod_rewrite: RewriteEngine


RewriteEngine
URL. :
Rewri t eEngi ne

on

11.2.2. URL : RewriteRule


RewriteRule mod_rewrite .
. , ,
. ,
. RewriteRule :

RewriteRule pattern substitution [flag],


flag , . 11.2.
11.2. fla g RewriteRule

R , re d ire c t

F, fo rb id d en

HTTP 403 ().

G, gone
P, p roxy

HTTP 410 ( ).
proxy.
mod proxy.

L , la s t
N , n e xt

.
, ,
URL, ,
.

C , c hain

T=mtyp

MIME .

NS, nosubreq

QS A, qsappend

,
.

PT, p assthro ug h

mod_rew rite
( mod_alias).

11.

133


.
URL www.examplel.com. , ,
RewriteRule ,
RewriteEngine mod_rewrite.
11.1.
, mod_rewrite ( )

wvw.example1.com/obsolete

www.example1.com/newandimproved,

RewriteRule A/obsolete.html/newandimproved.cgi
11.2.
, ,
DocumentRoot, .

/apache_backup, :

Rewri t eRul e

^/ $

/ apache

backup

[R]

11.3.
,

www.examplel.com/~someguy
URL. ,
DocumentRoot /usr.

RewriteRule ^~ ( [ ^/ l+)/ ?(.* > /usr/$1/$2 [R]


: URL

www.examplel.com/usr/someguy

11.2.3. :
RewriteCond
RewriteCond .
Rewrit eRule ,
,
, RewriteRule.
RewriteCond
( "").
RewriteRule, RewriteCond
"", "OR".
RewriteCond :
RewriteCond testvar condpattern flag,
testvar , . 11.3.

134

II. Web

URL

. 11.1.

11.

135

11.3.

HTTP

HTTP_USER_AGENT

HTTP_REFERER
HTTP_COOKI E
HTTP_FORWARDED
HTTP_HOST
HTP_PROXY_CONNECTI ON
HTTP_ACCEPT

REMOTE_ADDR

REMOTE_HOST
REMOTE_USER
REMOTE_I DENT
REQUEST_METHOD
SCRI PT_FI LENAME
PATH_I NFO
QUERY_STRI NG
AUTH_TYPE

DOCUMENT_ROOT

SERVER_ADMI N
SERVER_NAME
SERVER_ADDR
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE

TIME_YEAR

TI
TI
TI
TI
TI
TI
TI

ME_MON
ME_DAY
ME_HOUR
ME_MI N
ME_SEC
ME_WDAY
ME

API_VERSION

THE_REQUEST
REQUEST_URI
REQUEST_FI LENAME
I S SUBREQ

condpattern , testvar. . 11.4 .


11.4.

"!" () ,
.
<CondPattern

"",
, Condpattern.

>CondPattern

"",
, Condpattern.

136

II. Web

. 11.4

=CondPattern

"",
.

"",
.

"",
, 0.

"",
.

"",
, .

, .

"",
URL.

, CondPattern:
nocase I NC

ornext | OR

"".

11.4.
, SERVERPORT 443.
RewriteCond S ERVERPORT = 443

11.5.
, SERVERPORT 443 80.
RewriteRule , "".

Rewr i t eCond

SERVERPORT

=443

Rewr i t eCond

SERVERPORT

=80

OR

11.6.
, SERVERPORT 443 ,
REMOTEHOST badguy, RewriteRule
, "".

Rewr i t eCond
Rewri t eCond

11.

SERVERPORT
REMOTEHOST

=443
! badguy

137

11.3. mod_rewrite
mod_rewrite
.
mod_rewrite ,
.
URL. , mod_rewrite

( RewriteLog RewriteLogLevel).
,
(RewriteOptions). , URL
(RewriteBase).

11.3.1. : RewriteMap
RewriteMap ,
, ,
RewriteRule.
RewriteMap RewriteRule
. RewriteMap :
RewriteMap MapName :M apSource
MapName
RewriteRule. MapName
:
${MapName : LookupKey }
${MapName : LookupKey | DefaultValue}

LookupKey
, MapName.

MapSource :





txt

/path/to/map/file

,
,

longdata abbreviation,
:
##

##

mapl . t xt

rewri t i ng map

##

Ral f . S. Engel schal l


Mr. Joe. Average

138

rse

j oe

II. Web

11.7.
, /opt/apache/maps/map1.txt. ,
:

Rewr i t eMap r eal t ouser

t xt :

/ opt / apache/ maps/ mapl . t xt

rnd
/ path/ to/ unix/ file

, , ,
www1 | www2 | www3 | www4,
"|" , ( www3).
proxy .
11.8.
, . txt. :
##

## map2. t xt
##

st at i c
dynami c

r ewr i t i ng

.,

map

wwwl | www2| www3| www4


www5| www6

/opt/apache/maps, :

RewriteM ap servers rnd:/ opt/ apache/ maps/ map2.txt


$

dbm

/ path/ to/ unix/ file

NDBM,
(. ), .
11.9.
NDBM, /opt/apache/maps/map3.ndbm.

Rewr i t eMap

qui ck_ser ver s

dbm: / opt / apache/ maps/ m. ndbm

int
Apache

Apache. , , . 11.5.

11.

139

11.5.

toupper

tolower

escape

unescape

11.10.
, URL .
:
Rewr i t eMap

l ease

i nt : t ol ower

prg

/ path/ to/ executable/ file

.
. Apache.

11.11.
, URL.
Perl funky.pl /usr/bin. :
Rewr i t eMap

f unky

pr g: / usr / bi n/ f unky. pl

11.12.
,
URL
d is t.tx t, , "" "f" ,
, "" "I" , . /etc.
RewriteMap ,
d istrib u te d :

RewriteM ap d istribu ted t x t :/ et c / d i st .t x t


RewriteRule.
RewriteRule ^ / ( . ) { . * ) ${distributed:$1|www.default.com}$1 $2 [R,L ]
"." $1, ".*"
. , dis
trib uted , . , ,
www.default.com. , .

11.3.2. :

Rewri t eLog,

Rewri t eLogLevel

mod_rewrite
. .
140

II. Web$

, RewriteLog,
.
RewriteL og / var/ logs/ rewr itelog

, 0 (
) 9 ( ).
RewriteLogLevel.
RewriteLogLevel 3

11.3.3. : RewriteOptions
RewriteOptions
,

(, ).
, :
R ewriteO ptions inherit

11.3.4. : RewriteBase
,
( .htaccess),
, .
RewriteBase / some/ other/ path

11.

141

12

...
12.1.

142

12.2. mod_perl

143

12.3. Apache API

146

12.4.

146

12.5. Perl API


12.6.
12.7.

148
149
150

12.1.
, Apache,
,
. Apache API
(Application Programmer Interface ).
.
,
.
, ,
.
, Apache.
Apache
, , Writing Apache Modules
with Perl and , (Lincoln Stein)
(Doug MacEachem).
, , ,
. , ,
mod_perl (
), Perl.
, , ,
Perl .

12.1.1. m od_perl
Apache
. 1996 mod_perl,
Perl,
Apache. mod_perl

142

II. Web$


API. , , Perl,
,
, . ,

,
Perl.

12.2. mod_perl
mod_perl ,
http://perl.apache.org.
.
. .
tar zxvf mod_perl X.XX.tar.gz
mod_perl X.XX. .
cd mod_perl X.XX
Makefile. PL,
Makefile, .
, ,
, .
. 12.1
12.1. M akefile.pl

ADD MODULE

.
httpd.
ADD_MODULE=proxy,info

APACHE_PREFIX Apache.
APACHE_PREFIX=/opt/apache.
APACHE

, Apache.

SRC

APACHE_SRC= / opt/ apache/ src

APACI_ARGS

,
Apache. ,
.
APACI _ARGS="$enabl e$modul e=ssl ,
ssl =/ opt / openssl $0. 9. 5. "

DO_HTTPD

$wi t h$


.
DO_HTTPD=1

DYNAMIC


Apache:: * API .
DYNAMIC=1

12.

143

. 12.1

EVERYTHING

mod_perl
Apache.
EVERYTHI NG=1

PERL_DEBUG

mod_perl
. PERL_DEBG=1

PERL_DESTRUCT_
LEVEL

mod_perl

. 1 2.
PERL_DESTRUCT_LEVEL=1

PERL_TRACE

mod_perl .

PERL_TRACE=1
PREP_HTTPD


httpd. ,

Perl.
PREP_HTTPD=1
SSL_BASE

mod_perl ,
SSL,
SSL.
SSL _BASE= / opt;openssl 0.9.5.

USE_APACI

src/configuration
Apache.
USE_APACI=1

USE APXS

mod_perl ,
s.
.
USE_APXS=1

USE_DSO

mod_perl ,
.
USE_DSO=1

WITH_APXS


APache extension. ,

Apache.
WITH

APXS=some/directory/path

. M akefile. PL Apache
. 12.2.

144

II. Web$

12.2. M akefile.pl

Makefile.pl

Apache

PERL_DI SPATCH=1
PERL_CHI LD_I NI T=1
PERL_CHI LD_EXI T=1
PERL_I NI T=1
PERL_POST_READ_REQUEST=1

Per l Di spat chHandl er


Perl Chi l dl n i t Handl er
Per l Chi l dExi t Handl er
Per l I ni t Handl er
Per l Post ReadRequest Handl er

PERL_TRANS=1

Per l Tr ansHandl er

PERL_HEADER_PARSER=1

Per l Header Par ser Handl er

PERL_ACCESS=1

Per l AccessHandl er

PERL_AUTHEN=1

Per l Aut henHandl er

PERL_AUTHZ=1

Perl Aut hzHandl er

PERL_TYPE=1

Per l TypeHandl er

PERL_FI XUP=1

Per l Fi xupHandl er

PERL_HANDLER=1

Per l Handl er

PERL_LOG=1

Per l LogHandl er

PERL_CLEANUP=1

Per l Cl eanupHandl er

12.2.1. m od_perl
, Makefile. PL
. .
, Make
file. PL. httpd mod_perl
, Makefile:
p erl M akefile.PL \
PREFIX= / opt/ apache \
APACHE_PREFIX=/opt/apache \
APACHE_SRC= /opt/apache/src \
DO_HTTPD=1 \
EVERYTHING=1

httpd,
make

.
httpd mod_ssl .
httpd, mod_perl,
,
mod_perl .
per l Makef i l e. PL \
USE_APXS=1
WI TH_APXS=/ opt / apache/ bi n/ apxs

EVERYTHI NG=1
12.

145

make libexec. so,


make

i nst al l

httpd.conf ,
libexec.
.

12.3. Apache API


Apache .
Apache , .
:
.
.
.
IM .
.
.

mod_perl. Apache
request_rec ($r). , " mod_perl API"
, mod_perl.

12.4.
, mod_perl,
Apache. ,
, , ,
.

12.4.1. Perl
Apache , .
mod_perl ServerRoot lib/perl,
ServerRoot. , , lib/ perl,
, ServerRoot .
, PERL5LIB
PerlSetEnv.
PerlSetEnv PERL5LIB / some/ other/ location

,
Apache::, Apache ,
.
mkdir / opt/ apache/ lib/ perl/ Apache

, Perl
( .pl).
#! / usr/ bi n/ perl
BEGI N

use Apache();
use l i b Apache$>server_root _rel at i ve (' l i b/perl ' );
}

1;
146

II. Web$

PerlRequire:

PerlRequire conf/setup.pl
12.4.2.

.
, , " mod_perl API"
, , , ,
.
:
( get_server_port ())
( get_remote_host () ).
POST ( read ()).
( print ()).
HTTP ( header_out ()).
( log error ()).

12.4.3.
, , <Location>.
HTML .
1.
package Apache: : Basi cModul e;
2.
use Apache: : Const ant s qw(OK);
3.

4.
5.
6.
7.
8.

9.
10.
11.
12.

13.

sub handl er

my $req_obj =shi f t ;
$req_obj $>cont ent _t ype(' t ext / ht ml ' ) ;
$req_obj $>send_ht t p_header;
$req_obj $>pri nt (
" <HTMLXHEAD>" ,

"<TI TLE> Basi c


"</ HEADXBODY>"
,
"<H1> Thi s i s

Handl er

</ TI TLE>",

handl er. </ Hl >",

t est

"</BODYX/HTML>") ;

return OK ;

14. }
15. 1;

1 ,
Apache. 2 Apache::Constants,
, , ..
3 , , handler.
Apache <Location>,
. 4 ,
, $req_obj.
5 MIME text/html, 6
send_http_header () http. 1 12
print HTML
.

12.

147

12.4.4.

perl demo.
<Location /perl demo>
SetH andler perl script
PerlHandler Apache::BasicHandler
</Location>
<Location> Apache , /perl demo
. SetHandler Apache
mod_perl ,
. , PerlHandler mod_perl , ,
, BasicHandler.
perl demo, ,
. 12.1.

. 12.1.

12.5. Perl API


, 12.3,
Perl API.
12.3. Perl API

PerlFreshRestart

PerlModule

PerlRequire

,
mod_perl, %INC
.
Perl FreshRest art on
@INC .m,
, , .
PerlModule Apache::BasicHandler
Perl PerlModule.

.
PerlRequire
/opt/apache/lib/perl/Apache/BasicHandler.pm

148

II. Web$

12.6.
. 12.4 ,
Apache.
( Apache::BasicHandler).
12.4.

PerlchildinitHandler

,

.

PerlPostReadRequestHandler

PerlinitHandler

,

Apache .

,
HTTP.

PerlTransHandler

,
URL,

, .

PerlHeaderParserHandler

URL.

,
URL (

<Directory>, <Location> ).

PerlAccessHandler

,

.

PerlAuthenHandler

,

.

PerlAuthzHandler

,
,
.

PerlTypeHandler

PerlFixupHandler

,

MIME.

,

( PerlTypeHandler)

( PerlHandler).
,
.

PerlHandler

,
.

Perl.

12.

149

. 12.4

PerLogHandler

,
. ,
, ,
, ,
Apache
, ,
, .

PerlcleanupHandler

,

,
.

PerlchildExitHandler

,

.

12.7.
mod_perl
. ,
, httpd
httpd .
.

, mod_perl,
, mod_perl, ,
, mod_perl . ,
mod_perl, .
,
,
IP .
. BindAddress ,
, mod_perl, ,
IP , , mod_perl, ,
IP .

150

II. Web$

III

...
1.
2.
3.

13

...
13.1.

152

13.2.

152

13.3.
13.4. ,
13.5. SET

153
153
154

13.1.
,
.
,
.

13.2.

. Internet
, Visa
. ,
Internet, .
,
SSL (Secure Sockets Layer).
8, "".
,
. SSL Web
,
.

13.2.1.
,
ISO 2894.
:
1. .
2.
1.

1 2.
2. .
3. , 9, 9.
4. , 10.
.

. , .
,
, ,
,
. ,
.
,
, .

13.3.
" " ( Auto
mated Clearing House)
. .
,
1
.
.
(, ..),
. , ,
, .
.

13.4. ,

,
. ,
,

.

13.4.1. e Cash
e Cash ,
,
e Cash .

.
e Cash Visa.
.

, .
,
.
1

13.

153

13.4.2. CyberCash
,
, CyberCash.
Web,
Merchant Connection Kit (MCK).
Perl.

(Cash Register).
(CashRegister)
. ,
CyberCash CashRegister.
CyberCash ,
CyberCash .
CyberCash , .
,
.
,
, .
, , .
,
CyberCash.
, .
, ,
,
Internet.
CyberCash, ,
.

http ://www. cybercash .com.

13.5. SET
SET (Secure Electronic Transaction
) Visa MasterCard.
, ,
, .
, .
, Web ,
, ,
.
SET ,
.
. SET
:
, Visa MasterCard.
.
,
SET.
SET ,
.

154

III.

SET, SET ,
. . ,
,
. , SET
, , .

13.

155

14


...
14.1.

156

14.2.

156

14.3. ,

158

14.4

162

14.1.

.
, ..
Apache
. (mod_auth_dbm, mod_auth_db
..) ,
. ,
, .

.
.

14.2.
,
, . ,

.
,
. ,
,
, .
.

156

III.

14.2.1. MySQL
MySQL ,
Unix Win32/NT.

. MySQL
. MySQL
, .
, ,
MySQL ,

, .
200 .
.
,
. ,
MySQL Web .
"MySQL",
"c".
MySQL
, , , commit rollback
. , ,
. COMMIT ROLLBACK
,
,
. , , ,
.
LOCK TABLE, ,
COMMIT ROLLBACK,

.
MySQL Web
http://www.mysql.com, .

14.2.2. Oracle
Oracle .
Oracle

. Oracle
. , , Oracle
.
Oracle ,
.
: Oracle Oracle 8i
Linux .

14.2.3. Informix
Informix ,
Linux. Informix
, Internet
. Informix
Oracle.
.
http://www.infomux.com.
, , , MySQL

ec_example .

14.

157

14.3. ,
, .
.
Internet. : CGI
, Apache .

14.3.1. CGI
mod_perl Perl DBI
CGI , ,
.

,
. mod_perl
, .
12, " ".

14.3.2. PerlDBI
CGI
. .
, .
.
Apache::DBI mod_perl
. , , mod_perl
Perl DBI ,
.
http://www.perl.com.
httpd.conf
Apache::DBI
PerlModule::DBI

use Apache::DBI();

Perl. ,
mod_perl, .
Perl DBI ,
.
,
.
SQL (,
COMMIT ROLLBACK Oracle MySQL).

14.3.3.
Perl DBI
.
Perl DBI . DBl >connect
,
httpd,
$dbh = DBI >CONNECT($datasource, $username, $password),

158

III.

datasource
dbi:database_type:database_nam e,
username password, .
.
$qry = $dbh >prepare ("SELECT fi eld l, field2 FROM some_table")
, ,
$qry >execute ();

. 14.1. Perl DBI Apache


,
BasicHandler.pm, 12,
" ".
package Apache::BasicH andler;
use Apache::Constants qw(OK );
use Apache::DBI(OK) ;

sub handler {
my $req_obj= shift;
$req_obj > content_type('text/ htm l');
$req_obj >send_http_header;
$req_obj >print(
"<HTML><HEAD><TITLE>",

" Perl DBI </TITLE></HEAD>",


"<BODY><H1> MySQL",

" perl D BI </Hl>",


my $dbh = D BI >CON N ECT("dbi:mysql:ec_example", "httpd", " ")
or die " MySQL\n";
my $qry = $dbh >prepare ("SELECT * FROM ccard ")

14.

159

or

di e

"

SQL$\ n";

$qry$>execut e();

or

di e

"

my @row
whi l e (@row
{

$reg_obj

SQL$onepaTop\ n";

$qry$>f et chrow_array())

$>

pri nt ("@row

<BR>");

$req_obj $>pri nt
ret urn

("</ BODY></ HTML>") ;

OK;

}
I;

DBI
>connect, $dbh.
, , , print
, , . 14.2.

. 14.2. Perl DBI

14.3.4. ColdFusion
ColdFusion ,

, .
ColdFusion
ColdFusion Studio, Web ,
.

"" , Visual Basic.
. 14.3.

160

III.

. 14.3. ColdFusion Studio


ColdFusion
, . ,
( 20 ColdFusion Studio
Windows):
<ht ml >
<head>
<t i t l e>CREDI T CARD I NFO. </ t i t l e>
<met a name="GENERATOR" cont ent ="Mi crosof t Fr ont page 3. 0">
</ head>
<body>
<cf par am name="i d" def aul t ="99">
<cf quer y name= "cri nf o_al l "
dat asour ce = "vansys">
sel ect * f rom ccar d
</ cf query>
<cf quer y name= "cri nf o_one"
dat asour ce = "vansys">
sel ect * f r om ccar d
wher e cust i d = ' #i d#'
</ cf guery>
<cf f or m name="cri nf o" met hod="post " act i on="ccard. cf m">
<t abl e bor der =l cel l paddi ng=l cel l spaci ng=l >
<t r>
<td bgcolor=f0f0f0> <b><i>S.No</i></b></td>
<td bgcolor=f0f0f0> <b><i>Customer Id</i></b></td>
14.

161

<t d bgcol or =f 0f 0f 0> <bxi >Cust omer Name</ i ></ b></ t d>
<t d bgcol or =f 0f 0f 0> <bxi >Car d Type</ i ></ b></ t d>
<t d bgcol or =f 0f 0f 0> <bxi >Car d Number </ i ></ b></ t d>
<t d bgcol or =f 0f 0f 0> <bxi >Expi r y Dat e</ i ></ b></ t d>
</ t r>
<cf out put quer y=" cr i nf o_al l " st ar t r ow="l "
maxr ows= "#cri nf o_al l . Recor dCount t " >
<t r>
<t d val i gn=t op> #cri nf o_al l . Current Row#</ t d>
<t d val i gn=t op> <a
href ="ccard. cf m?i d=#cri nf o_al l . cust i d#">
I cri nf o_al l . cust i dt l
</ a><7t d>
<t d val i gn=t op> #cri nf o_al l . cust name#</ t d>
<t d val i gn=t op> f cri nf o_al l . cardt ype#</ t d>
<t d val i gn=t op> f cri nf o_al l . cardno#</ t d>
<t d val i gn=t op> #cri nf o_al l . cardexpdat et t </ t d>
</ cf out put >
</ t r>
</ t abl e>
<br xbr ><br >
<p>CUSTOMER

DETAI LS</ p>

<cf out put >


<p>Name <i nput
t ype="t ext " name="Tl " si ze="20" val ue="#cr i nf o_one. cust name#"> I
D.
<i nput
t ype="t ext " name="T2" si ze="6" val ue="#cr i nf o_one. cust i d#"></ p>
<p>&nbsp; </ p>
<p>CREDI T CARD
<p>Type <i nput

t ype="t ext "


ype#"><br>
Num.
<i nput
t ype="t ext "
>

DETAI LS</ p>

name="T3"

si ze="20"

val ue="#cri nf o_one. cardt

name="T4"

si ze="20"

val ue=

t ype="t ext " name="T5"


et
"></ p>
</ cf out put >
</ cf f orm>

si ze="20"

val ue="

"#cr i nf o_one. car dnol "

Exp<i nput

#cr i nf o_one. car dexpdat

</ body>

</ ht ml >
, ColdFusion Windows.
,
ColdFusion, Red Hat Linux.
, Unix. ColdFusion
Linux, Red Hat. ColdFusion http://www.allaire.com.

14.4
Personal Hypertext Preprocessor . ,
.
. :
(Rasmus Lerdorf) ,
, .
162

III.

14.4.1.
4,
http://www.php.com.
Unix :

tar xvzf php 4.0.112.tar.gz


Apache, ,
makefile. ,
, Apache.

./configure

with apache=/opt/apache

./configure

with apxs=/opt/apache/bin/apxs

(mod_perl, mod_ssl)
,
. , MySQL,

with mysql,
.

with mysql=/path/to/mysql
make

( httpd).
make

make

i nst al l

make install httpd. conf ,


.
php (
.php .phps) MIME .

Addtype application/x httpd php .php


Addtype application/x httpd php .phps
: .

14.4.2.
CGI
.
, ,
. , ,
, SQL
.html
. ,
, SQL.
<HTML>
<HEAD>

<TI TLE><B>PHP
</ HEAD>

Exampl e

Page</ Bx/ TI TLE>

<BODY>

<H1>
<H2>
<2>

PHP </ Hl >


,
</2>
PHP$ MySQL.
</ H2>

<?
14.

163

$mysql _handl e = mysql _connect ( " l ocal host " , "ht t pd", " "} or di e
(" " ) ;
mysql _sel ect _db ("ec_exampl e") or di e("
") ;
$query = "SELECT * FROM ccard";
$result = mysql_query ($query) or die("3anpoc ");
for ($i= 0; $i <= mysql_num_rows($result) 1; $i+ + )
{

if

(!mysql_data_seek($result,$i))
{

printf (" %d\n", $ i ) ;


continue;
}

if (! ($row= mysql_fetch_object($result) ) )
continue;
printf ("%s %s %s %s <BR>\n", $row >type, $row >name, $row
>number, $row >expires);
}

m ysql_free_result($result);
?>
</BODY> </HTML>

mysql_connect () , . httpd. . ,
mysql_num_rows($result).
mysql_fetch_object(). . 14.4.

. 14.4.

14.4.3.
. , INSERT, (. ):
$query = "INSERT INTO some_table VALUES ( 'a', 'b', 'c', 'd', 'd ') " ;

164

III.

,
, , .
, mysql_query () .
$order = mysql_query($query);


.
,
.
if (!(mysql_query ($query))) die (" .");

14.4.4.
Perl ,
. ColdFusion,
. , Perl
, ColdFusion .
ColdFusion , .
.
, ColdFusion. ,
.
ColdFusion .
, .. HTML .
ColdFusion
Web .
Cold Fusion (
). ColdFusion
. , Perl, ,
, .

14.

165

15

...
15.1.

166

15.2.

167

15.3.

168

15.4.

172

15.1.

, .
Internet
.
Apache. , .
,
Internet .
,
. ,
SQL , .

. Web .
:

.
,
, .
,
.
.
,
HTML . ,
Web
.
HTML Apache,
mod_php MySQL. ,
, :

166

III.

,
, .
Web .
.
.

( Stronghold, ColdFusion).
,
. , ,
:
Apache.
mod_php.
MySQL.
openSSL mod_ssl.
(. 8, ""), ,
, CD ROM.

15.2.
Web . ,
, .
, . ,
,
.
, . ,
.

15.2.1.
.
cart_num line_num (
" ").
Web
shopping_cart ( ,
" ") , .
, .
1) line_num = 0 2) inventory_num = 0.

15.2.2.
.
order_master .
(customer)
(address) .

order_detail. , ,
, order_detail order_master
. ,
.
, , .

15.

167

15.3.

,
: . ,
, ,
. , .

15.3.1.
, ,
.
,
. ,
.
. , .
Address. :
addrt attn : street city state zip

,
(, street ,
),
( ).
, :
CREATE TABLE address
(

addr_id INT UNSIGNED NOT NUL AUTO_INCREMENT PRIMARY KEY,


attn VARCHAR(30),
#
streetl VARCHAR(30) NOT NULL, #
street2 VARCHAR(30),
#
city VARCHAR(20) NOT NULL,
#
state CHAR(2) NOT NULL,
#
zip VARCHAR(10) NOT NULL,
#
}

15.3.2. 1:
,
, .
, .
order# addr#
. ,
Web ,
. ,
, ,
. .

1
, . , ISBN
, ,
. ,
.

168

III.

, ,
. , ,
, ("Sony",
"Pioneer") (VX132, QZX820).
. , , "Sony",
"Pioneer" . ,
, , .
,
.
. , , order
order# .
.
, .

15.3.3.
order ():
cust #

shi pt o

bi l l t o


. cust# ,
( ), shipto billto
, Address. ,
, .
cust#, order,
customer, .. , 12345 .
shipto billto address ,
123 4th St. (. 4, . 123),
345 6th St (. 6, . 345) ..
, , ,
, , .

15.3.4. 2:
,
, ,
,
.
,
.
7 (INF, 2NF, 3NF,
Codd NF, 4NF, PJ/NF). , , ,
.

. , ,
.
,
.
(order), ,

. ,
. , ,
, (, , ,

15.

169

, ), , ,
(, ,
, , ..).
, , ,

,
. ,
. ,

.
,
. ,
, ,
,
.
, , , ,
, .
,
. ,
.
:
. ,
, ,
.
.
, ; ..
, . , ,
address,
, , , ,
, .
.
,
, (
). ,
, .. ,
, . ,
,
,
.

" ", 7, . . ,
.
, ( ),
:
CREATE TABLE ccar d
(

card_i d I NT UNSI GNED NOT NULL AUTO_I NCREMENT PRI MARY KEY,
cust _i d I NT NOT NULL, #
t ype
VARCHAR(20) NOT NULL,# Vi sa,
Mast erCard,
...
name
VARCHAR(40) NOT NULL, #
number
VARCHAR(20) NOT NULL, #

170

III.

expi res

#
#

dat e

NOT

NULL#

CREATE

TABLE

.
,
,

check

(
check_i d I NT UNSI GNED NOT NULL AUTO_I NCREMENT
cust _i d
I NT, #
check_num
SMALLI NT NOT NULL, #
name
VARCHAR (20) , #
rout i ng_num CHAR(12), # ($
acct _num
CHAR(12)#

PRI MARY

KEY,

)
CREATE

TABLE

cust omer

(
cust _i d
I NT UNSI GNED NOT NULL AUTO_I NCREMENT PRI MARY
f i rst _name VARCHAR (15) NOT NULL,
I

mi ddl el l
VARCHAR (15),#
l ast _name VARCHAR(I S) NOT NULL, !

t i t l e
VARCHAR(4), # Mr ,
Mrs,
Dr.
suf f i x
VARCHAR(5)# Ph. D. ,
Jr. ,
I l l ,

KEY,

)
# order_num + l i ne_num
CREATE TABLE order_l i ne

$$>

(
order_num I NT UNSI GNED NOT NULL, #
l i ne_num
SMALLI NT NOT NULL, # $
quant i t y
SMALLI NT NOT NULL, #
i nvent ory_num I NT UNSI GNED NOT NULL, #
pri ce
DOUBLE NOT NULL#

)
CREATE

TABLE

or der _nast er

(
order_num
cust _i d
shi pt o
bi l l t o

I NT UNSI GNED NOT NULL AUTO_I NCREMENT PRI MARY KEY,


I NT UNSI GNED NOT NULL, # cust omer
I NT UNSI GNED NOT NULL, # address
I NT UNSI GNED NOT NULL, # address
( ,
shi pt o)
ordered DATE NOT NULL,
#
pai d DATE NOT NULL,
#
shi pped DATE NOT NULL,
#
prot ot ype SMALLI NT NOT NULL,
I
0 = He ,
1 =
,
2
# = ,
. . . (?)
check I NT,
# check
ccard I NT # ccard

)
CREATE

TABLE

product

(
i nvent or y_num I NT UNSI GNED NOT NULL AUTO_I NCREMENT PRI MARY KEY,
product _num VARCHAR(20) NOT NULL, #
manuf act urer VARCHAR(20),
# (Sony,
Ford,
. . . )
name
VARCHAR (20) NOT NULL,
# (
15.

171

# )
descri pt i on VARCHAR(80) NOT NULL,
#
#
cat egory VARCHAR(I O) NOT NULL,
# .
,
subcat l
VARCHAR (10),
# 1 .
.
subcat 2 VARCHAR(I O),
# 2 .
.
t he_hype TEXT,
#
#

ads

i mage
i n_st ock
pri ce
)

VARCHAR(255) ,
#
I NT UNSI GNED NOT NULL,
#
DOUBLE #

15.3.5.
,
, ,
. , , ,
.
,
.
.
,
. ,
. ,
,
. ,
: " .
, ."

.
. ,
,
. ,
,
.

15.4.

. ( ) ,
.
,
, . Web
, . 15.1.
15.1. , Web

index.php
catalog.php

172

.
,
Internet , .

III.

. 15.1

result.php
item.php
cart.php

.
(
).
/ .

checkout. php , .
mk_order. php .
,
.
Web , .
, . .
, ,
.
, , , : shawkins@synthesis
software.com. Web .
http://www.synthesis sofrware.com/apachejbook/updates.

15.4.1. index.php
index. php : Search,
Catalog, View/Modify, Cart Checkout. . 15.1.

. 15.1. index.php
, cart_num.
cart_num shopping_cart.
.
, .

if($cart_num == "")
{

15.

173

$mysql _handl e = mysql _pconnect ( "l ocal host ",


"ht t pd", "") or
di e(" ");
mysql _sel ect _db("ecom") or di e(" ") ;
$resul t
= mysql _query("SELECT MAX(cart _num) AS maxi mum FROM cart
")
or di e(" cart _num"};
i f (! ($row=mysql _f et ch_obj ect ($resul t ))) di e("
cart _num");
$cart_num = $row >maximum + I;
mysql_free_result($result);
}

, mysql_connect
mysql_pconnect.
.
cart_num :
print("<TD><A HREF=\"catalog.php?cart_num=$cart_num\");
cart_num=$cart_num HREF , $cart_num, ( catalog, php) cart_num. , var iable=$value
, "&".
, - . , , , ,
cart_num .

15.4.2. catalog.php
HTML-,
product. . 15.2,
item.php, .

. 15.2.

174

III.

FOR, product, . , ( item). ,


:
# , .
$query = " SELECT inventory_num, product_num, name, category,
description, price FROM product ORDER BY category";
$result = mysql_query ($query) or die("O ");
$cnt = mysql_num_rows ($result);
for ($j=0; $j <= mysql_num_rows ($result) 1 ; $j++ )
{

if ( !mysql_data_seek($result, $ j ) )
{

pri nt f (" %d\ n",


cont i nue;

$j );

i f ( ! ($row=mysql _f et ch_obj ect ($resul t )))


cont i nue;
i f
( $current _cat egory ! = $row$>cat egory)
{

$current_category=$row >category;
printf ( "<BR><B>Ka: %s
</BXBR>\n" ,
$row >category);
}

print("<A HREF=\" item.php?inv_num=$row >inventory_num&cart_num=

$cart_num\ "> <B>$row >name</Bx/A>") ;


printf(" %s <>: </>
$%4.2f <BR> " ,
$row >description,
$row >price);
}

15.4.3. result.php
result.php .
Search. , . 15.3.

. 15.3.
15.

175

$cart_num ( )
$srch_str, ,
, Search.
strtok()
$srch_str , .

$token= strtok($srch_str,"

");

strtok () .
$token=strtok("
"); # ,

if($srch_str=="")
{

$where_cl ause="

WHERE

1=0" ;

where,
, , .

while ($token)
{

if($where_clause =="")# 1
{

$where_cl ause="
el se

WHERE name LI KE

' %$t oken%'

";

$where_cl ause="

$where_cl ause OR name LI KE

' %$t oken%'

$where_clause=" $where_clause OR category LIKE '%$token%' ";


$where_clause=" $where_clause OR subcatl LIKE '%$token%' ";
$where_clause=" $where_clause OR subcat2 LIKE '%$token%' ";
$where_clause=" $where_clause OR the_hype LIKE '%$token%' ";

$token=strtok ( "

" };

where_clause
. ,
. ,
, the the_hype, .

15.4.4. item.php
, item .
,
.
, , . 15.4.

result.php catalog.php,

, $inv_num,
inventory_num product.
where_clause,
product.

$where_clause="

WHERE

inventory_num = '$inv_num' ";

, . 15.4, ,
. .

176

III.

";

item, ,
, .

if(file_exists("$row >image"))
{

print("<IMG SRC=\"$row >image\" ALIGN=\"LEFT\ " HSPACE=\"30\"


VSPACE=\"40\" >");
}

, , .

. 15.4. "Item"

15.4.5. cart.php
cart.php
, .
. . 15.5.
. .
,
$new_item. , .
, , .
,
,

$line_num. cart
cart_num, line_num new_item (, new_item
product).

15.

177

. 15.5. " "


line_num (,
),
, .
i f ( $new_i t em ! = " "}
{

$resul t

= mysql _query("SELECT MAX(l i ne_num) AS maxi mum FROM cart


WHERE car t _num =
' $cart _num' ")
or di e("
l i ne_num");

i f (! ($row=mysql _f et ch_obj ect ($resul t )))


di e(" l i ne_num");
$l i ne_num=$row$>maxi mum + 1;
$query

"I NSERT

I NTO

cart

VALUES

(' $cart _num' , ' $l i ne_num' , ' ' , ' $new_i t em' , ' ' )";
$resul t = mysql _quer y( $quer y)
or di e(" . ");
i f ($l i ne_num==l )
{

r esul t

= mysql _quer y( "DELETE FROM cart WHERE


cart _num=' $cart _num'
AND l i ne_num=' 0' ")
or pri nt ("Error:
.
<BR>\ n");
}

, (
),
.

15.4.6. checkout.php
checkout.
. 15.6, .

178

III.

. 15.6. "Checkout"
checkout.php , . , cart, $cart_num.
.
(, , , , ), Send,
.
($name, $streetl, $street2) mk_order.
print("<FORM ACTION=\ "mk_order .php?cart_num=$cart_num\ " METHOD=\ "
POST\ ">" );

pr i nt ( "<B> Ti t l e <B> (Dr. ,


Mr s. , Mr . ,
. . . ) <BR>");
pr i nt
("<I NPUT TYPE=\ "TEXT\ " NAME=\ "t i t l e\ " MAXLENGTH=\ "4\"
SI ZE=\ "4\ "
><BR>");
pr i nt
("<B> Fi r st
Name <BXBR>");
pr i nt
(
"<I NPUT TYPE=\ "TEXT\ " NAME=\ " f i rst _name\ "
MAXLENGTH=\ " 15\ "
SI ZE=\ "15\ " ><BR>" );
pr i nt
("<B> Mi ddl e I ni t i al
<BXBR>"};
pr i nt
("<I NPUT TYPE=\ "TEXT\ " NAME=\
"mi ddl e\
" MAXLENGTH=\
"
15\
"
SI ZE=\ "15\ " ><BR>" );
pr i nt
("<B> Last
Name <BXBR>");
pr i nt ("<I NPUT TYPE=\ "TEXT\ " NAME=\ " l ast _name\ " MAXLENGTH=\ " 15\
"
SI ZE=\ "15\ "
><BR>");
pri nt ("<B> Suf f i x <B> (Jr. ,
I l l ,
. . . ) <BR>");
pr i nt
("<I NPUT TYPE=\ "TEXT\ " NAME=\
" suf f i xN " MAXLENGTH=\
"
5\
"
SI ZE=\ "5\ " ><BR>");
pr i nt
("<B> St reet
<BXBR>");
pri nt
("<I NPUT TYPE=\ "TEXT\ " NAME=\ " st r eet l V " MAXLENGTH= \ "
30 \ "
SI ZE=\ "30\ " ><BR>");
pri nt
("<B> St reet
2 <B><BR>");
pri nt
("<I NPUT TYPE=\ "TEXT\ " NAME=\ " st reet 2\ " MAXLENGTH=\ " 30\
"
15.

179

SI
pr
pr
"
SI
pr
pr
"

ZE=\ "30\ " ><BR>") ;


i nt
("<B> Ci t y <BXBR>");
i nt
( "<I NPUT TYPE=\ "TEXT\ " NAME=\
ZE=\ "20\ " ><BR>") ;
i nt
("<B> St at e <B><BR>");
i nt
("<I NPUT TYPE=\ "TEXT\ "

"

NAME=\

ci t y\

"

"

MAXLENGTH=\

st at e\

"

"

20\

MAXLENGTH=\

"2\

SI ZE=\ "2\ "


><BR>");
pr i nt
pr i nt
><BR>");
pr i nt

("<B> Zi p <BXBR>");
( "<I NPUT TYPE=\ "TEXT\ " NAME=\ "zi p\ "
SI ZE=\ "10\ "
("<I NPUT TYPE=\ "SUBMI T\ " NAME=\
I t \ ">");

"

MAXLENGTH=\

Submi t

"

10\

"

" VALUE=\ "Send

15.4.7. mk_order.php
, , , . mk_order.php ,
checkout .php, .
$query = "INSERT INTO customer VALUES
(' ' , '$first_name', '$middle', '$last_name', '$ title', '$suffix')";
$customer = mysql_query($query) or die ( "
");
$cust_id = mysql_insert_id();
cust_id customer , mysql_insert_id(),
cust_id insert.
cust_id .
$full_name = "$first_name $last_name";
$query = "INSERT INTO address VALUES
(' ', '$full_name', '$streetl', '$street2', '$city', '$state',
'$zip' )";
$address = mysql_query($query) or die ( "
");
$addr_id = m ysql_insert_id() ;
$addr_id .
$today = date("Ymd", time());
$quer y = "I NSERT I NTO
('
' ,
' $cust _i d' ,
$t oday ,
'$today', '1', ' '

orderj nast er VALUES


' $addr_i d' ,
' $addr_i d' ,

' $t oday' ,

, ' ')";

$order = mysql_query($query) or die ("Fatal: mk_order .php:


order_master.");
$order_num = mysql_insert_id();
, , $order_num . , order_master ,
. , ,
, order_detail
.

180

III.

'

. order_detail.
, ,
. ,
, , ,
. , ,
order_detail ,
order_num line_num.
$cart

mysgl_query("SELECT
*
FROM
cart
WHERE
cart_num
' $cart_num'")
or die("F atal:
checkout.php:

.");
$cnt = mysql_num_rows($cart);
for ($j=0; $j <= mysql_num_rows($cart)
1; $j++ )
if (!mysql_data_seek($cart, $ j ) )
{

printf(" %d\ n", $j) ; continue;


}
if(!($cart_row= mysql_fetch_object($cart)))
continue;
$query =
"
SELECT price AS
line_price
FROM product
WHERE
inventory_num = '$cart_row >inventory_num' ";
$price_rslt = m ysql_query($query) or die("F atal: m k_order.php:
order_master.");
if(!($row= m ysql_fetch_object($price_rslt))) die("
.");
$line_price = $row > line_price;
$query = "INSERT INTO "order_line VALUES ('$order_num','$cart_row
> line_num ','!','$cart_row > inventory_num ','$line_price')";
$lin e_ rslt = mysql_query($query) or die("F atal: mk_order.php:
.");

, " ".
,
<l Accept> ( ),
.

15.

181

IV

...
A.
.
B. TCP/IP
. IP
. ,
. Unix
. WINDOWS NT
3. HTTP
.
. mod_perl API
.


...
.1.

184

.2.

184

.1.

Apache.
.

.2.
.2.1. AccessConfig
:
:
:

AccessConfig
AccessConfig conf/access.conf
,

,
.
ResourceConfig. ServerRoot.

Apache
site_specific, conf, Resource_Config
:

AccessConf i g

conf / si t e

speci f i c

, :

AccessConfig /dev/null

184

IV.

.2.2.

AccessFileName

:
:
:

AccessFileName
AccessFileName .htaccess
,

, .
,
, , .

, Apache .htaccess,
:

AccessFileName .htaccess
'

, /usr/local/w

, , ;
, :

/ usr/ . ht access
/ usr/ l ocal / . ht access
/ usr/ l ocal / web/ . ht access
,
. :

<Di rect ory>

Al l owOverri de
</ Di rect ory>

None

A.2.3. AddModule
:
AddModule
. . .
:

:
AddModule Apache
1.2
,
, .
, ,
ClearModuleList.

mod_peri :

AddModule mod_perl

.2.4. AllowOverride
:
:
:

AllowOverride override override . . .


AllowOverride All

.htaccess
, AccessFileName.
override
. .

185

.1.

override

Override

None

All

AuthConfig

(AuthDBMGroupFile,
AuthDBMUserFile, AuthGroupFile, AuthName,
AuthType, AuthUserFile, require ..).
,
(AddEncoding,

FileInfo

AddLanguage, AddType, DefaultType,

ErrorDocument, LanguagePriority).
,

Indexes

(AddDescription,

AddIcon, AddIconByEncoding, AddIconByType,

DefaultIcon, DirectoryIndex, FancyIndexing,


HeaderName, IndexIgnore, IndexOptions,
ReadmeName).

Lim it

,
(allow, deny order).

Options

,
(Options, XBitHack).

.2.5. AuthName
:
:
:

AuthName
, .htaccess
AuthConfig

.
, ,
.
AuthConfig, require AuthUserFile AuthGroupFile.

business_a :

AuthName business_a

.2.6.
:
:
:

AuthType

AuthType
, .htaccess
AuthConfmg

.

Basic. AuthName, require
AuthUserFile AuthGroupFile.
186

IV.

Basic, :

AuthType Basic

.2.7. BindAddress
:
BindAddress saddr
:
BindAddress *
:

Unix
IP IP .
saddr . .2.
.2. saddr

IP .
<I >

IP .

< >

C .
5, " Web ".

.2.8. ClearM oduleList


:
:
:

ClearModuleList

ClearModuleList ,
Apache 1.2

. ,
, ClearM oduleList.
AddModule
.

, :

Cl earModul eLi st

.2.9. Def aultType


:

:
:

DefaultType mime mun


DefaultType text/html
, , ,
.htaccess

Filelnfo

Apache IM ,
, .

187

,
, .

txt/html,

D efaultType text/ html

.2.10. <Directory>
:
:

<Directory . . . </Directory>
,

, ,
.
,
, "*" "?".
1,
" ". .
,
, ,
. , ,
.htaccess.

Directive ( )
/home/site2 , :

<Di rect ory /home/si te2>


Di rect i veA

<Di rectory>

A.2.11.

DocumentRoot

DocumentRoot

DocumentRoot /usr/local/etc/httpd/htdocs

, .
, DocumentRoot /usr/businessa,
, URL http://www.businessa.com/index.html

/usr/businessa/index.html.
, ,


DocumentRoot.

DocumentRoot

(/somedir/).

188

IV.

Web /usr/businessa,
.

Document r oot

/ usr / busi nessa

.2.12.

ErrorDocument

:
:

ErrorDocument
, , ,

FileInfo

.htaccess

Apache ,
.

ErrorDocument 403 "Having problems. Come back later"

URL:

ErrorDocument 401 / customer.html


ErrorD ocument 404 / cgi bin/ customer.pl

URL:

ErrorDocument 500 http://www.blah.com/cgi bin/boo boo

ErrorDocument 401 .

.2.13.

ErrorLog

:
:

ErrorLog
ErrorLog logs/error_log

,
.
( "/",

)
ServerRoot.

189

/ var/ adm/ logs/ http.log

ErrorLog

/ var/ adm/ l ogs/ ht t p. l og

A.2.14.
:
:

<Files>

<Files >. . . </Files>


, ,
.htaccess

: 1.2
.
, <Files>,
. URL. <Files>

<Directory> .htaccess, <Location>.
(
text/.html) (

text?/html, te*.html).

DirectiveA ,
srh, :

<Fi l es srh*>
Di rect i veA
<Fi l es>

A.2.15. Group
:
:
:

Group Unix
Group # 1
,

Unix (
/etc/group), .

httpg, :

group httpg

:
Apache.

.2.16.

HostNameLookups

: HostNameLookups on | off
: HostNameLookups on
:
,

190

IV.

DNS.
IP .
, DNS
.

" " , :

HostNameLookups on

.2.17. IdentityCheck
:
:
:

IdentityCheck on \ off
IdentityCheck off
,


RFC 1413 . , ,
, identd
. boolean
on off.

I dent i t yCheck

on

.2.18. <IfModule>
:
:
:

<Ifmodule [ ! ] > ... </IfModule>


. ,
<Ifmodule >, ,
,
, .
. ( !modulea ,
, modulea .)

.2.19. KeepAlive
:
:
:
:
:

(Apache 1.1) KeepAlive


(Apache 1.1) KeepAlive 5
(Apache 1.2) KeepAlive on/off
: (Apache 1.2) KeepAlive On

Apache 1.1,
KeepAlive . Apache 1.2
On, ,
Off, . . MaxKeepAliveRequests.

191

10 KeepAlive,
:

KeepAl i ve

10

( ),
:

KeepAl i ve

of f

.2.20. KeepAliveTimeout
:
:
:

KeepAliveTimeout
KeepAliveTimeout 15

Apache
, .

, 10 ,
:

K eepAliveTimeout 10

.2.21. Listen
:
:

Listen [IP :]

IP .
IP ,
, Port. Listen
IP
.

, 443,

:
Listen 192.168.100.1:443

.2.22. <Lim it>


:
:

<Limit ...> </Limit>

Limit
, HTTP.

192

IV.

(. 8, ""),
DELETE, :

<Li mi t
DELETE>
requi re val i d$user
</ Li mi t >

A.2.23.
:
:

<Location>

<Location URL> ... </Location>


,

URL.
URL,
<L ocation URL> </ L ocation>.

D irectiveA () / server
info, :

<Locat i on / server$i nf o>


Di rect i veA
<Locat i on>

A.2.24. LockFile
:
:
:

LockFile
LockFile logs/ accept.lock

LockFile,
Apache USE_FCNTL_SERIALIZED_ACCEPT
USE_FLOCK_SERIALIZED_ACCEPT. LockFile

(NFS).

LockFile / var/ httpd/ lock,


:

LockFile / var/ httpd/ lock

.2.25.
:
:
:

MaxClients

MaxClients
MaxClients 256


, .

100 :

M axClients 100

193

.2.26. M axKeepAliveRequests
:
:
:

MaxKeepAliveRequests
MaxKeepAliveRequests 100


, KeepAlive on. ,
0 (),
, .

200,
:

M axKeepAliveRequests 200

.2.27. M axRequestsPerChild
:
:
:

MaxRequestsPerChild
MaxRequestsPerChild

,
.
. 0
. :
.
,
.

50 ,
:

MaxRequestsPerChild 50

.2.28. MaxSpareServers
:
:
:

MaxSpareServers
MaxSpareServers


.
.

Apache , 20,
:

M axSpareServers 20

194

IV.

.2.29. M inSpareServers
:
:

MinSpareServers
MinSpareServers 5

.
, Apache
.

Apache , 10,
:

MinSpareServers 10
.2.30.

Options

Options [+\ [ [+\ ] . . .

, , ,

.htaccess
Options

,
. Options "" ,
. ..
.. options

All


Mul t i Vi ews.

ExecCGI

CGI .

FollowSymLinks


. ,
, ,

<Directory>.
includes

IncludesNOEXEC

,
# # include CGI .

Indexes

, URL ,
DirectoryIndex (
index.html),
.

Multiviews

MultiViews.

SymLinksIfOwnerMatch

,

.

195


. . ,
"+" " '",
: , "+",
, , " ",
.

CGI

, /home/sample, :

<Directory /home/sample>
Options +ExecCGI
</Directory>

, CGI
/home /sample, :

<Di rect ory

/home/sampl e>

Opt i ons
</ Di rect ory>

ExecCGI

A.2.31. PidFile
:
:

PidFile
PidFile logs/httpd.pld

,
. "/",
,
Ser ver Root .

Apache ID

/some/secure/location,

PidFile /some/secure/location

.2.32. Port
:

Port

Port 80

, HTTP
, 80.
,
. 65535.
( , , , 1024)
.

196

IV.

Apache 443( SSL),


:

Port 443

.2.33. require
:
:
:

require . . .
, .htaccess
AuthConfig


. ,
.
.
.

bob, timmy susie,


:

requi re

user

bob

t i mmy

susi e

A.2.34. ResourceConf ig
:
:
:

ResourceConf ig
ResourceConfig conf/srm.conf
,

, ,
httpd.conf.
ServerRoot. ,
/dev/null.

ResourceConf ig some/secure/directory,
:

ResourceConfig some/ secure/ directory

.2.35. RLimitCPU
:
:
:

RLimitCPU 'max' [ 'max']



,

() .
( )
.
"max",
.
.

197

20 , :

RLi mi t CPU

20

.2.36. RLimitMEM
:

RLimitMEM 'max' [ 'max']

.
,
. ,
, ,
"max",
. .

20 , :

RLimitMEM 20000000

.2.37. RLimitNPROC
:
:
:

RLimitNPROC 'max' [ 'max']



,


( CGI ), Apache.

Apache. ,
.

100,
:
RLimitN PROC 100

.2.38.
:
:
:

Satisfy

Satisfy 'any' 'all'


Satisfy all
, .htaccess


"/",
" /". 'any'
( )
.

198

IV.

/home/sample
" /", "/",
:

</ Di rect ory / home/ sampl e>


Sat i sf y al l
</ Di rect ory>

ScoreBoardFile

A.2.39.
:
:
:

ScoreBoardFile
ScoreBoardFile logs/apache_status


,
.

ScoreBoardFile

/etc/httpd/logs/sbf, :
ScoreBoardFi l e / et c/ ht t pd/ l ogs/ sbf

.2.40.
:
:

SendBufferSize

SendBuffersize
,

TCP .

.

TCP 2 :

SendBufferSize

2000000

.2.41.
:
:

ServerAdmin

ServerAdmin
,

,
.

admin@yourste.org, :

ServerAdmi n

admi n@yoursi t e. org

.2.42.
:
:

ServerAlias

ServerAlias 1 2 ...

199


Host .

site2, :
ServerAl i as

si t e2

.2.43.
:
:

ServerName

ServerName
,


URL . ,
, IP .

www.example.com, :

<Vi r t ual Host


ServerName

192. 168. 100. 1>


www. exampl e. com

<Vi rt ual Host >

.2.44.

ServerPath

ServerPath

Host
URL .

/user/oldsite, :

ServerPath /user/oldsite

.2.45.

ServerRoot

ServerRoot _

ServerRoot / usr/ local/ etc/ httpd

,
. ,

, .
d .

Apache /usr/apache,

ServerRoot /usr/apache

200

IV.

.2.46. ServerType
:
:
:

ServerType
ServerType standalone
,

inetd standalone. inetd


inetd
inetd. conf. standalone,
.
, inetd

HTTP .
, .

, standalone

Apache standalone, :

ServerType standalone

.2.47. StartServers
:
:
:

StartServers
StartSer vers 5
,

,
. ,
, , (.
MaxSpareServers, MinSpareServers ..), ,

Apache 20 :

StartServers 20

.2.48.
:
:
:

TimeOut

TimeOut
TimeOut 300
,

Apache :
1. GET,
2. POST Put,
3. TCP.

3 , :

TimeOut 180
.

201

.2.49.
:
:
:

User

User Unix
User # l
,

userid, .
"#", .
/etc/passwd.
,
Apache.

httpd

apache,

User apache

.2.50.
:
:

VirtualHost

<VirtualHost [: ] ...> ... </VirtualHost>


,

,
.
IP .

_default_ ,
.

.
5, " Web ".

, www.site2.com IP
1192.168.100.1, :

NameVi rt ual Host


192.168.100.1
<Vi rt ual Host
192.168.100.1>
ServerName

www. si t e2. com

</ Vi rt ual Host >

IP 192.168.100.20
www.site2.com :

<VirtualHost 192.168.100.20>
ServerName www.site2.com

</VirtualHost>

202

IV.


...
.1. mod_access

204

.2. mod_actions

206

.. mod_alias

207

.4. mod_auth

209

.5. mod_auth_anon
.6. mod_auth_db
.7. mod_auth_dbm

211
213
214

.8. mod_browser

216

.9. mod_cern_meta

216

.10. mod_cgi
.11. mod_digest

217
218

.12. mod_dir

219

.13. mod_env
.14. mod_expires

224
225

. 5.

mod_ieaders

.16.
.17.

mod_map
mod_nclude

227
228

mod_nfo
mod_sapi

229
229

.18.
.19.
.20. mod_log_agent
.21.
.22. mod_log_config
.23.

226

230
mod_og_common

230
230

mod_log_referer

232

.24. mod_mime

232

.25. mod_mime_magic

235

.26. mod_mmap_static

235

.27. mod_negotiation
.28. mod_proxy

236

.29.
.0. mod_setenvif

235
mod_rewrite

.31. mod_so

236
241

243

.32. mod_speling

244

.33. mod_status
.34. mod_unique_id

244
245

.35. mod_userdir
.36.

245
mod_jsertrack

245

203

. 1. mod access
mod_access., .
IP .

. 1.1. allow
:

allow from . . .

:
:

, .htaccess
Limit

mod_access

Base

,
.
. .1.
.1.

allow

all

, .

ip
ip

IP , .
1 3 IP
, .

, :

allow from .ncsa.uiuc.edu

blah. edu blahblah.edu.

. 1.2. a llo w fro m env


:
:

allow from v=
, .htaccess

Limit

:
:

mod_access
Apache 1.2

Base

allow from env


. Web
, .

204

IV.


brwsrl BrowserMatch
allow from env. brwsrl

f or_brwsrl .
BrowserMat ch

~somebrowser/ 2 .

<Di rect ory

brwsrl

/ f or_brwsrl >

order al l ow,
deny
al l ow f rom env=brwsrl

deny

from

al l

</ Di rect ory>

.1.3. deny
:

deny . . .

, .htaccess

:
:
:

Limit
Base
mod_access

. , . .2.
.2. deny

all

, .

ip

IP , .

ip

1 3 IP
, .

.1.4. deny from env


:
deny from env=
:
, .htaccess
:
Limit
:
Base
:
mod_access
: Apache 1.2

,
. . allow from env.

BrowserMat ch ^somebrowser/ O. 9 br wsr 2


<Di rect ory / f or_brwsr1>

order

al l ow,

deny

deny f rom env=brwsr2


al l ow from al l
</ Di rect ory>

205

.1.5. order
:
order
:
order deny, allow
:
, .htaccess
:
Limit
:
Base
:
mod_access
order , Apache
. ,
, . ..
.. order

deny, allow

deny,
allow. .

allow, deny

allow,
deny. FORBIDDEN.
,

.

m utual failure

,
:

order m utual failure

.2. mod actions


CGI ,
, ,
. Apache 1.1
.

.2.1. Action
:
:

Action cgi mime muna


, , ,
.htaccess

:
:
:
:

FileInfo
Base
mod_actions
Action Apache 1.1

CGI ,
MIME . URL
CGI PATH_INFO
PATH TRANSLATED.

206

IV.

, MIME mt1,

hndl_mt1. hndl_m t1.pl MIME mt1,


:

Action mtl hndl_mt1.pl

.2.2. Script
:
:
:
:
:

Script CGI
, ,
Base
mod_actions
Script Apache 1.1

, CGI ,
. GET, POST, PUT
DELETE. PATH_INFO

PATH_TRANSLATED URL ,
. , Script
. CGI ,
, . ,
GET (,
foo.html?hi). .

PUT scrip t / cgi bin/ put.pl,


:

</ DI V>
scri pt

PUT

/ cgi $bi n/ put . pl

.. mod a lia s

.

.3.1. Alias
:
:
:
:

Alias url _ .
,
Base
mod_alias

,
Document Root .

URL, cgi bin,


/var/secure/cgi bin,
, :

Al i as

cgi $bi n

/ var/ secure/ cgi $bi n

207

.3.2.

Redirect

Redirect [ ] url url

, , ,
.htaccess

Base

mod_alias

.htaccess
Apache 1.1 .
Apache 1.2

redirect URL .
URL ,

. Alias
Script Alias. ,
, DirectoryRoot.
( Apache 1.2 ) . .4.
.4. status

nn
permanent
temporary
seeother
gone

(HTTP 302).
(HTTP 301).
(HTTP 302).
". " ("see other"
HTTP 303).
"" ("gone" HTTP 410). .

, , , ,
send_error_response

http_protocol..

, /cgi bin, www.cgiserv.com/cgi


bin :

Redi rect

/cgi $bi n

www. cgi serv. com/ cgi $bi n

.3.3. RedirectTem p
:
:

RedirectTemp url url


, , ,
.htaccess

:
:

208

Base
mod_alias

Apache 1.2

IV.

( )
HTTP 302. Redirect

temp directive/argument.

, /cgi bin URL

www.cgiserv.com/cgi bin, :
RedirectTemp /cgi bin www.cgiserv.com/cgi bin

.3.4. RedirectPermanent
:
:
:
:
:

RedirectPermanent url url


, , , .htaccess
Base
mod_alias
1.2

HTTP 301.
Redirect permanent directive/argument.

, /cgi bin URL

www.cgiserv.com/cgi bin, :
RedirectPermanent /cgi bin www.cgiserv.com/cgi bin

.3.5.
:
:
:
:

ScriptAlias

ScriptAlias url _
,
Base
mod_alias

Alias ,
, CGI . URL,
url , ,
_ .

, /cgi bin/,

/sbin/cgi bin ( , ),
:

Scri pt Al i as

/cgi $bi n/

/ sbi n/ cgi $bi n

.4. mod_auth

. ,
.
SSL. 8,

"".

209

.4.1. AuthGroupFile
:
:
:
:
:

AuthGroupFile
, .htaccess
AuthConfig
Base
mod_alias

,
,
. :
, , , .
,
.
AuthDBMGroupFile, .
AuthGroupFile , .

authgroupfile /etc/secure/groupfile,

AuthGroupFile / etc/ secure/ groupfile

.4.2. AuthUserFile
:
:
:
:
:

AuthUserFile
, .htaccess
AuthConfig
Base
mod_auth


, .
:
, , ,
crypt().
AuthDBMUserFile.

/ etc/ secure/ groupfile, :


Aut hUserFi l e

/ et c/ secure/ groupf i l e

5.4.3. AuthAuthoritative
:
:
:
:
:

AuthA uthoritative <On () | Off>


, .htaccess
AuthConfig
Base
mod_auth

, AuthAuthoritative, ,

, mod_auth.
210

IV.

"" mod_auth
. ,

mod_auth_db., mod_auth_dbm. ..
.

mod_auth. mod_auth_anon..
mod_auth.c ,
mod_auth_anon.,

AuthAuthoritative Off

.5. mod_auth_anon
, ,
, anonymous ftp; ..
"anonymous", .
,
, ,
.
8, "".

.5.1. Anonymous
:
:
:
:
:

Anonymous . . .

, .htaccess
AuthConfig
Base

mod_auth_anon

,
. , ,
,
"anonymous".

"anonymous" "guest", :

Anonymous guest guest

.5.2. Anonymous_Authoritative
:

:
:

:
:

Anonymous_Authoritative on | off
Anonymous_Authoritative off
, .htaccess
AuthConfig

Extension
mod_auth_anon

Anonymous_Authoritative on
. ,
.

211

, . off,
.

mod_auth_anon
, :

Anonymous_Authoritative on

.5.3. Anonymous_LogEmail
:

:
:

Anonymous_LogEmail on | off
off
, .htaccess
AuthConfig

Extension

mod_auth_anon

on,

, httpd log.
.


, :

Anonymous_LogEmail on

.5.4. Anonymous_MustGiveEmail
:

Anonymous_MustGiveEmail

:
:

off
, .htaccess
AuthConfig

Extension

mod_auth_anon

on|off

on, .

, .


, :

Anonyraous_M ustGiveEmail on

.5.5. Anonymous_NoUserID
:

:
:

Anonymous_NouserID on | off
Anonymous_NouserID
off
, .htaccess
AuthConfig

Extension

mod_auth_anon

212

IV.

on, ,

. , .

( ,
),
:

Anonymous_NoOsei rI D

on

.5.6. Anonymous_VerifyEmail
:

:
:
:
:

Anonymous_VerifyEmail on | off
Anonymous VerifyEmail off
, .htaccess
AuthConfig
Extension
mod_auth_anon

.
on ,
"@" ".",
. ,
eat@my.shorts ,
.

, "@" ".",
:

Anonymous_VerifyEmail on

.6. mod auth db



.

.6.1. AuthDBGroupFile
:
:
:
:
:

AuthDBGroupFile
, .htaccess
AuthConfig
Extension
mod_auth_db

,
, .
. ,
, .
.
, , .

213

mod_auth_db / var/ secure/ dbgroup,

AuthDBGroupFile

/var/secure/dbgroup

.6.2. AuthDBUserFile
:
:
:
:
:

AuthDBUserFile
, .htaccess
AuthConfig
Extension
mod_auth_db

,
, .
, crypt ()
. . ,
, . ,
.

mod_auth_db

/var/secure/userdb, :
AuthD BU serFile / var/ secure/ userdb

.6.3. AuthDBAuthoritative
:
:
:
:
:

AuthDBAuthoritative on|off
, .htaccess
AuthConfig
s
mod_auth_db

on,
. off,
.

, mod_auth_db ,
, AuthDBAuthoritative on.

AuthD BAuthoritative on

.7. mod_auth_dbm
, ,
DBM.
8, "".

214

IV.

.7.1. AuthDbmGroupFile
:
:
:

AuthDbmGroupFile
, .htaccess
AuthConfig

Extension
mod_auth_dbm

DBM,
.
. ,
, .
. ,
, .

DBM, /etc/secure/

dbmgroup, :

Aut hDbmGroupFi l e

/ et c/ secure/ dbmgroup

.7.2. AuthDBMUserFile
:
:
:

AuthDBMUserFile
, .htaccess
AuthConfig

Extension
mod_auth_dbm

,
, .
, crypt ()
. . ,
, . ,
.

DBM

Aut hDBMUserFi l e

/etc/secure/dbmuser, :

/ et c/ secure/ dbmuser

.7.3. AuthDBMAuthoritative
:
:
:

AuthDBMAuthoritative < () | off >


, .htaccess
AuthConfig

mod_auth_dbm

Base

off,
(
modules.) ,
,
.

215

mod_auth_dbm ,

AuthDBMAuthoritative on

.8. mod browser


, ,
.
, Web
, .

.8.1. BrowserMatch
:

BrowserMatch _ amp1 amp2. . .

:
:

Base
browser

Apache 1.2

User Agent,
. ,
,
.

browser "netscape", User


Agent "Mozilla...",
:

BrowserMat ch

^zi l l

f orms

j peg=yes

browser=net scape

.8.2. BrowserMatchNoCase
:
:

:
:

BrowserMatchNoCase _

Base
mod_cern_meta
Apache 1.2
BrowserMatchNoCase

BrowserMatch.

platform
"windows" , User Agent "win":

BrowserMat chNoCase

216

wi n

pl at f orm=wi ndows

IV.

.9. mod cern meta


, , ,
, CERN HTTPD.

.9.1. MetaDir
:
:
:

:
:
:

MetaDir
MetaDir .web

Base
mod_cern_meta
Apache 1.1

,
, .
, , .

, , ,
, :

Metadir .

.9.2. MetaSuffix
:

:
:

MetaSuffix suffix

MetaSuffix .meta

Base

mod_cern_meta

Apache 1.1

, .

".meta", Apache
index.html index.html.meta.
, :

MetaSuffix .meta

.10. mod_cgi
mod_cgi ,
(.
9, " Web ).

.10.1. scriptLog
:

ScriptLog

:
:
:


mod_cgi

217

,
CGI .
, .
CGI
.
.

Apache , CGI ,
/ var/ logs/ error.txt, :

Scri pt Log

/ var/ l ogs/ error. t xt

.10.2. ScriptL ogL ength


:
:
:
:

ScriptLogLength
10385760

mod_cgi

( )
. ,
.

ScriptLog 20 , :
:

ScriptLogLength 20000000

.10.3. ScriptLogBuffer
:
:
:
:

ScriptLogBuffer
1024

mod_cgi


PUT POST.
.

2048 , :

ScriptLogBuffer 2048

.11. m od_digest

MD5. .
8,
"".

218

IV.

.11.1. AuthD igestFile


:
:
:
:
:
:

AuthDigestFile
, .htaccess
AuthConfig
Base
mod_digest
Apache 1.1

,
, MD5,
. , AuthType
"Digest", AuthUserFile
AuthDigestFile.

/ etc/ secure/ authdigest auth_digest:


AuthDigestFile /etc/secure/authdigest

.12. mod_dir
, ,
, .
, , index.html.
. , Apache
,
.

.12.1. AddAlt
:
:

:
:

AddAlt . . .
, , , .htaccess

Indexes
Base
mod_dir

,
, . FancyIndexing
on.

.12.2. AddAltByEncoding
:
:

:
:
:

AddAltByEncoding MIME . . .
, , , .htaccess

Indexes
Base
mod_dir

,
MIME
. FancyIndexing
on.

219


MIME x compress "compress", :
AddAl t ByEncodi ng "compress" x$compress

.12.3. AddAltByType
:
:
:
:
:

AddAltByType MIME mun MIME mun. . .


, , , .htaccess
Indexes
Base
mod_dir

,
IM
. FancyIndexing on.

"text html" MIME

text/html:

AddAltByType "text or html" text/html

.12.4. AddDescription
:
:
:
:
:

AddDescription . . .
, , , .htaccess
Indexes
Base
mod_dir

.
, ,
.

"Foolish Young

Dogs" /web/pics/

housepets.gif, :
AddDescri pt i on

"Fool i sh

Young

Dogs"

/ web/ pi cs/ housepet s. gi f

.12.5. Addicon
:
:
:
:
:

Addicon . . .
, , , .htaccess
Indexes
s
mod_dir

URL ,
.
^^DIRECTORY, ^^BLANKICON, , ,

.
URL (alttext, url), alttext ,
.

220

IV.

, script.xbm,
.l .ksh, :

Addicon / icons/ script .xbm .pl .ksh

. 12.6. AddIconByEncoding
:
:

AddIconByEncoding MlME MIME


, , , .htaccess

:I ndexes
:
Base
:

mod_dir

,
, MIME .
URL "%" ,
(alttext, url), alttext
.

comprees.xbm MIME x compress,


:

AddIconByEncoding /icons/image.xbm x compress

.12.7. AddIconByType
:
:

AddIconByType MIME MIME ...


, , , .htaccess

: Indexes
:
Base
:

mod_dir

,
, MIME .
URL "%" , (, url),
. MIME
, MIME .

IMG /icons/image.xbm,
MIME

AddI conByType

image/*, :
(IMG, / i cons/ i mage. xbm) i mage/ *

.12.8. D efaultIcon
:

DefaultIcon url

:
:
:
:

, , , .htaccess
Indexes
Base
mod_dir

221

,
FancyIndexing, .

/icon/unknown.xbm

, :

Defaul tIcon

/ i con/ unknown. xbm

. 12.9. Directory Index


:
:
:

:
:

DirectoryIndex url url


DirectoryIndex index.html
, , , .htaccess

Indexes
Base

mod_dir

,
( index.hmtl).
.

CGI

index.pl,

index.htm l, alt in dex, html:

D irectoryIndex index.htm l index.txt / cgi bin/ index.pl

. 12.10. FancyIndexing
:
:
:

FancyIndexing < on | off >


, , , .htaccess
Indexes

Base
mod_dir

/ FancyIndexing.

FancyIndexing, :
FancyIndexi ng on

.12.11. HeaderName
:
:
:

HeaderName
, , , .htaccess
Indexes

Base
mod_dir

,
.
.

222

IV.

site banner.htm l ,

HeaderName site banner.html

.12.12. IndexIgnore
:
:
:

Indexlgnore . . .
, , , .htaccess
Indexes

Base
mod_dir

(
), .
, ,
.

Apache , .htaccess ,
. pi ,
:

I ndexl gnore

README

.12.13.
:
:
:
:
:

. ht access

. pl

IndexOptions

AuthDigestFile
, , , .htaccess
Indexes
Base
mod_dir

.
. .5.
.5.

IndexOptions

FancyIndexing

IconsAreLinks

ScanHTMLTitles

HTML
.
: .

SuppressLastModif led

SuppSDo
.

SuppressSize

He
.

Suppress Description

He
.

223

<Directory /home/site2/>
IndexOptions FancyIndexing SuppressDescription
<Directory>

.12.14. ReadmeName
:
:

ReadmeName
, , , .htaccess

:
:
:

Indexes
Base
mod_dir

Apache 1.1

,
.

readme ,
:

ReadmeName

README

.13. mod env



CGl ,
, Apache.

.13.1. PassEnv
:
:

:
:
:

PassEnv . . .
,

Base
mod_env
PassEnv Apache 1.1


, CGI .

INFORMIXDIR ,
:

PassEnv INFORMIXDIR

224

IV.

.13.2. SetEnv
:
:
:
:
:

SetEnv . . .
,
Base
mod_env
SetEnv Apache 1.1

,
CGI .

INFORMIXDIR
, :

Set Env

I NFORMI XDI R

.13.3.

/ usr/ l ocal / i nf ormi x

UnsetEnv

:
UnsetEnv
:
,
:
Base
:
mod_env
: UnsetEnv Apache 1.1 .

, CGI .

INFORMIXDIR ,
, :

UnsetEnv INFORMIXDIR

.14. mod_expires
Expires
HTTP, .

.14.1. ExpiresActive
:
:
:
:
:

ExpiresActive < on | off >


,
Indexes
Extension
mod_expires


Expires HTTP.

HTTP Expires, :

ExpiresActive on

225

.14.2. ExpiresByType
:
:

ExpiresByType MIME mun <>


, , , .htaccess

:
:

Indexes
Extension

mod_expires

Expires HTTP,
. <> "",

, , "",
, .

,
, :

html

Expi r esByType

A604800

t ext / ht ml

.14.3. ExpiresD efault


:
:

ExpiresDefault <>
, , , .htaccess

:
:

Indexes
Extension

mod_expires

,
.
,
Expi resByType.


, :

ExpiresDefault M 2592000

.15. mod_headers
, Header,
HTTP.

.15.1. Header
:
:

Header [set | append | add | unset]


H eader unset header

:
:

Indexes
Optional

mod_header

,
HTTP. . .6.

226

IV.

.6. Header

set

( ) .

append

add

,
.

unset

"Fenris", ,
:

Header

set

Server

"Fenri s"

.16. mod_imap

CGI. ,
.
Imagemaps ,
, .

.16.1. ImapMenu
:
ImapMenu option
:
, , , .htaccess
:
Indexes
:
mod_map
: ImapMenu Apache 1.1

, imap . . .7.
.7. ImapMenu

,
.

formatted

imagemap .
, hrule, ,
. .

semi formatted

, .
HTML .
hrule ,
, formatted.

227

. . 7

, . ,
imagemap, .
imagemap .
,
imap HTML ,
.

unformatted

.16.2. ImapDefault
:
:

ImapDefault [error, nocontem, referer, URL]


, , ,
.htaccess

:
Indexes
:
mod_map
: ImapDefault Apache 1.1


imagemap. ,
nocontent, : "204 No Content".

imagemap mysite.html, :

I mapDef aul t

mysi t e. ht ml

.16.3. ImapBase
:
ImapBase [map, referer, URL]
:
, , , .htaccess
:
Indexes
:
mod_map
: ImapBase Apache 1.1
, imagemap
. base imagemap.

I mapBase

/images/ image,

/ i mages/

.17. mod_include
mod_include HTML
. 9, "
Web .

228

IV.

. 17.1. XBitHack
:
:
:
:
:

XBitHack
XBitHack off
, , , .htaccess
Options
mod_include

on full XBitHack
HTML ( MIME text/html). ,
, . .8.
.8. XbitHack

off
on

.
mod_include ,
"user execute".

fu ll

mod_include ,
"user execute" "group execute".

.18. mod_info
mod_inf ( )
Web .
7, " ".

.18.1. AddModuleInfo
:
AddModulelnfo

:
,
:
Base
:
mod_browser
:
AddModuleInfo Apache 1.3


.

, ,

mod_inf , :
AddModul el nfo mod_aut h. c
' .
< HREF="ht t p: / / www. apache.
org/ docs/
mod/ mod_i nf o. ht ml ">ht t p: / / www. apache. org/ docs/ mod/ mod_i nf o. ht
ml </ A>'

.19. mod_isapi
mod_isapi
(Internet Server Application Programming
Interface ISAPI) Apache Win32.
.

229

, isapi isa ,
dll:
AddHandl er i sapi $i sa dl l

.20. mod_log_agent
mod_log_agent
UserAgent .

.20.1. AgentLog
:
:
:
:
:

AgentLog
AgentLog logs/agent_log
,
Extension
mod_log_agent

, Apache
. ,
( ),

(
).

user_Agent

countagent.pl, :
AgentLog | countagent.pl

.21. mod_log_common
Apache 1.2, mod_log_common
mod_l og_conf i g.

.22. mod_log_config
mod_log_config
Common Log Format. , LogFormat
.
7, " ".

.22.1. CookieLog
:
:
:
:

CookieLog
,
mod_cookies
Apache 1.2

cookies.

230

IV.

cookies /var/iog/cookies,
:

CookieLog /var/log/cookies

.22.2. Custom_Log
:

CustomLog
env= [!]
:
,
:
Base
:
mod_log_config
: Apache 1.3
(
), .
, .
, LogFormat.

,
.

, , ,
/var/log/bytelog, :

CustomLog / var/ l og/ byt el og


Browser=net scape

"date

host

i dent

byt e"

, , , Netscape
/var/log/netscape, ( ,
):

Cust omLog / var/ l og/ byt el og


Browser=net scape

"date host

i dent

byt e"

.22.3. LogForm at
:
:
:
:
:
:

LogFormat []
LogFormat "%h %l %u %t "\^r\" %s %b"
,
Base
mod_log_config
Apache 1.3

,
TransferLog. , ,
,
. , ,
7, " ".

LogFormat, , .
.
.

231

standard "%h %l %u %t
:

LogFormat

"%h

%l

%u

%t

\"%r\"

%s

%b"

\"%r\" %s %b"

st andard

.22.4. Transf erLog


:
:
:
:
:

TransferLog

,
Base
mod_log_config

,
TransferLog. , Unix
.

, Transf erLog, wc, :

Transf erLog

wc

.23. m od_log_referer
Apache 1.3.5.
, , ,
CustomLog.

.24. mod_mime
MIME
. 1, " ".

.24.1. AddEncoding
:
:
:
:
:

AddEncoding mime . . .

, , , .htaccess
FileInfo
Base

mod_mime

, Apache,
IME .

MIME

AddEncodi ng

232

x gzip .gz, :

x$gzi p

. gz

IV.

.24.2. AddHandler
:
:

AddHandler ...
, , , .htaccess

Base

:
mod_mime
: Apache 1.1
, Apache,
.

cgi script ,

.pl,

AddHandl er

cgi $scri pt

cgi

.24.3. AddLanguage
:
:

:
:
:

AddLanguage mime lang . . .


, , , .htaccess

FileInfo
Base
mod_mime

, (
.en, .fr) ( en, fr)
mod_mime. .

.en , :

AddLanguage en .en

.24.4. AddType
:
:

:
:
:

AddType mime ...


, , , .htaccess

FileInfo
Base
mod_mime

AddType
, ,
MIME .

, GIF

MIME

image/ gif,

AddType image/gif GIF

233

.24.5. ForceType
:

ForceType mun_

, .htaccess

:
:
:

Base
mod_mime
Apache 1.1

<Directory>,
<Location> .htaccess , Apache
, , .

Apache

image/gif,

/ usr/ local/ images

MIME

<Di rect ory / usr/ l ocal / i mages>


ForceType i mage/ gi f
</ Di rect ory>

.24.6. SetHandler
:
:
:
:

SetHandler
, .htaccess
Base
mod_mime

Apache 1.1

,
( <Directory>, <Location>
.htaccess) .

Apache

cgi script ,
/ usr/ local/ cgi bin, :
<Directory / usr/ local /images>
SetH andler cgi script
</Directory>

.24.7. TypesConf ig
:
:
:
:

TypesConlig
TypesConfig conf/mime.types

Base

mod_mime

,
MIME .
ServerRoot. . ,
MIME ,
AddType.

234

IV.

, ServerRoot /opt/apache,
, MIME /opt/apache/conf /MIME.

TypesConfig conf/MIME.types

.25. mod_mime_magic
mod_mime_magic MIME ,
,
Unix file.

.25.1. M imeM agicFile


:
:
:
:
:

MimeMagicFile

,
Extension
mod_mime_magic

:
1. ,
2. .

, ServerRoot /opt/apache,
mod_mime_magic , /apt

/apache/conf/magic:
MimeMagicFile conf/magic

.26. mod_mmap_static
mmap() ,
. . 10, " ".

.26.1. MMapFile
:
:
:
:
:
:

MMapFile


Experimental
mod_mime_magic
Apache 1.1

,
.

/ opt/ apache/ htdocs/ index.html


, :

MMapFile /opt/apache/htdocs/index.html

235

.27. mod_negotiation
mod_negotiation.
. .
,
,
.

.27.1. CacheNegotiatedDocs
:
:
:
:
:

CacheNegotiatedDocs

Base
mod_negotiation
Apache 1.1

CachNegotiateDocs
proxy .

, ( ):

CacheNegotiatedDocs

.27.2. L anguagePriority
:
:
:
:
:
:

LanguagePriority MIME MIME . . .


, , , .htaccess
FileInfo
Base
mod_negotiation
Apache 1.1


, .

Apache ,
, :

LanguagePriority en fr de

.28. mod_proxy
proxy Apache.
6, "Proxy ".

.29.

mod_rewrite
.29.1. RewriteEngine
:
:
:
:

236

RewriteEngine <on\off>
RewriteEngine off
, , , .htaccess
Filelnfo

IV.

Extension

:
mod_rewrite
: Apache 1.2
/ URL.
.

URL, :

Rewri t eEngi ne on

.29.2. RewriteOptions
:
:
:
:

RewriteOptions

, , , .htaccess
FileInfo

Extension

:
mod_rewrite
: Apache 1.2
,
.
inherit,
( , ) ,
.

, :

Rewri t eOpt i ons

i nheri t

.29.3. RewriteLog
:
:
:

:
:

RewriteLog

Filelnfo
Extension

:
mod_rewrite
: Apache 1.2
, ,
. ,
.

,
:

Rewri t eLog

/var/logs/rewriteiog,

/ var/ l ogs/ rewri t el og

237

.29.4. RewriteLogLevel
:

RewriteLogLevel

:
RewriteLogLevel
:
,
:

:
Extension
:
mod_rewrite
: Apache 1.2

,
. 0 ( ) 9
( ).
.

RewriteLogLevel 2

.29.5. RewriteLock
:
:
:
:
:
:

RewriteLock

Extension
mod_rewrite

Apache 1.3

,
.
Rewri t eMap.

/var/lock/rewritelock:

Rewri t eLock

/ var/ l ock/ rewri t el ock

.29.6. RewriteMap
:
:
:
:

:
:

RewriteMap :

,

Extension
mod_rewrite
Apache 1.2 (), Apache 1.3

,

. 11,
" ".

238

IV.

.29.7. RewriteBase
:
:
:
:
:
:
:

RewriteBase BaseURL

, .htaccess
FileInfo
Extension
mod_rewrite
Apache 1.2

(<Directory>,
.htaccess) URL ,
.

,
/some/directory. ,
URL /site2, .htaccess :

Rewri t eBase

/ some/ di rect ory

.29.8. RewriteCond
:
Rewr iteCond
.

:
, , , .htaccess
:
Filelnfo
:
Extension
:
mod_rewrite
: Apache 1.2 (), Apache 1.3
, ,
RewriteRule. RewriteRule
RewriteCond. ,
, .
TestString
TestString ,
:
$N 0 <= N <= 9. RewriteRule,
,
RewriteRule.
%N 1 <= N <= 9.
, ,
RewriteCond .
% {_}
. MIME HTTP
, Apache struct
Unix.

239

HTTP

HTTP_USER_AGENT
HTTP_REFERER
HTTP_COOKI E

HTTP_FORWARDED
HTTP_HOST

HTTP_PROXY_CONNECTI ON

HTTP_ACCEPT
REMOTE_ADDR
REMOTE_HOST
REMOTE_USER
REMOTE_I DENT
REQUEST_METHOD
SCRI PT_FI LENAME
PATH_I NFO

QUERY_STRI NG
AUTH_TYPE

DOCUMENT_ROOT

SERVER_ADMI N
SERVER_NAME
SERVER_ADDR
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE

TIME_YEAR
TI
TI
TI
TI
TI
TI
TI

ME_MON
ME_DAY
ME_HOUR
ME_MI N
ME_SEC
ME_WDAY
ME

API_VERSION
THE_REQUEST
REQUEST_URI

REQUEST_FI LENAME
I S

SUBREQ

CondPattern
, . .9.
.9.

"!" ()
, .
<CondPattern

"",
, Condpattern.

>CondPattern

"",

, Condpattern.
=CondPattern
d

.
"",

240

IV.

. .9

"",
.

"",
, 0.
"",
.

1
F

"",
, .

, .
U

"",
URL.

, CondPattern:
nocase INC

.
,
"".

URL, Lynx
textonly. html, :

Rewri t eCond %{HTTP_USER_AGENT} ~Lynx. *


Rewri t eRul e ^/ $ / t ext onl y. ht ml

[L]

.29.9. RewriteRule
:
:
:
:

:
:

RewriteRule ,

, , , .htaccess
FileInfo
Extension
mod_rewrite
Apache 1.2 (), Apache 1.3 ()

.
,
. ,
URL.

URL, somedir
( ), :

Rewri t eEngi ne on

RewriteRule ^smdi$ somedir/ [R]


.

241

.30. mod_setenvif

, .

.30.1. BrowserMatch
:
:
,
:
:

:
:

BrowserMatch envar [=] [...}

Base
mod_setenvif
Apache 1.2 ( Apache 1.2
mod_browser)


Use Agent HTTP .

: browser ''explorer", ,
User_Agent "MSIE", :

BrowserMat ch

MSI E

browser=expl orer

30.2. BrowserMatchNoCase
:

BrowserMatchNoCase envar [=\


[...]

:

:

s
:
mod_setenvif
: Apache 1.2 ( Apache 1.2
mod_browser)
BrowserMatch ,
, .

browser "explorer",
User_Agent "M sie", "msie" , , "MsIe",
:

BrowserMatchNoCase MSIE browser= explorer

.30.3. SetEnvIf
:

SetEnvif envar [=\

:
:


Base

242

[...]

IV.

:
:

mod_setenvif
Apache 1.3 ( Request_Protocol
1.3.7 )


, .
. .10.
.10. SetEnvIf

, .

Remote_Host
Remote_Addr

IP , .

Remote_User

.
( POST, GET).

Request_Method
Request_Protocol

,
( /0.9, /1.1 ..).

cg i_yn "", URI Perl ,

Set EnvI f

Request

URI

"\.pl $"

.30.4.

SetEnvIfNoCase

:
:
:
:
:
:
:

SetEnvIfNoCase

Base
mod_setenvif
Apache 1.3

cgi

yn=y

SetEnvIf
.

.31. mod_so
Apache
. , Unix Windows
on.

.31.1. LoadFile
:
:
:
:

LoadFile . . .

Base
mod_so

243

.31.2. LoadModule
:
:

LoadModule

Base
mod_so

mod_status, module

ServerRoot, :

LoadModul e

st at us modul e modul es/ mod

st at us. so

.32. mod_speling
URL,
.

.32.1. CheckSpelling
:
:
:
:

CheckSpelling on/off
CheckSpelling on
, , , .htaccess
Options
Base
mod_speling

/ URL.

CheckSpel l i ng on

.33. mod status



Web .

.33.1. ExtendedStatus
:
ExtendedStatus On | Off
:
ExtendedStatus Off
:

Base
:
mod_status
: ExtendedStatus Apache 1.3.2


. ,

244

IV.


, .

,
:

ExtendedStatus on

.34. mod_unique_id

Unix . .

.35. mod userdir


mod_userdir.c .
5, " Web ".

.35.1. UserDir
:
:
:

UserDir /
UserDir public_html
,

Options

:
Base
:
mod_userdir
: Apache 1.2 (), Apache 1.3
,
,
.

: Apache
, :

htdocs,

UserDir htdocs

.36. mod u sertrack


mod_usertrack ( cookies) -

cookies.

.36.1. CookieExpires
:
:

CookieExpires
,

Optional

:
mod_use.rtrack
: Apache 1.2 (), Apache 1.3

245

cookie.
: years, months, weeks, hours, minutes seconds.
, , .

Apache, 1 , 2 3 ,
:

Cooki eExpi res "l

week 2 days

3 hours"

.36.2. CookieName
:
CookieName
:
Apache
:
, , , .htaccess
: Optional
:
Base
:
mod_usertrack
cookie, ,
Apache. .

cookie httpd, :

CookieName httpd

.36.3. CookieTracking
:
:
:
:
:

CookieTracking on \ off
, , , .htaccess
FileInfo
optional
mod_usertrack

,
cookie . ,
Apache cookie .

, :

Cooki eTracki ng on

246

IV.

TCP/IP
...
. 1.

247

B.2. IP

247

B.3.

248

B.4. IP

253

B.1.
TCP/IP , Transport Control Protocol/Internet Protocol
( / Internet), , ,
.
,
. , ,
, , , ,
, (
Internet Explorer Apache Web Apache), ,
, .
TCP/IP , ,
. , TCP,
, ,
, . IP
.

B.2. IP
IP 32 ,
. IP ,
:
145.186.47.50

,
. 32 .
IP , ,
, . .1.

. TCP/IP

247

145.186.47.50

. . 1.

, IP 32
. , 3
1000 :
3

10 = 1 000,

10 , ,
, 3 .
IP 2 ( ,
) 32 ( IP ):
32

2 = 4 294 967 296

, 4294967296 ,
. , ,
IP (. "" ) ,
, 4294967296 .
, .
IP 32 128 , , ,
, ,
1
2000 .

..
, TCP/IP
. , 32
,
.
.

, ,
2000 . , , ,
,
, .
90 , :
1

if (2_digit_year >= 50) then


{

let century =19


else

let century =20


}

2049 ,

, , "",
. ,
.
248

IV.

IP , ,
.
IP ,
.
.
, ,
. . .2,
, , ..

. . 2.
, , 1, 2, 4, 8, ..,
..

. ..

. TCP/IP

249

.3.1.
, ,
(
).
, 28 . ,
100 50 .
. ,
20 . .

28

20

8 . 20 ,
.. , 10 .
, 5
. .

28

2 0 + 5

5 , , .. .
, , 1 .

28

2 0 + 5 + 1

1 ? , 1 2 ,
.

28

20+5+1+1

,
1 . ,
1 . .

28

2 0 + 5 + 1 + 1 + 1

.3.2.

. , 0 , 1 1, ""
, , .
, .
, 137.
. ., , 128.
128 137, . 1
.
128 137, .
250

IV.

137.

128

64, , 9, ,
64.
10

137

128 +0

,9

32 16 ( . .
) , 9, .
32 16 0 , ,
.
1000

137

128 + 0 + 0 + 0

8, 8 , 9,
. , 8 1, ,
, .
10001

137

128 + 0 + 0 + 0 + 8

,
. , , 8, 4. 4 1,
. 0.
100010

137

128 + 0 + 0 + 0 + 8 + 0

2 1.
0.
1000100$

137

128 + 0 + 0 + 0 + 8 +

0 + 0

. ,
, 1. 1 1, . ,
1 .
10001001

137

128 + 0 + 0 + 0 + 8 +
0 + 0 + 1

. TCP/IP

251

, 137
10001001.
255,
8 . , 255, . .
.

B.3.3.
, IP ,
1 , , ,
. , ,
255.255.252.0
8 :
11111111.11111111.11111100.00000000
, 255. 255.255.0, :
11111111.11111111.11111111.00000000

B.3.4.
. ,
IP .
, , . .1, IP
145.186.47.50. :
145.186.47.50 = 1 0010001.10111010.00101111.00110010
IP 2551255.252.0,
:
255.255.252.0 = 11111111.11111111.11111100.00000000
, , , ,
IP . IP , 1
IP . IP ,
0 , IP .
IP :

10010001.10111010.00101111.00110010

11111111.11111111.11111100.00000000

10010001.10111010.001011

11.00110010

B.3.5. IP
IP ,
. . . 1.
.1. IP

< 128
128 191
192 223

>223

252

255. 0. 0. 0
255.255.0.0
255. 255. 255. 0

IV.

.4. IP$
32 IP
16 , .
, IP
2
IP .
Unix
/etc/services. :
tftp
gopher
rj e
finger
http
www
link
kerberos
kerberos
supdup
hostnames
iso tsap
x400
x400 snd
csnet ns
pop 2

69/ udp
70/ t cp
#
77/ t cp
79/ tcp
80/ tcp
#
www
80/ tcp
# , http
87/ tcp
ttylink
88/udp
kdc # Kerberos udp
88/ tcp
kdc # Kerberos top
95/tcp
# BSD supdupd(8)
101/tcp
hostname #
102/ tcp
103/tcp
#
ISO Mail
104/tcp
105/ tcp
109/tcp
# PostOffice V.2

gopher

sri nic

, 80 http .
80 services
, Apache . Unix
, ,
/etc/services, , .
Windows services.
C:\Windows.

2 IP ,
. IP /.

. TCP/IP

253


IP

.1.
IP .
, IP ,
. . . 1
.
.1.

com

edu

gov

mil

( ).

net

,
, ,
.

org


. org .

int

, ,
. :
, / etc/ hosts C:\WINDOWS\hosts,
,
, NIS,
DNS (Domain Name Service).

254

IV.

.1.1.

/ etc/ hosts

/ etc/ hosts , IP- .


IP- . , ,
, .
/ etc/ hosts Unix- Windows-
:
192. 168. 100. 1
192. 168. 100. 80
192. 168. 100. 10

.1.2.

odi n. exampl e. com


f enri s. asgard. com f enri s
l oki . asgard. com l oki

nslookup

nsiookup Unix IP-. , IP- . ,


nsiookupw ww.apache.org
:
Server: ns2.mindspring.com
Address: 207.69.188.186
Non authoritative answer:
Name: www.apache.org

Address: 63.211.145.10
nsiookup ,
IP- (-, DNS ),
/ etc/ nsswitch. conf. ,
:
# /etc/nsswitch.conf
#

#
passwd:

shadow:
group:

compat

compat
compat

host s:
f i l es ni
net wor ks:
ni s f i
et hers:
ni s f i l
prot ocol s:
ni s f

rpc: ni s fi l es
services: nis files

s dns
l es dns
es
i l es

, DNS.
http://www.networksolutions.com.

. IP$

255


...
.1.
.2.
.. Unix/Linux
.4. ,
""
.5. ""

256
257
257
259
260

.1.
,
i. , ,
, Apache
. ,
, , Web
,
, Apache.
,
. ,
. , , ,
.
, , ,
. (
),
Unix. ,
Unix. , ,
,
. ,
, .
man, .

256

IV.

.2.
: ,
, .
, , ,
. ,
.
1. .
,
.
.
2. .
. , ,
.
3. . ,
.
4. . ,
. ,
,
. , .

.
, .

40 . 50 200
"''. 30
79,99 .

..
Unix/Linux
,
, ,
. Web :
,
( httpd)
, IP ,
Ethernet IP . ,
,
.
.1.

n e ts ta t

n e ts ta t

p ing

. ,

257

. .1

ifconfig

, route
IP .

nslookup

IP .

nslookup

, , . ,
Web , loki.
:
ping loki
ping , ,
( ) , .
:
PING loki (192.251.100.10): 56 data bytes
64 bytes from 192.251.100.10: icmp_seq=0 ttl= 32 time=0.8 ms
64 bytes from 192.251.100.10: icmp_seq=l ttl= 32 time= 0.7 ms
loki ping statistics
2 packets transmitted, 2 packets received, 0% packet loss
round trip min/avg/max = 0.7/ 0.7/ 0.8 ms
,
. ,
, . , ,
( loki) IP .
1

.
,
IP .
ping 192.251.100.10
"" IP , ,
( ) .
IP
2
/etc/hosts, . DNS
, . ,
DNS /
DNS .

IP

.
( Unix/Linux /etc/hosts) DNS.
2

Windows . ,
C:\WINDOWS Windows C:\WINNT Windows NT, hosts.

258

IV.

.4. ,
""
IP
: IP .
100%, IP .
netstat ,
. netstat,
.
netstat Unix ,
, r.
. :
n etstat r

:
Kernel IP routing table
D estination
Gateway Genmask
F lags M SS Window i r t t I face
192.251.100.0 *
255.255.255.0 U
1500 0
0
eth0
135.187.35.0
^
255.255.252.0 U
1600 0
0
ethl
127.0.0.0
*
255.0.0.0
U
3584 0
0
lo
default
odin
0.0.0.0
UG
1500 0
0
eth0

, Destination, ,
. ,
, 192 . 251.100 . 0.
IP ( IP 192. 251.100.70 loki
192.251.100.0 loki,
).
, ,
Iface , .
ethO. , ifconfig
.
ifconfig eth0

ifconfig ,
IP , (UP).
Red Hat Linux5 .2.
ethO

L ink en cap:E th ern et HWaddr 00:20:78:17:9A :E B

inet addr:192.251.100.1 B east:192.251.100.255


M ask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU. 1500 M etric:!

RX packets:90 errors:0 dropped:0 overruns:0 fram e:0


T X packets:1031 errors :0 dropped:0 overruns:0 carrier:0
collisions:0
Interrupt:11 Base address:0xef80

"UP", .
, , ,
. "UP",
"UP".

ifconfig.
ifconfig eth0 up

. ,

259

,
Ethernet .
( Linux; Web
).
( Web
). IP
3
RFC ( IP ).
( ).
ifconfig , "DP",
"" IP . "",
,
.

.4,1.
ifconfig .
. , ifconfig
Unix , , , ,

man. , HP UX 11.0 IP
192.251.100. 32 255.255.255.0:
ifconfig lan1 192.251.100.32 netmask 255.255.255.0

.5. ""
"" ,
. , ,
, .
, , .

.5.1.
( httpd),
ps.
, f
. Linux ps aux.
| grep httpd grep (global
regular expression parser ),

, httpd.
ps ef I grep httpd # HP UX
ps aux i grep httpd # Linux

,
httpd.

RFC, "Request For Comment" ("

"),
, Ethernet (RFC ***) TCP/IP (RFC ***).

260

IV.

.5.2. ?
Unix ,
.
4
80 http .
, ,
/etc/services. ,
:
cat / etc/ service | grep 80
:
http 80/ tcp
. ,
80 http . services
"http 80/tcp". "#" , ..
, .
,
.

.5.3.

root

, httpd,
, , ,
.
, root.
, ,
. Is l
chmod.

. , SMTP
25, telnet 23. ,
httpd 1234. , ,
, . ,
, .

. ,

261

UNIX
...
.1.

262

.2.

263

..

264

.1.

Unix,
Apache.
. , ,
, Unix,
man. ,
man sendmail
sendmail.
/etc/hosts. , , IP .
/etc/services. .
, , inetd (.
, ) , ,
.
/etc/passwd. .
. . .
name:encrypted_password:UID:GID:user
name:home_directory:shell
.1.

name

, .

UID

,
. , ID
;
.

262

IV.

. . 1

GID

UID, ,
.

user name

, Scott
Hawkins. .
finger .

/home/directory .
shell

(ksh, bash ..),


.

/etc/group. , .
, ,
, .

.2.
, .
, , .
,
pid.
fork().
, ls <enter>,
, ,
( ,
pid).
ls, exec(). ,
init.
, fork() ,
, .
PPID; ,
.
,

( . /usr/include/linux/signal.h).
19 (
) 20 ( ),
, .
0.
(
), ( ).
(. . .2
, &, ^Z, bg, fg jobs).
,
, .
,
, . .2.

. Unix

263

.2.

&

^Z , .
bg

fg

fuser

pid , .

jobs

ja il

k illa ll
nice
nohup
pidof

, .
.
, .
pid .
.

ps
pstree
renice
top

.
.
.

, .

..
Linux. ,
(.. ),
. ,

( rwhod),
( lpd) ,
( httpd, telnetd, talkd).
.
:
r ,
in it ,
inetd (
tcpd).
, inetd ,
/etc/services.
Internet ,
. , ,
. Internet ,
264

IV.

,
. ,
.
1
/etc/services / .
,
.
inetd ( ).
inetd
( ), .
, inetd,
/etc/inetd.conf ( . .):
service socket_type protocol wait user program arguments
.. in e td

service
socket_type

/etc/services.
(stream| dgram| raw| rdm| seqpacket).

protocol

( tcp, udp)
/etc/protocols.

wait

user

, .

program

,
inetd .

arguments

, , httpd
inetd. inetd
80 ( 443,
). , , Web
, httpd.
, ,
.
, Apache ,
,
. ,
httpd .
MaxSpareServers MinSpareServers.

, ,
/etc/passwd.

. Unix

265

WINDOWS NT

.1.
Windows NT GUI
. ,
. , ,
Unix, , ,
, .
.
,
Start=>Settings=>Control Panel,

, Start,
Settings Control Panel.
,
Unix, NT:
Windows NT administrator
Unix root. NT,
.
User Manager for Domains. ,
:
Start=>Programs=>Administrative Tools (common)
Windows,
.

Control Panel. Apache
Network.
Windows
. :

\\computername\shared_resource\sudirl\...\subdirN\filename
, , , :
\ \ Loki \ hpl j 5

266

IV.

.1.1.
Windows NT
.
TCP/IP.
:
Start=>Settings=>Control Panel=>Network

, Protocols, TCP/IP
Properties. , ,
. .1.

. .1. TCP/IP Windows NT

TCP/IP DNS

. WINDOWS NT

267

HTTP
...
3.1.

268

3.2. 1:

268

3.3. 2:

269

3.4. :

269

3.5. 4:

270

3.6. 5:

271

3.1.
HTTP
:
1: . , .
2: . , .
: . ,
.
4: .
.
5: . .

3.2.1:
3.2.1. 100 Continue
.

3.2.2.

101 Swi tchi ng Protocol s

268

IV.

3.3. 2:

3.3.1. 200 :

3.3.2. 201 Created: HTTP_CREATED


, . (

PUT.)

3.3.3. 202 Accepted: HTTP_ACCEPTED


, .

3.3.4. 203 Non Aut hor i t at i ve I nf or mat i on:


HTTP_NON_AUTHORI TATI VE
.

3.3.5. 204 No Content: HTTP_NO_CONTENT


, .

3.3.6. 205 Reset Content


,
.

3.3.7. 206 Part i al Cont ent


GET .

3.4. :
3.4.1. 300 Mul t i pl e Choi ces:
HTTP_MULTI PLE_CHOI CES
, ,
.

3.4.2. 301 M oved Permanently:


HTTP_MOVED_PERMANENTLY
URI.

3.4.3. 302 Found: HTTP_FOUND


URI.

3. HTTP

269

3.4.4. 303 See Other: HTTP_SEE_OTHER


URI.
, GET .

3.4.5. 304 Not M odified: HTTP_NOT_MODIFIED


, GET
, .

3.4.6. 305 Use Proxy: HTTP_USE_PROXY


proxy,
Location. Location URI p roxy.

3.4.7. 307 Temporary Redirect:


HTTP_TEMPORARY_REDIRECT
URI.
,
Request URI.
:

3.5. 4:
3.5.1. 400 Bad Request
.

3.5.2. 401 U nauthorized


.

3.5.3.

402 Payment

Requi red

, .

3.5.4. 403 Forbidden


, .
.

3.5.5. 404 Not Found


Request URI.

3.5.6. 405 M ethod Not Allowed


, Request Line, , Request URI.

3.5.7. 406 Not Acceptable


, , ,
, .

270

IV.

3.5.8.

407 Proxy Authenti cati on Requi red

401 (Unauthorized),
proxy.

3.5.9. 408 Request Time out


.

3.5.10. 409 Conflict


.

3.5.11. 410 Gone


, ,
.

3.5.12. 411 Length Required


Content Length.

3.5.13. 412 Precondition Failed



.

3.5.14. 413 Request Entity Too Large


, ,
.

3.5.15. 414 Request URI Too Large


, Request URI
, .

3.6. 5:
3.6.1.

500 Internal

Server Error

3.6.2. 501 Not Implemented


, .

3.6.3. 502 Bad Gateway


, proxy,
, .

3.6.4.

503 Servi ce Unavai l abl e

,
.
3. HTTP

271

3.6.5. 504 Gateway Time out


proxy,
.

3.6.6. 505 HTTP Version not supported


HTTP,
.

272

IV.

.1.
,
,
.
( "",
"" "z"), "I". ,
( ) "0" ""
(, {1,2,3} {2,3,4}
{1,2,3,4}). "*"
. , "" ""

"" ,
:
1. "0" "2".
2. "" "" ,
"ab".
3. "" "" ,

"aub".
4. "" , "*".
5. , , . 1
4, .

, ,
.
,
. ASCII
,
Internet .
.
, (,
),
.

273

"\". , "wor.."
"worry", "worst" "words", a "wor.\." "word.",
"work." ..

.1.1.
. ,
, abed:
^abcd
. ,
, abed:
abcd$
.

.1.2.

, . ,
[0123456789]

.
ASCII 0 9:
[0 9]

[A Z] [a z],
.
, "^",
,
. ,
, :
[^0 9]

.1.3.
,
. :
+

? 0 1 .
1
.
0
.

, 0 1 ,
:

[aeiou]?

, 1 ,
:

[0 9]

274

IV.

, ,
:

^[A Za z]

.1.4.
,
.
. , , :
[A Za z]*([0 9])[A Za z]*

( ),
. .
, , :
$1
$2, $3 ..

275

MOD_PERL API

.1.
mod_perl.
$r , Perl .

.1.1.
$r = Apache$>request () ;
$st r = $r$>args();
$ = $r$>connect i on;
$st r = $r$>cont ent () ;
$st r = $r$>f i l ename($newval ) ;
$r$>f i nf o();
$st r = $r$>get _remot e_host ($l ookup_t ype);
$st r = $r$>get _remot e_l ogname();
$st r = $r$>header_i n($hdr,
$newval );
$bool
= $r$>header_onl y();
$href
= $r$>headers_i n();
$st r = $r$>met hod($newval ) ;
$num = $r$>met hod_number($nv);
$u = $r$>parsed_uri ();
$st r = $r$>pat h_i nf o($newval ) ;
$st r = $r$>prot ocol ();
$bool
= $r$>proxyreq($newval );
$r$>read($buf ,
$byt es_t o_read);
$s = $r >ser ver # CM. Apache: : Server

$st r
$st r

=
=

$r$>t he_request () ;
$r$>uri ($newval );

K.1.2.
$num = $r$>byt es_sent ();
$r$>cgi _header_out ($hdr,
$newval );
$st r = $r$>cont ent _encodi ng($newval );
$aref
= $r$>cont ent _l anguages($newval );
$st r = $r$>cont ent _t ype($newval );
$r$>cust om_response($code,
$uri );

276

IV.

$st r = $r$>err_header_out ($hdr,


$newval );
$href
= $r$>err_headers_out ();
$st r = $r$>handl er($newval ) ;
$st r = $r$>header_out ($hdr,
$newval );
$href
= $r$>headers_out (};
$bool
= $r$>no_cache($newval );
$num = $r$>request _t i me();
$num = $r$>st at us($newval );
$st r = $r$>st at us_l i ne($newval );

K.1.3.
$r$>pri nt (@l i st );
$r$>pri nt f ($f ormat ,
@ar gs) ;
$r$>rf l ush();
$r$>send_cgi _header($st r);
$l en = $r$>send_f d($f i l ehandl e);
$r$>send_ht t p_header($cont ent _t ype);

K.1.4.
$r$>chdi r_f i l e($f i l e);
$r$>chi l d_t ermi nat e();
$r$>hard_t i meout ($msg);
$r$>i nt ernal _redi rect ($newpl ace);
$r$>i nt ernal _redi rect _handl er($newpl ace);
$bool
= $r$>i s_i ni t i al _req();
$bool
= $r$>i s_mai n(};
$r$>ki l l _t i meout ();
$st r = $r$>l ocat i on ();
$req = $r$>l ast ();
$req = $r$>mai n();
$req = $r$>next ();
$st r = $r$>not es($k,
$v);
# $t ab =
$req = $r$>prev();
$r$>regi st er_cl eanup($code_ref );
$r$>reset _t i meout ();
$r$>sof t _t i meout ($msg);
$st r = $r$>subprocess_env($k,
$v);

$r$>not es()

K.1.5.
$st r = $r$>di r_conf i g($k);
$st r = $r$>document _root ();
$st r = $r$>get _server_name();
$num = $r$>get _server_port ();
$st r = $r$>server_root _rel at i ve($obj );

K.1.6 Apache: : Log


$st r = $r$>as_st ri ng();
$r$>l og_reason($message,
$f i l e);
$r$>l og_error($message);
$r$>warn($message);
$l og = $r$>l og();
$l og = $s$>l og();
$l og$>emerg($st r . ..
$code_ref );
$l og$>al ert ($msg . . .
$code_ref );
$l og$>cri t (5msg . . .
$code_ref );
$l og$>error($msg . . .
$code_ref );
. mod_perl API

277

$l
$l
$l
$l

og$>warn($msg ...
$code_ref );
og$>not i ce($msg . ..
$code_ref );
og$>i nf o($msg . . .
$code_ref );
og$>debug($msg . . .
$code_ref );

K.1.7.
$opt s = $r$>al l ow_opt i ons();
$st r = $r$>aut h_name($newval ) ;
$st r = $r$>aut h_t ype();
($rc, $pw) = $r$>get _basi c_aut h_pw();
$r$>not e_basi c_aut h_f al l ure() ;
$aref = $r$>requi res();
$f l ag = $r$>sat i sf i es();
$bool = $r$>some_aut h_requi red() ;

K.1.8. mod_perl
$st r = $r$>current _cal l back();
$bool
= $r$>def i ne($name);
Apache$>exi t ($code);
$f h = Apache$>gensyra();
$aref = $r $>get _handl er s( $st r ) ;
Apache$>ht t pd_conf ($st r);
$bool = $r$>modul e($name);
$bool
= Apache$>perl _hook($name);
$r$>post _connect i on($code_ref );
$r$>push_handl ers($st r => $code_ref );
$r = Apache$>request ($r);
$r$>set _handl ers($st r => $aref );

K.1.9. Apache::SubRequest
$subr = $r$>l ookup_uri ($uri );
$subr = $r$>l ookup_f l i e($f i l ename);
$rc = $subr$>run();

K.1.10. Apache: : Server


$s = Apache$>server
$bool
= $s$>i s_vi rt ual ();
$s$>l og_error();
$aref
= $s$>names();
$s = $s$>next ();
$num = $s$>port ();
$st r = s$>server_admi n();
$st r = s$>server_host name() ;
$num = s$>t i meout ($newval );
$s$>warn();

K.1.11. Apache::Connection
$bool
$st r
$addr
$addr
$st r
$st r
$st r
$st r

278

=
=
=
=
=
=
=
=

$c$>abort ed();
$c$>aut h_t ype();
$c$>l ocal _addr();
$c$>remot e_addr($addr);
$c$>remot e_host ();
$c$>remot e_i p($i p);
$c$>remot e l ogname();
$c$>user($username);
IV.

.1.12. Apache: : Tabl e


St ab = Apache: : Tabl e$>new($r,
$t ab$>add($key, $st r_or_aref )
$t ab$>cl ear();
$t ab$>do($code_ref );
$t ab$>merge($key,
$st r_or_aref );
$t ab$>set ($key,
$st r);
$str = $t ab$>get ($key);
$t ab$>unset ($key);

K.1.13. Apache::URI
$uri
= Apache: : URI $>parse($r,
$st ri ng_uri );
$st r = $uri $>unparse();
$st r = $uri $>cowponent ($newval ) ;
( component :
f ragment ,
host i nf
o,
host name,
password,
pat h_i nf o,
pat h,
port ,
query,
rpat h,
scheme,
user)

K.1.14. Apache: :U til


$st r = Apache: : Ut i l : : escape_ht ml ($ht ml );
$st r = Apache: : Ut i l : : escape_uri ($uri ) ;
$st r = Apache: : Ut i l : : ht _t i me($t i me,
$fmt, $bool )
$secs = Apache: : Ut i l : : parsedat e($dat e_st r);
$num = Apache: : Ut i l : : si ze_st ri ng($num);
$st r = Apache: : Ut i l : : unescape_uri ($uri );
$st r = Apache: : Ut i l : : unescape_uri _i nf ($uri );

. mod_perl API

279


...
.1. Apache
.2.
..
.4. GZlib
.5. DBM
.6.

281
283
284
285

.7. dBase

286

.8. DBM
.9.
.10.
.11.

287
287

.12. FilePro
.13. File System Functions
.14. FDF
.15. FTP
.16.
.17. HTTP
.18. Informix
.19.

288
288
291
292
293
293
293
295

.20.
.21. MS SQL
.22.
.23. mSQL
.24. , MySQL

295
297
299

.25.
.26. NIS
.27. ODBC
.28. Oracle
.29. Oracle 8
.. Perl
.31. POSIX
.32.

303
304
304
307
307
309
309
311

.. Recode
.34. ,
.35. SNMP
.36.
.37. Sybase
.38. URL
.39. ,

280

311
313
316
316
317

IV.

.1. Apache
apache_lookup_uri. URI
.
class apache_lookup_uri(string filenam e)

apache_note. Apache.
string apache_note(string note_name[, string note_value])

getallheaders. HTTP .
ar r ay

get al l headers(voi d)

virtual. Apache.
int virtual(string filenam e)

.2.

bcadd. .
string bcadd(string left operand,
string right operand [, int scale])
bccomp. .
int bccom p(string left_operand, string right_operand [, int scale])
bcdiv. .
string bcdiv(string left_operand, string right_operand [, int scale])
bcmod. .
strin g bcmod(string left operand, strin g modulus)
bcmul. .
string bcm ul(string left operand, string right operand [, int scale])

bcpow. ,
.
string bcpow (strin g x, string [, int scale] )
bcscale. .
string bcscale (int scale)
bcsqrt. .
string bcsgrt(string operand, int scale)

bcsub. .
string bcsub(string left_operand, string right_operand [, int scale])

..
array. .
array array( .. .)

array_count_values. .
array array_count_values(array input)

array_flip. .

281

array array_flip(array trans)


array_keys. .
array array_keys(array input [, mixed search_value])
array_merge. .
array array_m erge(array arrayl, array array2 [, array . . . ] )
array jad. .
array array_pad(array input, int pad_size, mixed pad_value)
arrayjpop. .
mixed array_pop(array array)
array_push. .
int array_push(array array, mixed var [, mixed . . . ] )
array_reverse. ,
.
array array_reverse(array array)
array_shift. .
mixed array_shift(array array)
array_slice. .
array array_slice(array array, int offset [, int length])
array_splice. .
array array_splice(array input, int offset [ , int length [, array
replacement]])
array_unshift. .
int array_unshift(array array, [mixed var, mixed . . . ] )
array_values. .
array array_values(array input)
array_walk. .
int array_walk(array arr, string func, mixed userdata)
arsort. .
void arsort(array array)
asort. .
void asort(array array)
compact. , .
array compact(mixed varname | [ m ixed...] )
count. .
i nt
count ( mi xed var )
current. .
mixed current(array array)
each. .
array each(array array)
end. .
end(array array)
extract. .
void extract(array var_array, [int extract_type], [string prefi x] )

282

IV.

in_array. "", .

bool in_array(mixed needle, array haystack)


key. .

mixed key(array array)


krsort. .

int krsort(array array)


ksort. .

int ksort(array array)


list. , .

void list (...)


next. .

mixed next(array array)


pos. .

mixed pos(array array)


prev. "" .

mixed prev(array array)


range. , .

array range(int low, int high)


reset. .

mixed reset(array array)


rsort. .

void rsort(array array)


shuffle. .

void shuffle(array array)


sizeof. .

int sizeof(array array)


sort. .

void sort (array array)


uasort.
.
void uasort(array array, function cm p_function)

uksort. ,
.

void uksort(array array, function cmp_function)


usort. ,
.

void usort(array array, function cmp_function)

.4. GZlib
, gzip.
gzclose. gz .

int gzclose(int zp)


gzeof. gz .
.

283

int gzeof(int zp)


gzfile. gz .
array gzfile(string filename [, int use_include_path])
gzgetc. gz .
st ri ng gzget c( i nt zp)
gzgets. .
string gzgets(int zp, int length)
gzgetss. gz HTML.
string gzgetss(int zp, int length [, string allowable_tags])
gzopen. gz .
int gzopen(string filename, string mode [, int use_include_path])
gzpassthru. gz .
int gzpassthru(int zp)
gzputs. gz .
int gzputs(int zp, string str [, int length])
gzread. gz .
string gzread(int zp, int length)
gzrewind. gz .
i nt

gzrewi nd(i nt

zp)

gzseek. gz .
int gzseek(int zp, int offset)
gztell. gz /.
in t gztell(in t zp)
gzwrite. gz .
int gzwrite(int zp, string string, int [, int length])
readgzfile. , gz.
int readgzfile(string filename, [int use_include_path])
gzcompress. gz.
string gzcom press(string data [, int level])
gzuncompress. , gz.
string gzcompress(string data [, int length])

.5. DBM
DBM.
dba_close. .
void dba_close(int handle)
dba_delete. , .
string dba_delete(string key, int handle)
dba_exists. .
bool dba_ex ists(string key, int handle)
dba_fetch. , .
string dba_fetch(string key, int handle)
284

IV.

dba_firstkey. .
string dba_firstkey(int handle)
dba_insert. .
bool dba_insert(string key, string value, int handle)
dba_nextkey. .
string dba_nextkey(int handle)
dba_popen. .
int dba_popen(string path, string mode, string handler [,
dba_open. .
int dba_open(string path, string mode, string handler [, . . . ] )
dba_optimize. .
bool dba_optimize(int handle)
dba_replace. .
bool dba_replace(string key, string value, int handle)
dba_sync. .
bool dba_sync(int handle)

.6.
checkdate. /.
int checkdate(int month, int day, int year)
date. /.
string date (string format, tint timestamp])
getdate. /.
array getdate( int timestamp)
gettimeofday. .
ar r ay

get t i meof day(voi d)

gmdate. /.
string gmdate(string format, int timestamp)
gmmktime. Unix GMT.
int gmmktime (int hour, int minute, int second, int month, int day,
int year [, int is_dst]);
gmstrftime. / .
string gmstrftime(string format, int timestamp)
localtimex. .
microtime. Unix .
st ri ng mi crot i me(voi d)
mktime. Unix .
int mktime(int hour, int minute, int second, int month, int day, int
year, [int is_dst])
strftime. /
.
string strftime(string format, int timestamp)
time. Unix.
.

285

int time(void)
strtotime.
Unix.
int strtotime(string time [, int now] )

.7.
dBase
dBase.
dbase_create. dBase.
int dbase_create(string filename, array fields)
dbase_open. dBase.
int dbase_open(string filename, int flags)
dbase_close. dBase.
bool dbase_close(int dbase_identifier)
dbase pack. dBase.
bool dbase_pack(int dbase_identifier)
dbase_add_record. dBase.
bool dbase_add_record(int dbase_identifier, array record)
dbase_replace_record. dBase.
bool dbase_replace_record(int dbase_identifier, array record, int
dbase_rerd_number)
dbase_delete_record. dBase.
bool dbase_delete_record(int dbase_identifier, int record)
dbase_get_record. dBase.
array dbase_get_record(int dbase_identifier, int record)
dbase_get_record_with_names. dBase
.
array dbase_get_record_with_names(int dbase_identifier, int recodr)
dbase_numfields. dBase.
int dbase_numfields (int dbase_identifier)
dbase_numrecords. dBase.
int dbase_numrecords(int dbase_identifier)

.8. DBM
dbmopen. DBM.
int dbmopen(string filename, string flags)
dbmclose. DBM.
bool dbmclose(int dbm_identifier)
dbmexists. DBM.
bool dbmexists(int dbm_identifier, string key)
dbmfetch. DBM .
string dbm fetch(int dbm_identifier, string key)

286

IV.

dbminsert. DBM .
int dbm insert(int dbm _identifier, string key, string value)
dbmrcplace. DBM .
bool dbm replace(int dbm _identifier, string key, string value)
dbmdelete. DBM .
bool dbmdelete(int dbm_identifier, string key)
dbmfirstkey. DBM.
string dbm firstkey(int dbm_identifier)
dbmnextkey. DBM.
string dbm nextkey(int dbm _identifier, string key)
dblist. DBM- .
st r i ng dbl i st ( voi d)

.9.
chdir. .
int chdir(string directory)
dir. .
new dir(string directory)
closedir. .
void closedir (int dir_handle)
opendir. .
int opendir(string path)
readdir. .
string readdir(int dir_handle)
rewinddir. "" .
void rewinddir(int dir_handle)

.10.
dl. PHP- .
int dl(string library)

.11.
mcrypt_get_cipher_name. .
string mcrypt_get_cipher_name(int cipher)
mcrypt_get_block_size. .
int mcrypt_get_block_size(int cipher)
mcrypt_get_key_size. .
int mcrypt_get_key_size(int cipher)
mcrypt_create_iv. (IV) .
string m crypt_create_iv(int size, int source)
mcrypt_cbc. .

287

string mcrypt_cbc(int cipher, string key, string data, int mode


[, string i v] )
mcrypt_cfl>. .
int mcrypt_cfb(int cipher, string key, string data, int mode, string iv)
mcrypt_ecb. .
int mcrypt_ecb(int cipher, string key, string data, int mode)
mcrypt_ofb. OFB.
int mcrypt_ofb(int cipher, string key, string data, int mode, string iv)

.12. FilePro
filepro. .
bool filepro(string directory)
fflepro_fieldname. .
string f ilepro_fieldname (int fiel'd_number)
filepro_fieldtype. .
string filepro_fieldtype(int field_number)
filepro_fieldwidth. .
int filepro_fieldwidth(int field_number)
filepro_retrieve. FilePro.
string filepro_retrieve(int row_number, int field_number)
filepro_fieldcount. FilePro.
int filepro_fieldcount(void)
filepro_rowcount. FilePro.
i nt f i l epro_rowcount (voi d)

.13. File System Functions


basename. .
st ri ng basename(st ri ng pat h)
chgrp. .

i nt

chgr p (st ri ng f i l ename,

mi xed gr oup)

chmod. .
i nt
chmod( st r i ng f i l ename,
i nt
chown. .
i nt chown( st r i ng f i l ename,

mode)

mi xed user )

clearstatcache. .
void clearstatcache(void)
copy. .
int copy(string source, string dest)
delete. .
void delete(string file)
dirname. .
string dirname(string path)

288

IV.

diskfreespace. , .
float diskfreespace(string directory)

fclose. .
int fclose(int fp)

feof. .
int feof(int fp)
fgetc. .
string fgetc(int fp)

fgetcsv.
CSV.
array fgetcsvfi n t fp, i n t length, [string, delimiter])

fgets. .
string fgets(int fp, int length)

fgetss. HTML.
string fgetss(int fp, int length, [string allowable_tags])

file. .
array file (string filenam e [, int use_include_path])

file_exists. .
int file_exists(string filenam e)

fileatime. .
int fileatime(string filename)

filectime. .
int filectime(string filename)

filegroup. , .
int filegroup(string filename)

fileinode. inode .
int fileinode(string filename)

filemtime. .
int filemtime(string filename)

fileowner. .
int fileowner(string filename)

ffleperms. .
int fileperms(string filename)

filesize. .
int filesize(string filename)

filetype. .
string filetype(string filenam e)

flock. , .
bool flock(int fp, int operation)

fopen. URL.
int fopen(string filename, string mode [, int use_include_path])

fpassthru. .
i nt

f passt hru(i nt

f p)

289

fputs. .
int fputs(int fp, string str [, int length])
fread. .
string fread(int fp, int length)
fseek. .
int fseek(int fp, int offset)
ftell. "/".
in t ftell(in t fp)
fwrite. .
int fwrite(int fp, int buffer)
is_dir. , filename .
bool is_dir(string filename)
is_executable. , filename .
bool is_executable(string filename)
is_file. , filename .
bool is_f ile(string filename)
is_link. , filename .
bool is_link(string filename)
is_readable. , filename .
bool is_reada ble(string filename)
is_writeable. , filename .
bool is_writeable(string filename)
link. .
int link(string target, string link)
linkinfo. .
int linkinfo(string path)
mkdir. .
int mkdir(string pathname, int mode)
pclose. .
int pclose (int fp)
popen. .
int popen(string command, string mode)
readfile. .
int readfile(string filename [, int use_include_path])
readlink. .
string readlink(string path)
rename. .
int rename(string oldname, string newname)
rewind. .
int rewind(int fp)
rmdir. .
int rmdir(string dirname)

290

IV.

stat. .
array stat(string filenam e)
lstat. .
array lstat(string filenam e)
symlink. .
in t sym lin k(strin g target, string lin k)
tempnam. .
string tem pnam (string dir, string prefix)
touch. .
int touch(string filename, int time)
umask. umask.
i nt umask( i nt mask)
unlink. .
int unlink (string filename)

.14.
FDF$
FDF .
fdf_open. FDF .
int fdf_open(string filename)
fdf_close. FDF .
void fdf_close(int fdf_docum ent)
fdf_create. FDF .
fdf_save. FDF .
int fdf_save(string filename)
fdf_get_value. .
strin g fdf_get_value(int fdf_document, strin g fieldname)
fdf_set_value. .
void fdf_set_value(int fdf_document, strin g fieldname, strin g value,
int isName)
fdf_next_field_name. .
strin g fdf_next_field_name(int fdf_document, strin g fieldname)
fdf_set_ap. .
void fdf_set_ap(int fdf_document, string field_name, int face,
strin g filename, int page_number)
fdf_set_status. /STATUS.
void fdf_set_status(int fdf_document, strin g status)
fdf_get_status. /STATUS.
strin g fdf_get_status(int fdf_document)
fdf_set_file. /STATUS.
void fdf_set_file(int fdf_document, strin g filename)
fdf_get_flle. /F.
strin g fdf_get_file(int fdf_document)
. PHP

291

.15. FTP$
, (File Transfer Protocol).
ftp_connect. F .
int ftp_connect(string host [, int port])
ftp_login. F-.
int ftp_login(int ftp_stream, string username, string password)
ftp_pwd. .
int ftp_pwd(int ftp_stream)
ftp_cdup. .
int ftp_cdup(int ftp_stream)
ftp_chdir. FTP-.
int ftp_chdir(int ftp_stream , string directory)
ftp_mkdir. .
string ftp_m kdir(int ftp_stream , string directory)
ftp_rmdir. .
int ftp_rm dir(int ftp_stream , string directory)
ftp_nlist. .
int ftp_nlist(int ftp_stream , string directory)
ftp_rawlist. .
int ftp_rawlist(int ftp_stream, string directory)
ftp_systype. FTP-.
int ftp_systype(int ftp_stream)
ftp_pasv. / .
int ftp_pasv(int ftp_stream, int pasv)
ftp_get. FTP-.
int ftp_get(int ftp_stream , string local_file, string rem ote_file,
int mode)
ftp_fget. FTP .
int ftp_fget(int ftp_stream, int fp, strin g remote_file, int mode)
ftp_put. FTP-.
int ftp_put(int ftp_stream , string rem ote_file, string local_file,
int mode)
ftp_fput. FTP .
int ftp_fput(int ftp_stream, string remote_file, int fp, int mode)
ftp_size. .
int ftp_size(int ftp_stream, string remote_file)
ftp_mdtm. .
int ftp_mdtm(int ftp_stream, strin g remote_file)
ftp_rename. FTP .
int ftp_rename(int ftp_stream, strin g from, string to)

ftp_delete. FTP .

int ftp_delete(int ftp_stream, string path)

292

IV.

ftp_site. SITE.
int ftp_site(int ftp_stream , string cm d)
ftp_quit. F .
int ftp_quit(int ftp_stream)

.16. $
, mhash.
mhash_get_hash_name. .
string mhash_get_hash_name(int hash)
mhash_get_block_size. .
int mhash_get_block_size(int hash)
mhash_count. .
int mhash_count(void)
mhash. .
string mhash(int hash, string data)

.17. HTTP
, .
header. HTTP.
int header(string string)
setcookie. cookie.
int setcookie(string name, string value, int expire, string path,
string domain, int secure)

.18. Informix
Informix.
ifx_connect. Informix.
int ifx_connect([ string database [, string userid [, string
password]]])
ifx_pconnect. Informix.
int ifx_pconnect([ string database [, string userid [, string
password]]])
ifx_close. Informix.
int ifx_close([int link_identifier])
ifx_query. Informix.
int ifx_query(string query [, int link_identifier [, int cursor_type
[, mixed blobidarray]]])
ifx_prepare. SQL .
int ifx_prepare(string query, int conn_id [, int cursor_def, mixed
blobidarray])
ifx_do. SQL.
int ifx_do(int result_id)

ifx_error. Informix.
.

293

st ri ng i f x_error(voi d)
ifx_errormsg. Informix.
string ifx_errorm sg([ int errorcode] )

ifx_affected_rows. , .
int ifx_affected_rows(int result_id)

ifx_getsqlca. sqlca. sqlerrd [ 0. . 5 ] .


array ifx_getsqlca (int result_id)

ifx_fetch_row. .
array ifx_fetch_row (in t result_id [, m ixed position] )

ifx_htmltbl_result. HTM L .
int ifx_htm ltbl_result(int result_id [, string htm l_table_options])

ifx_fieldtypes. Informix.
array ifx_fieldtypes(int result_id)

ifx_fieldproperties. Informix.
array ifx_fieldproperties(in t result_id)

irx_num_fields. .
int ifx_num _fields(int result_id)

ifx_num_rows. , .
int ifx_num _rows(int result_id)

ifx_free_result. .
in t ifx_ free_ result(in t result_id)

ifx_create_char. char.
int ifx_create_char(string param)

ifx_free_char. char.
int ifx_free_char(int bid)

ifx_update_char. char.
int ifx_update_char(int bid, string content)

ifx_get_char. char.
int ifx_get_char(int bid)

ifx_create_blob. blob.
int ifx_create_blob(int type, int mode, stri n g param)

ifx_copy_blob. blob.
int ifx_copy_blob(int bid)

ifx_free_blob. blob.
int ifx_free_blob(int bid)

ifx_get_blob. blob.
int ifx_get_blob(int bid)

ifx_update_blob. blob.

ifx_update_blob(int bid, string content)


ifx_blobinffle_mode. blob select.
void ifx_blobinfile_m ode(int mode)

ifx_textasvarchar. .

294

IV.

void ifx_textasvarchar(int mode)


ifx_byteasvarchar. .
void ifx_byteasvarchar(int mode)
ifx_nullformat. , .
void ifx_nullformat(int mode)
ifxus_create_slob. slob .
int ifxus_create_slob(int mode)
ifx_free_slob. slob.
ifxus_close_slob. slob.
int ifxus_close_slob(int bid)
ifus_n_slob. slob.

int ifxus_open_slob(long bid, int mode)


ifxus_tell_slob. seek.
int ifxus_tell_slob(long bid)
ifxus_seek_slob. seek.
ifxus_read_slob. nbytes slob.
int ifxus_read_slob (long bid, long nbytes)
ifxus_write_slob. slob.
int ifxus_write_slob(long bid, string content)

.19.
.
mail. .
bool mai l(string to, string subject, string message [, string
additional headers])

.20.
abs. .
mixed abs(mixed number)
acos. .
float acos(float arg)
asin. .
float asin(float arg)
atan. .
float atan(float arg)
atan2. .
float atan2(float y, float x)
base_convert.
.
strin base_convert(string number, int frombase, int tobase)
bindec. .
int bindec(string binary_string)
.

295

ceil. .
int ceil(float number)
cos. .
float cos(float arg)
decbin. .
string decbin(int number)
dechex. .
string dechex(int number)
decoct. .
string decoct(int number)
deg2rad. .
double deg2rad(double number)
exp. .
float exp(float arg)
floor. .
int floor(float number)
getrandmax. .
int getrandmax(void)
hexdec. .
int hexdec(string hex_string)
log. .
float log (float arg)
log10. 10.
float log10(float arg)
max. .
mixed max(mixed argl, mixed arg2, mixed argn)
min. .
mixed min(mixed argl, mixed arg2, mixed argn)
mt_rand. .
int mt_rand(int mt_rand([int min [, int max]])
mt_srand. .
void mt_srand(int seed)
mt_getrandmax. .
int mt_getrandmax(void)
number_format. .
string number_format(float number, int decimals, string dec_point,
string thousands_sep)
octdec. .
int octdec(string octal_string)

pi. "".
double pi(void)
pow. .
f l oat
pow(f l oat
base,
f l oat
exp)
296

IV.

rad2deg. , ,
, .
double rad2deg(double number)
rand. .
int rand([int min [, int max]])
round. .
double round(double val)
sin. .
f l oat si n (fl oat

ar g)

sqrt. .
float sqrt (float arg)
srand. .
void srand(int seed)
tan. .
f l oat
t an(f l oat

arg)

.21. MS$SQL
Microsoft SQL.
mssql_close. MS SQL.
int mssgl_close([int link_identifier])
mssql_connect. MS SQL.
int mssql_connect([string servername [, string username [, string
password]]])
mssql_data_seek. .
int mssql_data_seek(int result_identifier, int row_number)
mssql_fetch_array. .
int mssql_fetch_array(int result)
mssql_fetch_fleld. .
object mssql_fetch_field(int result)
mssql_fetch_object. .
int mssql_fetch_object(int result)
mssql_fetch_row. .
array mssql_fetch_row(int result)
mssql_field_length. .
int mssql_field_length(int result [, int field_offset]])
mssql_field_name. .
int mssql_field_name(int result [, int offset] )
mssql_field_seek. .
int mssql_field_seek(int result, int field_offset)
mssql_field_type. .
string mssql_field_type(int result [, int offset] )
mssql_free_result. .

i nt

mssql _f ree_resul t (i nt

. PHP

resul t )
297

mssql_get_last_message. .
stringm ssql_get_last_message
mssql_min_error_severity. .
void mssql_min_error_severity
mssql_min_message_severity.
.
void mssql_min_message_severity(int severity)
mssql_num_fields. , .
int mssql_num_fields(int result)
mssql_num_rows. .
int mssql_num_rows(stringr esult)
mssql_pconnect. MS SQL.
int mssql_pconnect([string servername [, string username [, string
password]]])
mssql_query. MS SQL.
int mssql_query(string query [, int link_identifier])
mssql_result. .
int mssql_result(int result, int i, mixed field)
mssql_select_db. MS SQL.
int mssql_select_db(string database_name [, int link_identifier])

.22.
, .
connection_aborted. "", .
int connection_aborted(void)
connection_status. .
int connection_status(void)
connection_timeout. ""
.
int connection_timeout(void)
define. .
int define(string name, mixed value [, int case_insensitive])
defined. .
int defined(string name)
die. .
void die(string message)
eval. PHP .
void eval(string code_str)
exit. .

void exit(void)
func_get_arg. .
int func get arg(int arg num)
func_get_args. , .
298

IV.

i nt

f unc_get _args(voi d)

func_num_args. , .
i nt f unc_num_args(voi d)
function_exists. "", .

int function_exists(string function_name)


get_browser. .
object get_browser([string user_agent])

ignore_user_abort. ,
.
int ignore_user_abort([int settin g] )
iptcparse. IPTC http:/ / www.xe.net/ iptc/ block
.
array iptcparse(string iptcblock)
leak. .
int ignore_user_abort(int bytes)
pack. .
strin g pack(string format [, mixed args . . . ] )

register_shutdown_function.
.
int

register_shutdown_function(string func)

serialize. .
string serialize(m ixed value)

sleep. .
void sleep(int seconds)

uniqid. .
int uniqid(string prefix [ , boolean leg] )

unpack. .
array un pack(strin g form at, string data)

unserialize. PHP .
m ixed unserialize(string str)
usleep. ( ).
void usleep(int m icro_seconds)

.23. mSQL
mSQL.
msql. mSQL.
i n t m sql( stri n g database, string query, int link_identifier)

msql_affected_rows. .
int m sql_affected_rows(int query_identifier)

msql_close. mSQL.
int m sql_close(int link_identifier)

msql_connect. mSQL.
int msql_connect(string hostname)
. PHP

299

msql_create_db. mSQL.
int msql_create_db(string database name (, int link_identifier])
msql_createdb. mSQL.
int msql_createdb(string database name [, int link_identifier])
msql_data_seek. .
int msql_data_seek(int query_identifier, int row_number)
msql_dbname. .
string msql_dbname (int query_identifier, int i)
msql_drop_db. mSQL.
int msql_drop_db(string database_name, int link_identifier)
msql_error. mSQL.
string msql_error()
msql_fetch_array. .
int msql_fetch_array(int query_identifier [, int result_type])
msql_fetch_field. .
object msql_fetch_field(int query_identifier, int field_offset)
msql_fetch_object. .
int msql_fetch_object(int query_identifier [, int result_type])
msql_fetch_row. .
array msql_fetch_row(int query identifier)
msql_fieldname. .
string msql_fieldname(int query_identifier, int field)
msql_field_seek. .
int msql_fi eld_seek (int query_identifier, int field_offset)
msql_fieldtable. .
int msql_fieldtable(int query_identifier, int field)
msql_fieldtype. .
string msql_fieldtype(int query_identifier, int i)
msql_fieldflags. .
string msql_fieldflags(int query_identifier, int i)
msql_fieldlen. .
int msql_fieldlen(int query_identifier, int i)
msql_free_result. , .
int msql_free_result(int query_identifier)
msql_freeresult. , .
msql_list_fields. .
int msql_list_fields(string database, string tablename)
msq_listfields. .
msql_list_dbs. mSQL, .
int msql_list_dbs(void)
msql_listdbs. , mSQL.
msql_list_tables. , mSQL.

300

IV.

int msgl_list_tables(string database)


msql_listtables. mSQL.
msql_num_fields. .
int msql_num_fields(int query_identifier)
msql_num_rows. .
int msql_num_rows(int query_identif ier)
msql_numfields. .
int msql_numfields(int query_identifier)
msql_numrows. .
i nt msql _numr ows( voi d)
msql_pconnect. mSQL.
int msql_pconnect(string hostname)
msql_query. mSQL.
int msql_query(string query, int link_identifier)
msql_regcase.
.
msql_result. .
int msql_result(int query_identifier, int i, mixed field)
msql_select_db. mSQL.
int msql_select_db(string database_name, int link_identifier)
msql_selectdb. mSQL.
msql_tablename. .
string msql_tablename(int query_identifier, int field)

.24. , MySQL
MySQL.
mysql_affected_rows.
MySQL.
int mysql_affected_rows([int link_identifier])
mysql_change_user.
.
int mysql_change_user(string user, string password [, string
database [, int link_identifier]])
mysql_close. .
int mysql_close([int link_identifier])
mysql_connect. MySQL.
int mysql_connect([string hostname [:port] [:/ path/ to/ socket]
[
string username [, string password] ] ] )
mysql_create_db. MySQL.
int mysql_create_db(string database name [, int link_identifier])
mysql_data_seek. .
int mysql_data_seek(int result_identifier, int row_number)
mysql_db_query. MySQL.

. PHP

301

int

m ysql_db_query(string
database,
link_identifier] )

string

query

[,

int

mysql_drop_db. .
int mysql_drop_db(string database_name [, int link_identifier])
mysql_errno. .
int m ysql_errno([int link_identifier])
mysql_error. .
string m ysql_error([ int link_identifier] )
mysql_fetch_array. .
array m ysql^fetch_array(int result [, int result_type])
mysql_fetch_fleld. .
object m ysql_fetch_field(int result [ , int field_offset] )
mysql_fetch_lengths. .
array m ysql_fetch_lengths(int result)
mysql_fetch_object. .
object mysql_fetch_object(int result [, int result_typ])
mysql_fetch_row. .
array m ysql_fetch_row(int result)
mysql_field_name. .
string m ysql_field_nam e(int result, int field_index)
mysql_field_seek. .
int m ysql_field_seek(int result, int field_offset)
mysql_field_table. .
string m ysql_field_table(int result, int field_offset)
mysql_field_type. .
string m ysql_field_type(int result, int field_offset)
mysql_field_flags. , .
string m ysql_field_flags(in t result, int field_offset)
mysql_fleld_len. .
int m ysql_field_len(int result, int field_offset)
mysql_free_result. , .
int m ysql free result(int result)
mysql_insert_id. INSERT,
int m ysql_insert_id([int link_identifier])
mysql_list_fields. .
int m ysql_list_fields(string database_name, string table_name [, int
link_identifier])
mysql_list_dbs. , MySQL.
int m ysql_list_dbs([int link_identifier])
mysql_list_tables. M ySQL.
int m ysql_list_tables(string database [, int link_identifier])
mysql_num_fields. .
int mysql_num_f ields (in t result)

302

IV.

mysql_num_rows. .

int mysql_num_rows(int result)


mysql_pconnect. MySQL.

int mysql_pconnect([string hostname [:port] [:/ path/ to/ socket] [,


string username [, string password]]])
mysql_query. SQL MySQL.

int mysql_query(string query [, int link_identifier])


mysql_result. .

int mysql_result(int result, int row [, mixed field])


mysql_select_db. MySQL.

int mysql_select_db(string database_name [, int link_identifier])


mysql_tablename. .

string mysql tablename(int result, int i)

.25.
.
checkdnsrr. DNS
IP .

int checkdnsrr(string host [, string type])


closelog. .
i nt cl osel og(voi d)
debugger_off. PHP.
i nt debugger_of f (voi d)
debugger_on. PHP.

int debugger_on(string address)


fsockopen. Internet Unix .

int fsockopen(string hostname, int port [, int errno [, string


errstr [, double timeout]]])
gethostbyaddr. , IP .

string gethostbyaddr(string ip_address)


gethostbyname. IP , .

string gethostbyname(string hostname)


gethostbynamel. IP , .

array gethostbynamel(string hostname)


getmxrr. , .

int getmxrr(string hostname, array mxhosts, [array weight])


getprotobyname. , .
int getprotobyname(string name)
getprotobynumber. , .
string getprotobynumber(int number)
getservbyname. , Internet .

int getservbyname(string service, string protocol)


getservbyport. Internet, .
.

303

string getservbyport(int port, string protocol)


openlog. .
int openlog (string ident, int option, int facility)
pfsockopen. Internet Unix
.
int pfsockopen(string hostname, int port [, int errno [, st r i :
errstr [, int timeout]]])
set_socket_blocking. / .
int set_socket_blocking(int socket descriptor, int mode)
syslog. .
int syslog(int priority, string message)

.26. NIS
(NIS).
yp_get_default_domain. NIS .
int yp_get_default_domain(void)
yp_order. .
int yp_order(string domain, string map)
yp_master. , NIS,
.
strin g yp_master(string domain, strin g map)
yp_match. , .
string yp_match(string domain, string map, strin g key)
yp_first. .
string[] yp_first(string domain, string map)
yp_next.
.
string[ ] yp_next(string domain, string map, strin g key)

.27. ODBC$
Open DataBase Connectivity.
odbc_autocommit. / autocommit.
int odbc_autocommit(int connection_id [, int OnOff])
odbc_binmode. .
int odbc_binmode(int result_id, int mode)
odbc_close. ODBC .
void odbc_close (int connection_id)
odbc_close_all. ODBC .
void odbc_close_all (void)
odbc_commit. ODBC .
int odbc_commit(int connection_id)

odbc_connect. .

304

IV.

int odbc_connect(string dsn, string user, string password [, in


cursor_type])
odbc_cursor. .
string odbc_cursor(int result_id)
odbc_do. odbc_exec().
string odbc_do(int conn_id, string query)
odbc_exec. SQL.
int odbc_exec(int connection_id, string query_string)
odbc_execute. SQL.
int odbc_execute(int result_id [, array param eters_array])
odbc_fetch_into. .
int odbc_fetch_into(int result_id [, int rownumber, array
result_array])
odbc_fetch_row. .
int odbc_fetch_row(int result_id [, int row_number])
odbc_field_name. .
string odbc_field_nam e(int result_id, int field_num ber)
odbc_field_type. .
string odbc_field_type(int result_id, int field_num ber)
odbc_field_len. () .
int odbc_field_len(int result_id, int field_number)
odbc_free_result. , .
in t odbc_free_result(in t result_id)
odbc_longreadlen. LONG.
int odbc_longreadlen(int result_id, int length)
odbc_num_flelds. .
int odbc_num _fields(int result_id)
odbc_pconnect. .
int odbc_pconnect(string dsn, stringu ser, string password [ , int
cursor_type])
odbc_prepare. .
int odbc_prepare(int connection_id, string query_string)
odbc_num_rows. .
int odbc_num_rows (int result_id)
odbc_result. .
string odbc_result(int result_id, m ixed field)
odbc_result_all. HTML .
int odbc_result_all(int result_ id [, strin g format])
odbc_rollback. .
int odbc_rollback(int connection_id)
odbc_setoption. ODBC. ""
.
int odbc_setoption(int id, int function, int option, int param)

. PHP

305

odbc_tables. ,
. , .
int odbc_tables(int connection_id [, string qualifier [ , string
owner [, string name [, string types]]]])
odbc_tableprivileges. .
int odbc_tableprivileges(int connection_id [, string qualifier [,
string owner [, string name]]])
odbc_columns. .
, .
int odbc_columns(int connection_id [, string qualifier [, string owner
[, string table_name [, string column_name]]]])
odbc_columnprivileges. ,
.
int odbc_columnprivileges(int connection_id [, string qualifier [,
string owner [, string table_name [, string
column_name]]]])

odbc_gettypeinfo. ,
, .
int odbc_gettypeinfo(int connection_id [, int data_type])
odbc_primarykeys. ,
, .
int odbc_primarykeys(int connection_id, string qualifier, string
owner, string table)
odbc_foreignkeys.
,
.
int odbc_foreignkeys(int connection_id, string pk_qualifier, string
pk_owner, string pk_table, string fk_qualifier,
string fk_owner, string fk_table)
odbc_procedures. ,
. , .
int odbc_procedures(int connection_id [, string qualifier [ , string
owner [, string name]]])
odbc_procedurecolumns. .
int odbc_procedurecolumns(int connection id [, string qualifier [,
string owner [, string proc [, string
column]]]])

odbc_specialcolumns. ,
,
.
int
odbc_specialcolumns(int connection_id,
int
type,
string
qualifier, string owner, string table, int
scope, int nullable)
odbc_statistics. .
int odbc_statistics(int connection_id, string qualifier, string owner,
string table_name, int unique, int accuracy)

306

IV.

.28. Oracle
Oracle.
Ora_Bind. Oracle.
int Ora_Bind(int cursor, string PHP_variable_name, string
SQL_parameter_name, int length [, int type])
Ora_Close. Oracle.
int Ora_Close(int cursor)
Ora_CoIumnName. Oracle.
string Ora_ColumnName(int cursor, int column)
Ora_ColumnType. Oracle.
string Ora_ColumnType(int cursor, int column)
Ora_Commit. Oracle.
int Ora_Commit(int conn)
Ora_CommitOff. .
int Ora_Cortvmitoff (int conn)

Ora_CommitOn. .
int Ora_Commiton(int conn)
_rrr. Oracle.
string Ora_Error(int cursor_or_connection)
Ora_ErrorCode. .
int Ora_ErrorCode(int cursor_or_connection)
Ora_Exec. Oracle.
int Ora_Exec(int cursor)
Ora_Fetch. .
int Ora_Fetch(int cursor)
Ora_GetColumn. .
mixed Ora_Getcolumn(int cursor, mixed column)
Ora_Logoff. Oracle.
int Ora_Logoff(int connection)
Ora_Logon. Oracle.
int Ora_Logon(string user, string password)
Ora_Open. Oracle.
int Ora_0pen(int connection)
Ora_Parse. SQL.
int Ora_Parse(int cursor_ind, string sql_statement, int defer)
Ora_RoIlback. .
int Ora_Rollback(int connection)

.29. Oracle 8
Oracle 8.
OCIDefineByName.
SELECT.

307

int OCIDefineByName(int stmt, string Column Name, mixed Svariable [,


int type])
OCIBindByName. PHP Oracle.
int OCIBindByName(int stmt,
string ph_name, mixed svariable,
intlength [, int type])
OCILogon. Oracle.
int OCILogon(string username, string password [, string d b] )
OCIPLogon. Oracle
. .
int OCIPLogon(string username, string password [, string db] )
OCINLogon. Oracle
. .
int OCINLogon(string username, string password [, string d b] )
OCILogOff. Oracle.
int OCILogOff(int connection)
OCIExecute. .
int OCIExecute(int statement [, int mode])
OCICommit. .
int OCICommit(int connection)
OCIRollback. .
int OCIRollback(int connection)
OCINewDescriptor. LOB/FILE (no
LOB).
string OCIN ewD escriptor(int connection [, int type])
OCIRowCount. .
int OCIRowCount(int statement)
OCINumCols. .
int OCINumCols(int stmt)
OCIResuIt. .
mixed OCIResuIt(int statement, mixed column)
OCIFetch. .
int OCIFetch(int statement)
OCIFetchInto. result.
int OCIFetchInto(int stmt, array & result [, int mode])
OCIFetchStatement. .
int OCIFetchStatement(int stmt, array Svariable)
OCIColumnIsNULL. NULL.
int OCIColumnlsNULL(int stmt, mixed column)
OCIColumnSize. .
int OCIColumnSize(int stmt, mixed column)
OCIServerVersion. , .
string OCIServerVersion(int conn)

OCIStatementType. OCI.

308

IV.

string OCI Statem entType(int stm t)

OCINewCursor. ( ).
int OCINewCursor(int conn)

OCIFreeStatement. , .
int OCIFreeStatement(int stmt)

OCIFreeCursor. , .
int OCIFreeCursor(int stmt)

OCIColumnName. .
stri n g OCICoIumnName(int stm t, int col)
mixed OCICoIumnN ame(int stmt, int col)

OCIColumnType. .
mixed OCICoIumnType(int stmt, int col)

OCIParse. .
int OCI Parse(int conn, st r i n t query)

OCIError. stmt | conn I global.


""' .
int OCI Error([int stmtI conn|global])

OCIInternalDebug. /
. .
void OCH nternalD ebug (int onoff)

.30. Perl
Perl.
preg_match. .

int preg_match(string pattern, string subject [, array matches])


preg_match_all. .
int preg_m atch_all(string pattern, string subject, array m atches [,
int order])

preg_replace. .
mixed preg_replace(m ixed pattern, mixed replacement, mixed subject)
preg_split. .
array preg_ split( strin g pattern , strin g subject [ , in t lim it [, int
flags] ] )

preg_quote. .
strin g preg_quote(strin g str)

preg_grep. , .
array preg_grep(string pattern, array input)

.31. POSIX
POSIX.
posix_kill. .

bool posix_kill(int pid, int sig)


posix_getpid. .
.

309

i nt

posi x_get pi d(voi d)

posix_getppid. .
i nt posi x_get ppi d(voi d)
posix_getuid. .

int posix_getuid(void)
posix_geteuid.
.
i nt posi x_get eui d(voi d)
posix_getgid. .
i nt posi x_get gi d(voi d)

posix_getegid. .
i nt

posi x_get egi d(voi d)

posix_setuid. .

bool posix_setuid(int uid)


posix_setgid. .

bool posix_setgid(int gid)


posix_getgroups. .

array posix_getgroups(void)
posix_getlogin. .

string posix_getlogin(void)
posix_getpgrp. ,
.
i nt posi x_get pgrp(voi d)
posix_setsid. .
i nt posi x_set si d(voi d)
posix_setpgid. , .

int posix_setpgid(int pid, int pgid)


posix_getpgid. , .
i nt posi x_get pgi d(i nt pi d)
posix_getsid. sid .

int posix getsid(int pid)


posix_uname. .

array posix_uname(void)
posix_times. .

array posix_times(void)
posix_ctermid. .

string posix_ctermid(void)
posix_ttyname. .
st ri ng posi x_t t yname(i nt f d)
posix_isatty. , .
bool posi x_i sat t y(i nt f d)
posix_getcwd. .

string posix_getcwd(void)
310

IV.

bool posix_getcwd(string pathname, int mode)


posix_getgrnam. .
array posix_getgrnam(string name)
posix_getgrgid. .
array posix_getgrgid(int gid)
posix_getpwnam. .
array posix_getpwnam(string username)
posix_getpwuid.
.
array posix_getpwuid(int uid)
posix_getrlimit. .
array posix_getrlim it(void)

.32.
, .
escapeshellcmd. .
string escapeshellcm d(string command)
exec. .
strin g exec(string command [, string array [, int return_var]])
passthru. .
void passthru(string command [, int return_var])
system. .
strin g system (string command [, int return_var])

.33. Recode
GNU.
recode_string. .
strin g recode_ strin g(strin g request, strin g strin g)
recede. .
st r i ng r ecode_st r i ng( st r i ng r equest ,
st r i ng st r i ng)
recode_file.
.
bool recode_file(int input, int output)

.34. ,
.
session_start. .
bool session_start(void)
session_destroy. , .
bool session_destroy(void)
session_name. / .
strin g session_name([string name])

311

session_module_name. / .
strin g session_module_name([string module])

session_save_path. / .

string session_save_path(string path)


session_id. .

string session_id([string id])


session_register. .
bool session_register(mixed name [, mixed ...])
session_unregister. .

bool session_unregister(string name)


session_unset. .
void session_unset(void)
session_is_registered. , .

bool session_is_registered(string name)


session_get_cookie_params. cookie .

array session_get_cookie_params(void)
session_set_cookie_params. cookie .
void session_set_cookie_param s(int lifetim e [ , string path [, string
domain]])
session_decode. .
bool session_decode(string data)

session_encode. .
bool

sessi on_encode( voi d)

.35. SNMP
SNMP.
snmpget. SNMP.
strin g snmpget(string hostname, strin g community, strin g object_id
[, int tim eout [, int retries] ] )

snmpset. SNMP.
bool snmpset(string hostname, strin g community, strin g object_id,
strin g type, mixed value [, int timeout [, int retries] ] )

snmpwalk. SNMP.
array snmpwalk(string hostname, strin g community, strin g object_id
[, int tim eout [, int retries] ] )

snmpwalkoid. .
array snmpwalkoid(string hostname, strin g community, strin g
object_id [, int tim eout [, int retries] ] )

snmp_get_quick_print. quick_print
UCD.
boolean snmp_get_quick_print(void)
snmp_set_quick_print. quick_print
UCD.
void snmp_set_quick_print(boolean quick_print)

312

IV.

.36.
.
addcslashes. ( ).
string addcslashes(string str, string charlist)
addslashes. .
string addslashes (string str)
bin2hex. .
string bin2hex(string str)
chop. .
string chop (string str)
chr. .
string chrfint ascii)
chunk_split. .
string chunk_split(string string [, int chunklen [, string end]])
convert_cyr_string. .
string convert_cyr_string(string str, string from, string to)
count_chars. , .
mixed count_chars (string string [, mode])
crypt. .
string crypt(strin g str [ , string salt] )
echo. .
echo(string argl, string . . . . )
explode. .
array explode(string separator, string string)
flush. .
void flush(void)
get_html_translation_table. ,
htmlspecialchars() htmlentities().
string get_htm l_translation_table(int table)
get_meta_tags.
.
array get_meta_tags(string filename [, int use_include_path])
htmlentities. HTML.
string htm lentities(string string)
htmlspecialchars. HTML.
string htmlspecialchars(string string)
implode. .
string implode(string glue, array pieces)
join. .
string join(string glue, array pieces)
levenshtein. .
int levenshtein(string st r l , string str2)
. PHP

313

ltrim. .
string ltrim (string str)
md5. md5 .
string m d5(string str)
metaphone. .
string metaphone (string str)
nl2br. HTML.
string nl2br(string string)
ord. ASCII .
int ord (string string)
parse_str. .
void parse_str(string str)
print. .
print(string arg)
printf. .
int printf(string format [, mixed args . . . ] )
quoted_printable_decode. , , 8 .
string quoted_printable_decode(string str)
quotemeta. .
string quotemeta(string str)
rawurldecode. , URL.
string rawurldecode(string str)
rawurlencode. URL RFC 1738.
string rawurlencode(string str)
setlocale. .
string setlocale(string category, string locale)
similar_text. .
int similar_text(string first, string second [, double percent])
soundex. .
string soundex(string str)
sprintf. .
string sprintf(string format [, mixed args...] )
strcasecmp. .
int strcasecmp(string strl, string str2)
strchr. .
string strchr(string haystack, string needle)
strcmp. .
int strcmp(string st r l , string str2)
strcspn. , .
int strcspn(string strl, string str2)
strip_tags. HTML- PHP-.
string strip_tags(string str [, string allowable_tags])

314

IV.

stripcslashes. .
string stripcslashes (string str)
stripslashes. .
string stripslashes(string str)
stristr. .
string stristr(string haystack, string needle)
strlen. .
int strlen(string str)
strpos. .
int strpos(string haystack, string needle [, int offset] )
strrchr. .
string strrchr(strin g haystack, string needle)
str_repeat. .
string str_repeat(string input, int m ultiplier)
strrev. .
string strrev( strin g strin g)
strrpos. char .
int strrpos(string haystack, char needle)
strspn. .
int strspn(string st r l , string str2)
strstr. .
string strstr (string haystack, string needle)
strtok. .
string strtok(strin g argl, string arg2)
strtolower. .
string strtolow er(strin g str)
strtoupper. .
string strtoupper(strin g string)
str_replace. needle haystack str.
string str_replace(string needle, string str, string haystack)
strtr. .
string strtr(strin g str, string from, string to)
substr. .
string substr(string string, int start [, int length])
substr_replace. .
string substr_replace(string string, string replacement, int start
[, int length])
trim. .
st ri ng t ri m(st ri ng st r)
ucfirst. .
st ri ng ucf i rst (st ri ng st r)
ucwords. .
st ri ng ucwor ds( st r i ng st r )
.

315

.37. Sybase
Sybase.
sybase_affected_rows. , .
int sybase_affected_rows ([int link_identifier])
sybase_close. Sybase.
int sybase_close(int link_identifier)
sybase_connect. Sybase.
int sybase_connect(string servername, string username, string
password)
sybase_data_seek. .
int sybase_data_seek(int result_identifier, int row_number)
sybase_fetch_array. .
int sybase_fetch_array(int result)
sybase_fetch_field. .
object sybase_fetch_field(int result, int field_offset)
sybase_fetch_object. .
int sybase_fetch_object(int result)
sybase_fetch_row. .
array sybase_fetch_row(int result)
sybase_field_seek. .
int sybase_field_seek(int result, int field_offset)
sybase_free_result. .
int sybase_free_result(int result)
sybase_num_fields. .
int sybase_num_fields(int result)
sybase_num_rows. .
int sybase_num_rows(string result)
sybase_pconnect. Sybase.
int sybase_pconnect(string servername, string username, string
password)
sybase_query. Sybase.
int sybase_query(string query, int link_identifier)
sybase_result. .
int Sybase_result(int result, int i, mixed field)
sybase_select_db. Sybase.
int sybase_select_db(string database_name, int link_identifier)

.38. URL
URL .
base64_decode. ,
mime base64.
string base64_decode(string encoded_data)

316

IV.

base64_encode. mime base64.


string base64_encode(string data)
parse_url. URL .
array parse_url(string url)
urldecode. URL .
string urldecode(string str)
urlencode. URL .
string urlencode(string str)

.39. ,
.
call_user_func. , .
mixed call_user_func(string function_name [, mixed parameter [,
mixed ...] ] )
doubleval. double.
double doubleval(mixed var)
empty. .
int empty(mixed var)
gettype. .
string gettype(mixed var)
intval. .
int intval (mixed var [, int base])
is_array. , .
int is_array(mixed var)
is_double . , double.
int is_double(mixed var)
is_float. , float.
int is_float(mixed var)
is_int. , integer.
int is_int(mixed var)
is_integer. , integer.
int is_integer(mixed var)
is_long. , long.
int is_long(mixed var)
is_object. , .
int is_object(mixed var)
is_real. , real.
int is_real(mixed var)
is_string. , .
int is_string(mixed var)
isset. , .
i nt
i sset (mi xed var )

. PHP

317

print_r. .
void print_r(mixed expression)

settype. .
in t settype(strin g var, string type)
strval. .
strin g strval(m ixed var)

unset. .
i nt

unset ( mi xed var )

var_dump. .
void var_dump(mixed expression)

318

IV.

Perl DBI, 158


57

, 117
Apache API, 142
C
CGI , 101
I
inetd 62
IP 247

, 26
<Directory>, 28; 53; 118
<DirectoryMatch>,
28
<Files>, 28; 30
<FilesMatch>, 28; 30
<Location>, 28; 30; 118
<LocationMatch>,
28
AccessFileName, 56
AddDescription, 56
AddHandler, 33; 57; 119; 123
AddHandler, 57

AddIcon, 56
M

AddIconByEncoding,
AddIconByType 56
AddLanguage, 57

Makefile, 143
MIME, 33
Multimedia Internet Mail Extensions, 33

AddModule,

P
Personal Hypertext
PHP,

Preprocessor,

162

162

AllowOverride,

31;

56

48

AddModuleInfo, 98
AddType, 33; 57; 119; 123
Alias, 57
allow, 54; 55; 102
allow from env, 104

29;

54

Anonymous, 109
S
Anonymous_Authoritative, 110
Anonymous_LogEmail, 109
standalone, 62
Anonymous_MustGiveEmail, 110
Anonymous_NoUserID, 110

Anonymous_VerifyEmail,
110
AuthAuthoritative, 106
, 168
AuthDBMAuthoritative, 108
MySQL, 757
AuthDbmGroupFile, 109
, 99
AuthDBMUserFile, 108
AuthGroupFile, 105; 106

AuthName,
104
AuthType, 105
, 73
AuthUserFile, 106
o IP , 79
BindAddress, 49; 75
, 76
BrowserMatch, 48
(SSI), 117
CacheDirLength, 86

CacheDirLevels, 86

, 264
, 32
server parsed, 118

CacheGcInterval,

87
CacheNegotiatedDocs, 51
CacheRoot, 86
CacheSize, 86
ClearModuleList, 31; 48
dbmmanage, 108
319

DefaultType, 57
DefaulType, 33
deny, 54; 55; 104
deny from env, 104
DirectoryIndex, 55
DocumentRoot, 55
ErrorLog, 50; 91
ExtendedStatus, 94; 96
Fancy Indexing, 56
FastCgilpcDir, 126
Group, 48
HeaderName, 56
HostNameLookups, 48
KeepAlive, 51
KeepAliveTimeout, 52
LanguagePriority, 57
Listen, 75
Listen, 84
LoadModule, 32; 60

Location, 53
LogFormat, 93
LogLevel, 92
MaxClients, 52
MaxKeepAliveRequests, 57
MaxRequestsPerChild, 52; 59
MaxSpareServers, 52

MinSpareServers, 52
NameVirtualHost, 78
NoCache, 87
NoProxy, 85
Options, 55
Options +ExecCGI, 722
order, 54

PerlAccessHandler, 149
PerlAuthenHandler, 149
PerlAuthzHandler, 149
PerlChildExitHandler, 150
PerlChildlnitHandler, 149
PerlCleanupHandler, 150
PerlFixupHandler, 149

PerlFreshRestart, 148

ProxyBlock, 84
ProxyDomain, 85
ProxyRemote, 85
ReadmeName, 56
require, 104
RewriteBase, 141
RewriteCond, 134
RewriteEngine, 133
Rewrite Log, 140
RewriteLogLevel, 140
RewriteMap, 138
RewriteOptions, 141
RewriteRule, 133
RLimitCPU, 124
RLimitCPU, 130
RLimitMEM, 124
RLimitMEM, 130
RLimitNPROC, 124; 130
ScoreBoardFile, 50

ScriptAlias, 57; 122


ScriptLog, 123
ScriptLogBuffer, 123
ScriptLogLength, 124
ServerAdmin, 49; 80
ServerName, 51
ServerRoot, 49

ServerType, 46
SetHandler, 33; 123
SSLCACertificateFile, 114
SSLCACertificatePath, 114
SSLCertificateFile, 114
SSLCertificateKeyFile, 774
SSLEngine, 114

SSLLog, 775
SSLLogLevel, 775
SSLVerifyClient, 775
SSLVerify Depth, 116
StartServers, 52
ThreadsPerChild, 59; 131
Timeout, 57

TransferLog, 50, 92

Perl Handler, 149

TypesConfig, 33

PerlHeaderParserHandler, 149

User, 48; 202

PerlInitHandler, 149
PerlModule, 148
PerLogHandler, 750
PerlPostReadRequestHandler, 149
PerlRequire, 148
PerlTransHandler, 149

PerlTypeHandler, 149

UserDir, 55; 73; 74


VirtualHost, 78; 202
XBitCrack, 119

PidFile, 50

, 90

Port, 47

, 90

Port portnum, 75
320

3
, 63

inetd, 46

307 Temporary Redirect,


HTTP_TEMPORARY_REDIREC

T, 270

st andal one, 46

, 50

IDE, 35
PerlDBI, 158
SCSI, 35

FilesGroup, 43
, 111

_default_, 79
SSI, 777

100 Continue, 268


101 Switching Protocols, 268
200 OK, HTTP_OK, 269
201 Created, HTTP_CREATED, 269
202 Accepted, HTTP_ACCEPTED,
269
203 Non Authoritative Information,
HTTP_NON_AUTHORITATIVE,
269
204 No Content,

HTTP_NO_CONTENT, 269
205 Reset Content, 269
206 Partial Content, 269
300 Multiple Choices,
HTTP_MULT1PLE_CHOICES,
269
301 Moved Permanently,
HTTP_MOVED_PERMANENTL
Y, 269
302 Found, HTTP_FOUND, 269
303 See Other, HTTP_SEE_OTHER,
270
304 Not Modified,
HTTP_NOT_MODIFIED, 270
305 Use Proxy, HTTP_USE_PROXY,
270

400 Bad Request, 270


401 Unauthorized, 270
402 Payment Required, 270
403 Forbidden, 270
404 Not Found, 270
405 Method Not Allowed, 270
406 Not Acceptable, 270
407 Proxy Authentication Required,
27/
408 Request Time out, 277
409 Conflict, 277
410 Gone, 277
411 Length Required, 277
412 Precondition Failed, 277

413 Request Entity Too Large, 277


414 Request URI Too Large, 277
500 Internal Server Error, 277
501 Not Implemented, 277
502 Bad Gateway, 277
503 Service Unavailable, 277
504 Gateway Time out, 272
505 HTTP Version not supported, 272
, 26

ADD MODULE, 143


APACHE SRC, 143
APACHE_PREFIX, 143
APACI_ARGS, 143
cfdisk, 36

config, 779

DO_HTTPD, 143
DYNAMIC, 143
echo, /20
EVERYTHING, 144
exec, 120
flastmod, /20
fsize, 720

grep, 260
htpasswd, 705

if elif, 720

ifconfig, 76; 260

include, /20
make, 39; 42
rnkdir, 36

PERL DESTRUCT LEVEL, 144


PERL_DEBUG, 144
PERL_TRACE, 144
ping, 258

PREP HTTPD, 144


printenv, /2/

321

set, 121
SSL_BASE, 144
USE APXS, 144
USE_APACI, 144
USE_DSO, 144
WITH APXS, 144
Makefile.pl, 143

CyberCash, 154
e Cash, 753
, 27
, 86; 130

mod_cern_meta, 217
mod_cgi, 217
mod_digest, 218
mod_dir, 219
mod_env, 224
mod_expires, 225
mod_headers, 226
mod_imap, 227
mod_include, 118
mod_include, 228
mod_info, 90;, 97
mod_info, 229
mod_isapi, 229
M
mod_log_agent,
230
mod_log_common, 92
, 248
mod_log_config, 92

mod_log_config, 230
DBI >connect, 160
mod_log_referer, 232
, 117
mod_mime, 232
Apache
mod_mime_magic, 235
Log, 277
mod_mmap_static, 130
SubRequest, 278
mod_mmap_static, 235
Server,
278
mod_negotiation, 236
Connection, 278
mod_perl, 124; 142
Table, 279
mod_php, 166
URI, 279
mod_proxy, 84
Util, 279
mod_proxy, 236
, 277
mod_rewrite,
132

mod_rewrite,
236
, 277
mod_setenvif, 242
,
mod_so, 32
276
mod_so, 243
, 277
mod_speling, 244
, 276
mod_ssl, 112; 145
,
278
mod_status, 90, 94; 96; 130
, 26; 31
mod_status, 244
BasicHandler.pm, 159
mod_unique_id, 245
FastCGI, /25
mod_userdir, 245
libexec.so, 146
mod_usertrack, 245
mod_acccess, 102
mod_access, 54; 204
O
mod_actions, 206
mod_alias, 207

mod_auth, 105
abs, 295
mod_auth, 209
acos, 295
mod_auth_anon, 109
AddCSlashes, 313
mod_auth_anon, 211
AddSlashes, 313
mod_auth_db, 109
apache_lookup_uri, 281
mod_auth_db, 213
apache_note, 281
mod_auth_dbm, 48; 107
array, 281
mod_auth_dbm, 274
array_count_values, 281
mod_autoindex, 56
array_flip, 281
mod_browser, 276
322

array_keys, 282
array_merge, 282
array_pad, 282
array_pop, 282
array_push, 282
array_reverse, 282
array_shift, 282
array_slice, 282
array_splice, 282
array_unshift, 282
array_values, 282
array_walk, 282
asin, 295
asort, 282
atan, 295
atan2, 295
base_convert, 295
base64_decode, 316
base64_encode, 317
basename, 288
bcadd, 281
bccomp, 281
bcdiv, 281
bcmod, 281
bcmul, 281
bcpow, 281
bcscale, 281
bcsqrt, 281
bcsub, 281
bin2hex, 313
bindec, 295
call_user_func, 317

count_chars, 313
crypt, 313
current, 282
date, 285
dba_close, 284
dba_delete, 284
dba_exists, 284
dbajfetch, 284
dba_firstkey, 285
dba_insert, 285
dba_nextkey, 285
dba_open, 285
dba_optimize, 285
dba_popen, 285
dba_replace, 285
dba_sync, 285
dbase pack, 286
dbase_add_record, 286
dbase_close, 286
dbase_create, 286
dbase_delete_record, 286
dbase_get_record, 286
dbase_get_record_with_names, 286
dbase_numfields, 286
dbase_numrecords, 286
dbase_open, 286
dbase_replace_record, 286
dblist, 287
dbmclose, 286
dbmdelete, 287
dbmexists, 286
dbmfetch, 286

ceil, 296

dbmfirstkey, 287

chdir, 287
checkdate, 255
checkdnsrr, 303
chgrp, 288
chmod, 288
Chop, 313
chown, 288
Chr, 313
chunk_split, 313
clearstatcache, 288

dbminsert, 287
dbmnextkey, 287
dbmopen, 286
dbmreplace, 287
303
debugger_on, 303
decbin, 296
dechex, 296
decoct, 296
define, 298

debugger_off,

closedir, 287

defined, 298

closelog, 303
compact, 282
connection_aborted, 295
connection_status, 295
connection_timeout, 295
convert_cyr_strmg, 313
copy, 255
cos, 296
count, 252

deg2rad, 296
delete, 288
die, 298
dir, 257
255
diskfreespace, 259
dl, 257
doubleval, 317
each, 252

dirname,

323

echo, 313
empty, 317
end, 282
escapeshellcmd, 311
eval, 298

exec, 311
exit, 298
exp, 296

explode, 313
extract, 282
fclose, 289
fdf_close, 297
fdf_create, 297

fdf_getjile, 297; 292


fdf_get_status, 297
fdf_get_value, 297
fdf_next_field_name, 297
fdf_open, 297
fdf_save, 297
fdf_set_ap, 297
fdf_set_file, 297
fdf_set_status, 297
fdf_set_value, 297
feof, 2*9
fgetc, 2*9
fgetcsv, 2*9
fgets, 2*9
fgetss, 2*9
file, 2*9
file_exists, 2*9
fileatime, 2*9
filegroup, 2*9
fileinode, 2*9
filemtime, 2*9

ftp_fput,
ftp_login,

'292
ftp_get, 292
292

ftp_mdtm,
ftp_nlist,
ftp_put,

292
292
292
ftp_pwd, 292
ftp_quit, 293

ftp_rawlist, 292
ftp_rename, 292
ftp_rmdir, 292
ftp_site, 293
ftp_size, 292
ftp_systype, 292
func_get_arg, 298
func_get_args, 298
func_num_args, 299
function_exists, 299
fwrite, 290
get_browser, 299
get_html_translation_table, 313
get_meta_tags, 313
getallheaders, 281
getdate, 285
gethostbyaddr, 303
gethostbyname, 303
gethostbynamel, 303
getmxrr, 303
getprotobyname, 303

fileowner, 2*9

getprotobynumber, 303

fileperms, 2*9

getrandmax, 296

filepro, 288
filepro_fieldcount, 288
filepro_fieldname, 288

filepro_fieldtype, 288
fileprojleldwidth, 288
filepro_retrieve, 288
filepro_rowcount, 288
filesize, 2*9

getservbyname, 303
getservbyport, 303
gettimeofday, 285

gettype, 317
gradate, 285
gmmktime, 285
gmstrftime, 285
gzclose, 283

filetype, 2*9

gzcompress, 284

flock, 2*9
floor, 296

gzeof, 283
gzfile, 284

flush, 313

gzgetc, 284

fopen, 2*9

gzgets, 284

fpassthru, 2*9

324

ftp_chdir,
ftp_delete,

fsockopen, 303
ftell, 290
ftp_cdup, 292
292
292

gzgetss, 284

fputs, 296

gzopen, 284

fread, 290

gzpassthru, 284

fseek, 290

gzputs, 284

gzread, 284
gzrewind, 284

is_array, 317
is_dir, 290

gzseek, 284

is_double, 317

gztell, 284
gzumcompress, 284

is_executable, 290
is_file, 290

gzwrite, 284

is_float, 317

header, 293
hexdec, 296
htmlentities, 313
htmlspecialchars, 313
ifx_affected_rows, 294
ifx_blobinfile_mode, 294
ifx_byteasvarchar, 295
ifx_close, 293
ifx_connect, 293
ifx_copy_blob, 294
ifx_create_blob, 294
ifx_create_char, 294
ifx_do, 293
ifx_error, 293
ifx_errormsg, 294
ifx_fetch_row, 294
ifx_fieldproperties, 294

is_link,
is_long,

is_int, 317
is_integer, 317
290
317
is_object, 317
is_readable, 290
is_real, 317
is_string, 317
is_writeable, 290
isset, 317
join, 313
key, 283
krsort, 283
ksort, 283
leak, 299
leveiishtein, 313
link, 290

ifx_fieldtypes, 294

linkinfo, 290

ifx_free_blob, 294
ifx_free_char, 294
ifx_free_result, 294
ifx_free_slob, 295
ifx_get_blob, 294
ifx_get_char, 294
ifx_getsqlca, 294
ifx_htmltbl_result, 294

list, 283
localtimex, 285
LOCK TABLE, /57
log, 296
loglO, 296
291
314
mail, 295

lstat,
ltrim,

ifx_nullformat, 295

max, 296

ifx_num_fields, 294
ifx_num_rows, 294
ifx_pconnect, 293
ifx_prepare, 293
ifx_query, 293
ifx_textasvarchar, 294
ifx_update_blob, 294
ifx_update_char, 294
ifxus_close_slob, 295
ifxus_create_slob, 295
ifxus_open_slob, 295
ifxus_read_slob, 295
ifxus_seek_slob, 295
ifxus_tell_slob, 295
ifxus_write_slob, 295

mcrypt_cbc, 287
mcrypt_cfb, 288
mcrypt_create_iv, 287
mcrypt_ecb, 288
mcrypt_get_block_size, 287
mcrypt_get_cipher_name, 287
mcrypt_get_key_size, 287
mcrypt_ofb, 288
md5, 314
Metaphone, 314
mhash, 293
mhash_count, 293
mhash_get_block_size, 293
mhash_get_hash_name, 293
microtime, 2<?5

ignore_user_abort, 299
implode, 313
in_array, 283
intval, 317
iptcparse, 299

min, 296
mkdir, 290
mktime, 285
msq_listfields,

300
msql, 299
325

msql_affected_rows, 299

mssql_num_rows, 298

msql_close, 299

mssql_pconnect, 298

msql_connect, 299

mssql_query, 298

msql_create_db, 300

mssql_result, 298

msql_createdb, 300
msql_data_seek, 300
msql_dbname, 300
msql_drop_db, 300
msql_error, 300
msql_fetch_array, 300

mssql_se!ect_db, 298
mt_getrandmax, 296
mt_rand, 296
mt_srand,' 296
mysql_affected_rows, 301
mysql_change_user, 301

msqljetchjleld, 300
msql_fetch_object, 300
msql_fetch_row, 300
msql_field_seek, 300
msql_fieldflags, 300
msql_fieldlen, 300
msql_fie!dname, 300
msql_fieldtable, 300
msql_fieldtype, 300
msql_free_result, 300
msql_freeresult, 300
msql_list_dbs, 300
msqi_list_fields, 300
msql_list_tables, 300
msql_listdbs, 300
msql_num_fields, 301
msql_num_rows, 301
msql_numfields, 301
msql_numrows, 301
msql_pconnect, 301
msql_query, 301
msql_regcase, 301
msql_result, 301
msql_select_db, 301
msql_selectdb, 301
msql_tablename, 301
msqllisttables, 301
mssql_close, 297
mssql_connect, 297
mssql_data_seek, 297
mssql_fetch_array, 297
mssql_fetch_fleld, 297
mssql_fetch_object, 297
mssql_fetch_rqw, 297
mssql_field_length, 297
mssql_field_name, 297
mssql_field_seek, 297
mssql_field_type, 297
mssql_free_result, 297

mssql_get_last_message, 298
mssql_min_error_severity, 298
mssql_min_message_severity, 298
mssql_num_fields, 298
326

mysql_close, 301

nl2br,

mysql_connect, 301
mysql_create_db, 301
mysql_data_seek, 301
mysql_db_query, 301
mysql_drop_db, 302
mysql_errno, 302
mysql_error, 302
mysql_fetch_array, 302
mysql_fetch_fleld, 302
mysql_fetch_lengths, 302
mysql_fetch_object, 302
mysql_fetch_row, 302
mysql_field_flags, 302
mysql_field_name, 302
mysql_field_seek, 302
mysql_field_table, 302
mysql_field_type, 302
mysql_fleld_len, 302
mysql_free_result, 302
mysql_insert_id, 302
mysql_list_dbs, 302
mysql_list_fields, 302
mysql_list_tables, 302
mysql_num_fields, 302
mysql_num_rows, 303
mysql_pconnect, 303
mysql_query, 303
mysql_result, 303
mysql_select_db, 303
mysql_tablename, 303
next, 283
314
number_format, 296
OCIBindByName, 308
OCIColumnlsNULL, 308
OCIColumnName, 309
OCIColumnSize, 308
OCIColumnType, 309

OCICommit, 308
OCIDefmeByName, 307
OCI Error, 309
OCI Execute, 308

OCIFetch, 308
OClFetchlnto, 308
OCIFetchStatement, 308
OCIFreeCursor, 309
OCIFreeStatement, 309
OClInternalDebug, 309
OCILogOff, 308
OCILogon, 308

OCINewCursor, 309
OCINewDescriptor, 308
OCINLogon, 308
OClNumCols, 308
OCI Parse, 309
OCIResult, 308
OCI Rollback, 308
OCIRowCount, 308
OCIServerVersion, 308
OCIStatementType, 308
octdec, 296
odbc_autocommit, 304
odbc_binmode, 304
odbc_close, 304
odbc_close_all, 304
odbc_columnprivileges, 306
odbc_columns, 306
odbc_commit, 304
odbc_connect, 304
odbc_cursor, 305
odbc_do, 305

odbc_cxec, 305
odbc_execute, 305
odbc_fetch_into, 305
odbc_fetch_row, 305
odbc_field_len, 305
odbc_field_name, 305
odbc_field_type, 305
odbc_foreignkeys, 306
odbc_free_result, 305
odbc_gettypeinfo, 306
odbc_longreadlen, 305
odbc_num_flelds, 305
odbc_num_rows, 305
odbc_pconnect, 305
odbc_prepare, 305
odbc_primarykeys, 306
odbc_procedurecolumns, 306
odbc_procedures, 306
odbc_result, 305
odbc_result_all, 305
odbc_rollback, 305
odbc_setoption, 305
odbc_specialcolumns, 306

odbc_statistics, 306

odbc_tableprivileges, 306
odbc_tables, 306
opendir, 287
openlog, 304
Ora_Bind, 307
Ora_Close, 307
Ora_ColumnName, 307
Ora_ColumnType, 307

Ora_Commit, 307
Ora_CommitOff, 307
Ora_CommitOn, 307
Ora_Error, 307
Ora_Exec, 307
Ora_Fetch, 307
Ora_GetColumn, 307
Ora_Logoff, 307
Ora_Logon, 307
Ora_Open, 307
Ora_Parse, 307
Ora_Rollback, 307
Ord, 314
pack, 299
parse_str, 314
parse_url, 317
passthru, 311
pclose, 290
pfsockopen, 304
pi, 296
popen, 290

pos, 283
posix_ctermid, 310
posix_getcwd,
310
posix_getegid, 310
posix_geteuid, 310
posix_getgid,
310
posix_getgrgid, 311
posix_getgrnam,
311
posix_getgroups,
310
posix_getlogin, 310
posix_getpgid, 310
posix_getpgrp, 310
posix_getpid, 309
posix_getppid, 310
posix_getpwnam, 311
posix_getpwuid, 311
posix_getrlimit, 311
posix_getsid,
310
posix_getuid, 310
posix_isatty, 310
posix_kill, 309
posix_setgid, 310
posix_setpgid, 310

posix_setsid, 310
327

posix_setuid, 310

posix_times, 310
posix_ttyname, 310

posix_uname, 310
pow, 296
preg_grep, 309
preg_match, 309
preg_match_all, 309

preg_quote, 309
preg_replace, 309

preg_split, 309
prev, 283
print, 314
print_r, 317
printf, 314
quoted_printable_decode, 314
QuoteMeta, 314

radldeg, 297
range, 283
rawurldecode, 314
rawurlencode, 314
readdir, 287
readfile, 290
readgzfile, 284
readlink, 290
recede, 311
recode_file, 311
recode_string, 311
register_shutdown_function, 299
rename, 290
reset, 283
rewind, 290
rewinddir, 287
rmdir, 290
round, 297
rsort, 283
serialize, 299
session_decode, 312

session_destroy, 311
session_encode, 312

session_get_cookie_params, 312
session_id, 312
session_is_registered, 312
session_module_name, 312
session_name, 377
session_register, 312
session_save_path, 312

session_set_cookie_params, 312
session_start, 311
session_unregister, 312
session_unset, 312

setlocale, 314

settype, 318
shuffle, 283

similar_text, 314
sin, 297

sizeof, 283
sleep, 299
snmp_get_quick_print, 312

snmp_set_quick_print, 312
snmpget, 312

snmpset, 312
snmpwalk, 312
snmpwalkoid, 312
sort, 283
soundex, 314
sprintf, 314
sqrt, 297

srand, 297
stat, 291
str_repeat, 315
str_replace, 315
strcasecmp, 314
strchr, 314
strcmp, 314
strcspn, 314
strftime, 285
strip_tags, 314
StripCSlashes, 315
StripSlashes, 315
stristr, 315
strlen, 315
strpos, 315
strrchr, 315
strrev, 315
strrpos, 315
strspn, 315
strstr, 315
strtok, 315

strtolower, 575
strtotime, 286

strtoupper, 375
strtr, 375
strval, 318
substr, 315
substr_replace, 375
sybase_affected_rows, 316
sybase_close, 316

sybase_connect, 316
sybase_data_seek, 316
sybase_fetch_array, 316
sybase_fetch_field, 316

set_socket_blocking, 304

sybase_fetch_object, 316

setcookie, 293

sybase_fetch_row, 316

328

sybase_field_seek, 316
sybase_free_result, 316
sybase_num_fields, 316
sybase_num_rows, 316
sybase_pconnect, 316
sybase_query, 316
sybase_result, 316
sybase_select_db, 316
symlink, 291
syslog, 304
system, 311
tan, 297
tempnam, 291
time, 285
touch, 291
trim, 315
uasort, 283

HTTPD, 43
conf, 58

Apache, 36; 38
Windows NT
administrator, 266
, 74; 253
80, 261
Internet, 264
, 254
, 263
, 263

apxs, 32
, 82
, 247
SET, 754

ucfirst, 315

SSL, 111

ucwords, 315
uksort, 283
umask, 297
uniqid, 299
unlink, 291
unpack, 299
unserialize, 299
unset, 318
urldecode, 377
urlencode, 377
usleep, 299
var_dump, 318
virtual, 281
yp_first, 304
yp_get_default_domain, 304
yp_master, 304
yp_match, 304
yp_next, 304
yp_order, 304

commit, 757
rollback, 757

Install Apache as Service, 43


, 26
Makeffle.pl, 745
Apache, 44
, 700
, 772

, 168

HARD_SERVER_LIMIT, 52

Oracle,

, 263
inetd, 264
ink, 264
, 263
P
, 32
, 50
DNS, 77
, 273
KeepAlives, 130

, 772
, 249

HUP, 67; 69
kill, 68
TERM, 67; 69
USR1, 68; 69
, 76
kill(), 68
mod_perl,
278
ColdFusion, 760

Informix, 757
MySQL, 766
757
inetd, 62

apachectl, 43; 68; 69


configure, 42
329

Perl, 777
r, 264
Apaci, 40

, 757
TCP/IP, 247

, 249

tcp, 63

/dev/null, 91

make, 146
nslookup, 255
vmstat, 727

.htaccess, 28; 29

/etc/group, 263
/etc/hosts, 255; 262
/etc/nss witch.conf, 255
/etc/passwd, 262
/etc/services, 262
access.conf, 27; 45
access.log, 93
httpd.conf, 26; 45; 46
Makefile, 39
Makefile. PL, 143

mime.types, 33; 45
srm.conf, 27; 45
, 26
, 37
, 26
, 37
, 50
, 263
crypt(), 106

, 777

, 31
Perl, 124
330

Web- Apache

..
. .

.. , ..
..
. . , . .

"".
101509, , . , . 43, . 1.
. . 090230 23.06.99
.
03.10.2001. 70x100/16.
Times. .
. . . 20,6. .-. . 16.
5000 . 1814.
" "
,
.
197110, -, ., 15.