Yuval Fisher

1 I:

r\ ;i ^4

A Guide to Serving Information on the

Springer Contents

Preface vii

1 What, How, Where? 1 1.1 The 2 1.2 Connecting to the Internet 10 1.3 Internet Applications 13 1.4 The WWW 19

2 How the Web Works 33 2.1 WWW Browsers 35 2.2 Client/Server Interaction 44 2.3 MIME Types 48 2.4 External Viewers 53 2.5 Executing Local Programs from Hyperlinks . . 54 2.6 Servers 55

3 HTTP 59 3.1 The HTTP Request .' 61 3.2 The HTTP Response 64 3.3 Status Codes 67 3.4 HTTP Security 68

4 Servers 71 4.1 Setting up NCSA . 72 4.2 Using NCSA httpd Features 94 4.3 Using the NCSA Server Ill 4.4 NCSA httpd Security Considerations Ill 4.5 Setting up CERN httpd 114 xi XII Contents

4.6 Using CERN httpd Features 130 4.7 Netscape Servers 146 4.8 Apache 150 4.9 Other Servers 151

Security 155 5.1 Server Security 157 5.2 CGI Security 162 5.3 Client Security 164 5.4 Firewalls 165

HTML 169 6.1 Quick and Dirty 170 6.2 The Fine Print 174 6.3 Writing HTML 175 6.4 HTML Text Elements 176 6.5 HTML Anchors 182 6.6 Rules and Images 187 6.7 HTML Forms 189 6.8 Common HTML Errors 195 6.9 HTML Style 197 6.10 The Future of HTML 200 6.11 Copyrights 201

HTML Reference 203 7.1 Syntax 205 7.2 The HTML Document 206 7.3 The HTML Body 209 7.4 HTML Anchors 211 7.5 Headers 212 7.6 Text Tags 213 7.7 Addresses 218 7.8 Lists 218 7.9 Special Characters 222 7.10 Images and Rules 223 7.11 Embedded Objects 231 7.12 Tables 232 Contents XNI

7.13 Frames 237 7.14 HTML Forms 240 7.15 Java and JavaScript 246 7.16 HTML 3 249

8 Advanced HTML Examples 255 8.1 Alignment 256 8.2 Rules 266 8.3 Images 267 8.4 Lists . 271 8.5 Anchors 272 8.6 Truly Nasty and Naughty 273 8.7 Frame Documents 275 8.8 Forms 277

9 CGI Scripts 279 9.1 Very Plain CGI Script 280 9.2 The CGI Header 282 9.3 The No-Parse-Header CGI Script 283 9.4 The Script Data 283 9.5 A Bigger Example in C 285 9.6 An Example in Perl 290 9.7 The Environment Variables 292 9.8 Script Security: Shells, Perl, C, or What? .... 295 9.9 Debugging CGI Scripts 302 9.10 CGI Examples 306

10 Tricks 335 10.1 Images 335 10.2 Serving Sounds . 344 10.3 Serving Video 349 10.4 Server-Side Includes . 353 10.5 Indexing Your Pages 358

11 WWW Utilities 369 11.1 WWW Indices and Other Information Services 370 11.2 Image Tools 377 XIV Contents

11.3 Helper Applications/External Viewers 378 11.4 HTML Editors 383 11.5 Converters to HTML 386 11.6 Converters from HTML 393 11.7 HTML Checkers 395 11.8 Proxies and Packet Filters 395 11.9 HTTP Log Parsers 397 11.10 CGI Programming 399

12 Java and JavaScript 403 12.1 A Sample Java Program 404 12.2 A Brief Java Overview by Example 407 12.3 JavaScript 414 12.4 JavaScript Examples 415 12.5 JavaScript Operators 417 12.6 The JavaScript Language 420 12.7 JavaScript Statements 420 12.8 JavaScript Objects 427 12.9 More JavaScript Examples 439

13 VRML 443 13.1 VRML Files 446 13.2 Field Values 447 13.3 Nodes 449 13.4 VRML Usage 462

Appendixes

A Uniform Resource Locators 467

B Country Code Domain Names 475

C Strftime Format Strings 479

References 483

Index 507