Web Application Design and Implementation Apache 2 PHP5 MySQL JavaScript and Linux UNIX Quantitative Software Engineering Series 1st Edition Steven A. Gabarró - Quickly download the ebook to read anytime, anywhere
Web Application Design and Implementation Apache 2 PHP5 MySQL JavaScript and Linux UNIX Quantitative Software Engineering Series 1st Edition Steven A. Gabarró - Quickly download the ebook to read anytime, anywhere
com
OR CLICK BUTTON
DOWLOAD EBOOK
https://ebookgate.com/product/professional-lamp-linux-apache-mysql-
and-php-web-development-1st-edition-jason-gerner/
ebookgate.com
https://ebookgate.com/product/php5-and-mysql-bible-tim-converse/
ebookgate.com
https://ebookgate.com/product/apache-myfaces-1-2-web-application-
development-1st-new-edition-edition-bart-kummel/
ebookgate.com
https://ebookgate.com/product/setting-up-lamp-getting-linux-apache-
mysql-and-php-working-together-1st-edition-eric-filson/
ebookgate.com
https://ebookgate.com/product/javascript-application-design-a-build-
first-approach-1st-edition-nicolas-bevacqua/
ebookgate.com
https://ebookgate.com/product/software-specification-and-design-an-
engineering-approach-1st-edition-ph-d/
ebookgate.com
https://ebookgate.com/product/javascript-the-web-warrior-series-6th-
edition-sasha-vodnik/
ebookgate.com
Web Application Design
and Implementation
•• e T ..
~I t 807 ~
=1~WlLEY:
:12007 ;
-;
• '
. l e . . . T ..... I ...
.
r
<S achgeneration has its unique needsand aspirations. When Charles Wiley first
opened his small printing shop in lower Manhattan in 1807, it was a generation
of boundless potential searching for an identity. And we were there, helping to
define a new American literary tradition. Over half a century later, in the midst
of the Second Industrial Revolution, it was a generationfocusedon building the
future. Once again, we werethere,supplyingthe criticalscientific,technical,and
engineering knowledge that helped frame the' world. Throughout the 20th
Century, and into the :new millennium, nations began to reach out beyond their
own borders and a new international community was born. Wiley was there,
expanding its operationsaround the world to enable a global exchangeof ideas,
opinions, and know-how.
For 200 years, Wiley has been an integral part of each generation's journey,
enablingthe flowof information and understanding necessaryto meet their needs
and fulfill their aspirations. Today, bold new technologies are changing the way
we live and learn. Wiley will be there, providing you the must-have knowledge
you need to imaginenew worlds, new possibilities, and new opportunities.
Generations come and go, but you can always count on Wiley to provide you the
knowledge you need,when and whereyou need it!
Lu~';'~~.~ ~~u~
WILLIAM .... PESCE PETER BaaTH WILEY
PRESIDENT AND CHIEF' EXECUTIVE DFFlCER CHAIRMAN OF" THE BOARD
Web Application Design
and Implementation
Apache 2, PHP5, MySQL,
JavaScript, and Linux/UNIX
Steven A. Gabarro
Stevens Institute of Technology
Hoboken, New Jersey
IEEE
~computer
SOciety
60TH anniversary
"'
BICENTENNIAL
it807~
.
=~WILEY=z
.-
z
:2007~
,.~
BICENTENNIAL
WILEY-INTERSCIENCE
A John Wiley & Sons, Inc., Publication
Copyright © 2007 by John Wiley & Sons, Inc. All rights reserved.
Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their
best efforts in preparing this book, they make no representations or warranties with respect
to the accuracy or completeness of the contents of this book and specifically disclaim any
implied warranties of merchantability or fitness for a particular purpose. No warranty may be
created or extended by sales representatives or written sales materials. The advice and
strategies contained herein may not be suitable for your situation. You should consult with a
professional where appropriate. Neither the publisher nor author shall be liable for any loss
of profit or any other commercial damages, including but not limited to special, incidental,
consequential, or other damages.
For general information on our other products and services or for technical support, please
contact our Customer Care Department within the United States at (800) 762-2974, outside
the United States at (317) 572·-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears
in print may not be available in electronic formats. For more information about Wiley
products, visit our web site at www.wiley.com.
Preface xiii
About the Author / xiii
Before We Get Started I xiii
Who Should Read This Book? I xiv
About the Examples I xiv
How to Read This Book I xiv
Acknowledgments xv
1. Fundamentals 5
The Origins of the Internet I 5
The World Wide Web I 6
The Web Browsers I 7
The Web Servers I 7
TCP/IP BASICS I 8
The Internet Layer I 9
The Transport Layer I 11
The Application Layer I 11
The Toolbox I 12
Browsers I 12
FTP I 13
Email Clients I 14
Programming Tools I 14
Other Useful Tools I 15
3. Introduction to HTML 27
What Do You Need to Get Started? I 27
How Does HTML Work? I 28
Syntax Basics / 28
File Structure I 28
Tag Parameters I 30
Basic Text Formatting I 30
External References I 32
Links I 32
Images I 33
CONTENTS vii
Organizing Data / 34
Lists / 35
Tables / 36
Frames / 39
Special Characters I 43
4. Work Environment 45
Introduction I 45
Downloading the Software I 45
Installing the Apache Server I 46
Installation Steps I 46
Checking the Installation I 47
Possible Errors I 47
Configuring Apache I 48
Installing PHP5 I 48
Testing PHP I 50
Installing MySQL I 50
Adding a MySQL User I 51
How Do I Know if MySQL is Running? I 51
Installing PhpMyAdmin I 51
Installing a Bulletin Board: phpBB I 52
Installation Steps I 52
Basic Security Considerations I 54
Conclusion I 55
Multidimensional Arrays / 71
Array Functions / 74
PHP Program Structure and Flow of Control / 77
Conditions / 77
Loops / 80
Functions / 82
Bibliography 269
Index 271
Preface
Steven Gabarr6 was born in 1979 and raised in Alicante, Spain. He started
programming early, learning BASIC (Beginner's All-purpose Symbolic
Instruction Code) at age 9. Later on, in high school, he learned Turbo Pascal
and C. At that point it was pretty obvious that he was going to end up as a
computer scientist. He ended up studying for a master's degree in computer
science in the Ecole Pour l'Informatique et les Techniques Avancees, where
he specialized in advanced multimedia and Web technologies, graduating
with honors, finishing third in his class. He went to the United States in
January 2002, enrolling in the Masters of Science in Information Systems at
the Stevens Institute of Technology, in Hoboken, New Jersey. There he quickly
advanced from teaching assistant to full-time instructor. On his appointment
as full-time faculty, he created the first Web programming course at Stevens,
based on his personal experiences. This book is the result of that course, and
is a close reflection of what Steven teaches his students.
The way this book is organized, it should be ideal for anyone trying to learn
how to create complete Websites with no previous knowledge of any of the
languages presented. It does require some minimum knowledge of program-
ming in general, as well as object-oriented programming basics to understand
Chapter 8.
It is also a good read for Web designers that know about making pages
look nice, but have no knowledge of how to create dynamic pages built
through a database or anyone who would like to pick up on the art of pro-
gramming pages. Realize: that I have never been a good graphic designer, so
this book will not tell you how to do things like making decisions regarding
the proper colors, fonts, or sizes to use, or other cosmetic details. I will deal
with how to set those features up, but will not tell you how to pick your layout
or color schemes, because I am definitely not good at it. Instead, I will con-
centrate on how to actually program useful pages with loads of functionality.
All the examples have been tested, and if any are not compatible with a spe-
cific browser, this will be stated in the text. You can find all the example files,
as well as an example solution for the mini exercises and the indexer/searcher
case study at ftp://ftp.wiley.com/public/sci_tech_med/web_application. I will
also work on extra examples that I will make available to illustrate other areas
of the book that did not get a full example. I would have included many more
examples, but then you would need two or three volumes this size. Instead, I
will just put everything in a Website for you to download and test. I hope you
enjoy it all!
The book is organized to be read front to back, but you may skip chapters as you
see fit, or use the book as a reference. The Introduction is a summary of Chapter
19 and should be used by people already experienced in Web development. It is
basically meant as a guide to using this book as a "Web programming cook-
book." You may read this Introduction for brief guidelines or go straight to
Chapter 19 if you need an in-depth explanation with a practical example.
Acknowledgments
I'd like to express great thanks to my family first for always being there for
me. I wouldn't be where I am without them, and I'll never manage to thank
them enough for that. To my very close (and special, a.k.a. N.B.) friends, I
thank you for your support and patience over the years; it is not easy putting
up with me for so long, but you have always given me some of the best times
I could hope for. Quick "howdy" to my online friends at COTW and BF2C
for helping me steam off when I had too much work and needed a break.
Thanks to Larry Bernstein for allowing me the opportunity to write this
book, and of course thanks to the people at John Wiley & Sons for getting
my first book published even though I'm still "a kid." Special thanks to
Whitney, Paul and Melissa for all of their help and patience; and to Ben for
the cover image. ©
xv
Introduction
OVERVIEW
You might be wondering why you are reading an "Introduction" chapter and
why this chapter is called "Web Application Recipe." Well, this chapter is
your quick guide to professional Web application design and implementation.
It is in essence a summary of the last chapter of the book (Chapter 19),
created mainly for people with enough experience in Web programming to
skip some of the chapters presented. This chapter will give you the rundown
of the major steps in the lifecycle of a Web project, and will refer to the chap-
ters where you might find more in-depth information on the topics covered.
I call it the "recipe" because it gives you the general layout of what needs to
be done, before getting into the specific details that each individual chapter
will cover. For a more in-depth guideline with a practical example, be sure to
read Chapter 19.
PROCEDURE
Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavtiScript, and
Linux/UNIX, by Steven A. Gabarr6
Copyright © 2007 by John Wiley & Sons, Inc.
1
2 WEB APPLICATION RECIPE
Step 4-Backside
Once the core of the project is up and running, you need to implement the
back end of the project. This is the section of the project that will be used by
administrators to manage the Website after it has been published, and it is a
good idea to have it up and running before the regular users start meddling
with the Web application. If you need some information on writing scripts in
PHP, check out Chapters 5-9.
Step 8-Presentation
Assuming that you are not writing the application for yourself and there is
money involved, you will need to present your final project to your project
sponsor. The key here is to be relaxed and be confident that your project
is rock-solid. If you follow the guidelines in this book, this should not be
a problem. If you are presenting to a nontechnical person, start by showing
the general features of the project, getting into details only when asked to
do so. If you are presenting to a fellow developer, go straight to the
functionalities.
Step 9-Publication
When the project has been approved, it is time to release it. Place it in your
desired host and make sure that everything is set up properly so that users
worldwide can access it. This phase should be fairly fast.
4 WEB APPLICATION RECIPE
Not that long ago, in a galaxy pretty close by, men and women used to live
without practical means of communication. Paper was the main medium used
for information sharing and horses the main carrier for that medium. But
science kept working, and in 1831 Joseph Henry invented the first electric
telegraph. Four years later, Samuel Morse invented the Morse code, and
worked on the very first long-distance electric telegraph line, which he fin-
ished in 1843. A bigger leap in communication progress was made by Alex-
ander Graham Bell, who patented the electric telephone in 1876.Long-distance
communication was finally a reality, but still archaic compared to what was
to be achieved. With the arrival of computers in the midtwentieth century,
people realized the potential of storing and processing data in those amazing
new machines. Furthermore, the United States and the Soviet Union were
deep in the Cold War, and the fear of a possible strike was constantly present
in the military's mind. One of the main concerns was the possibility that all
communication between remote locations could be interrupted by an attack.
Telephone and telegraph lines were out in the open, and could be easily
damaged, so the National Security Agency (NSA) thought of a way to
preserve communications. Emulating the principles of telephone commu-
nication, in the 1960s, the NSA thought of connecting computers through
Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavaScript, and
Linux/UNIX, by Steven A. Gabarr6
Copyright © 2007 by John Wiley & Sons, Inc.
5
6 FUNDAMENTALS
wide-area networks (WANs), so that if the phone lines went down, they would
still be able to send orders to detachments across the country, through the
use of computers. In order to make this idea a reality, the Advanced Research
Project Agency (ARPA) created the first computer network in 1969, and
named it the ARPANET. It was composed of only four computers, located
in the University of California at Los Angeles (UCLA), the University of
California at Santa Barbara (UCSB), the University of Utah, and the Stan-
ford Research Institute (SRI). Three years later, in 1972, the use of routers
allowed the ARPANET to have 20 nodes and 50 host computers, which could
all communicate through tools such as the tel net and FTP (File Transfer
Protocol). In 1974 Vincent Cerf, from the SRI, and Robert Kahn, from the
Defense Advanced Research Project Agency (DARPA), presented the Trans-
mission Control Protocol/Internet Protocol (TCP/IP) basics, forever chang-
ing the waycomputers would communicate. In 1983the Defense Communication
Agency (DCA) took control of the ARPANET and separated the military
section to form the MILNET, which would be used for military purposes only.
In the mid-1980s the two main existing networks, the ARPANET and the
NSFNET (created by the National Science Foundation), merged to create a
massive computer network. That merge motivated a trend that brought more
and more computers to the network, and this network of networks was then
named "the Internet." By 1990 the Internet had 3000 subnets and over 200,000
host computers. The estimated number of host computers in the year 2004
was approximately 234 million, and growing.
After creation of the Internet, great potential could be seen way beyond the
actual work that was being done. Computers were destined to do more than
utilize telnets and FTP; it was great to be able to link one computer to
another in order to send files, but the problem of communication was not yet
totally solved. Scientists doing research had to connect to a remote computer
and send their research results one at the time through FTP. This was faster
than sending manuscripts through "snail mail," but it was still not the best
option, so in 1989 Tim Berners-Lee presented the World Wide Web project
to the Conseil Europeen de Recherche Nucleaire (CERN; European Orga-
nization for Nuclear Research, based in Switzerland). The idea was to come
up with a set of standards for information sharing that scientists. around the
world would be able to use. The goal was to be able to have all research
documents in a format and location accessible to all interested regardless of
the platform being used . In 1994 the World Wide Web Consortium (W3C)
was created to lead the World Wide Web (WWW) to its full potential by
developing common protocols that would promote its evolution and ensure
its operability. You can find out more about the W3C visiting their Website,
www.w3c.org.
THE WEB SERVERS 7
Right at this point we have seen what lead to the creation of the computer
network known as "the Internet," and the reasoning behind the apparition of
the World Wide Web. But we still have a main problem that we haven't
answered yet-how do we use all this to communicate? First the Internet
brought us the media through which the information would flow, then the
WWW provided a standard format for information formatting, but there
was still the problem of how to read that information. To solve that problem,
some tool had to be created that would use the current standards and decode
Web documents and format them in such a way that would be intelligible
to the user. The Web browsers came to the rescue and solved that pro-
blem. The first graphical user interface (GUI) with the WWW to appear
was Mosaic, created by the National Center of Supercomputer Applications
(NCSA) at the University of Illinois in 1993. In 1994 Norway entered in
the pages of Internet history by creating the still-used Opera. Soon after-
ward Netscape appeared, followed by Microsoft's Internet Explorer, which
appeared along Windows 95. From that point on, the browsing market
has done nothing but evolve and-Fortunately for us, the users-improve.
Nowadays the two main browsers used are Internet Explorer and Mozilla
Firefox.
Now that we know what the Internet is, the purpose of the World Wide Web,
and why we use Web browsers, another question may arise: "Where are all
these data stored?" It is definitely enlightening to know how we access all the
information that the World Wide Web has to offer, but where is all that infor-
mation? Well, the answer is pretty simple; it is in all the computers that form
the Internet. Some people become alarmed, believing that any computer con-
nected to the Internet will automatically make all of its files accessible to the
entire world. Not to worry, that is not how it works. In order to share informa-
tion in a specific computer, some software has to be installed on the computer,
making it a "Web server." The server creates a list of folders that will be
shared when someone attempts to connect to the computer using standard
Web protocols. There are two main competitors in the Web server market.
The first one, my personal favorite and the one used throughout this book, is
Apache, developed by the Apache Software Foundation (www.apache.or~).
Apache has the great advantage of being totally free of charge and works on
every platform. It is an open-source program, which means that you can actu-
ally see the code behind the server and even participate in the improvement
of Apache. It is reliable and vastly used around the world, and pretty much
the only reliable option on UNIX/Linux. The other main server is Microsoft's
Internet Information Services (lIS, www.microsoft.com/iis). lIS is not open-
8 FUNDAMENTALS
TCP/IP BASICS
THE TOOLBOX
To conclude this chapter, I will list some programs that I believe all Web
developers should know about. All opinions are entirely personal, and you
are more than free to disagree with me.
Browsers
As mentioned earlier, browsers are essential in the use of the Internet and
choosing the right one for you is an important decision to make. Throughout
this book we will discuss some of the differences between these browsers,
especially during the JavaScript coverage. The most commonly used by
Microsoft Windows users is obviously Internet Explorer (http://www.micro-
soft.com/ie/), since it comes with the operating system. MSIE is a very user-
friendly browser, and perfect for Mr. or Mrs. Anybody that just wants to
browse the web. As a developer you must know that it is a dangerous tool,
since no matter how disgusting your HTML code might be, MSIE will manage
to make the output look decent, especially when using tables or frames. So
do not assume your page is perfectly written just because MSIE displays it
nicely. One of the advantages of MSIE is that JavaScript works perfectly well
with it, so you will probably love it when we are working on that language. It
also contains many plug-in that are required in many websites, so you might
actually be required to use it to fully appreciate some websites. The major
flaw it has as far as I'm concerned, and a reason why I stopped using it, is the
number of security holes it contains. Granted, in most cases no one will ever
attack your computer using those security holes, but as a computer scientist,
I like being protected.
Another browser that had great influence in the world of browsing is
Netscape (http://browser.netscape.com/ns8/), which had a great growth in the
late 90s. Unfortunately for Netscape, it has been going downhill for few years
now, and personally it will never cross my mind to use it again until they
improve it greatly. I actually stopped using NS when they released their
version 6, mostly due to JavaScript incompatibilities that will be mentioned
in further chapters. But basically Netscape had a set of Netscape-specific
HTML tags that were both useful and necessary for the use of JavaScript on
that browser, but they decided to wipe those out on version 6, which pretty
THE TOOLBOX 13
FTP
If you are trying to install an FTP server on a Windows machine, I would
have to recommend Serv-U FTP (www.serv-u.com).Itis a great server soft-
ware that will probably allow you to do anything you want to with it. If you
are looking for an FTP server for UNIX, there are so many good, and free,
ones that I won't even bother mentioning them (there was probably one
included in your UNIX/Linux distribution).
If you are trying to get a nice FTP client, one of the most commonly used
(or at least it was when I discovered FTP) is Cute-FTP (www.cuteftp.com).
There are many others free and not free, but my favorite would have to be
LeechFTP, which allows the use of multiple threads, which speeds up the
transfer of multiple files. Unfortunately, the development of LeechFTP has
not been continued for over a year, so there are no really recent (as of 2006)
versions. I still like myoId version, though, since it never gave me any prob-
lems. It would seem (at the time of this writing) that the people working on
LeechFTP are now working on a new client called BitBeamer (www.bit-
beamer.com). I have never tried that software, so I cannot vouch for it, but it
is supposed to have all the features that LeechFTP had.
14 FUNDAMENTALS
Email Clients
One of the most widely used email clients is Outlook Express, which comes
standard with every copy of Windows (since Windows 95). It is simple and
works well, and is preinstalled with Windows, so no need to add extra soft-
ware if that is your platform. There is also the more complicated version
called Outlook, which does all Outlook Express does but adds in a calendar,
nicer agenda, but also heavier software to run. Personally I prefer the Express
version.
Another survivor of the old ages, and the first email client I ever used in
my life, is Eudora (www.eudora.com).Ihaven·tuseditsince19970rso.so I
am not really in a position to tell you how good the latest versions are.
Many users simply like using the clients that come with their browsers,
such as Netscape mail, or directly with Web-based email clients like Hotmail
(www.hotmail.com). or Yahoo (http://mail.yahoo.com), which allow you to
view emails directly on a browser. Personally I'd recommend you use Gmail
(www.gmail.com)createdbythepeoplefromGoogle.Itis by far the best
Web-based email tool I have used in over 10 years of Internet use, and it is
still in its Beta version, so Google can still improve it. The only problem is
that you can create an account only if you are invited to do so by a current
user.
If what you use is lJNIX or Linux, the two main email clients I know
and have used are "Pine" (Program for Internet News & Mail) and "Elm"
(Electronic Mail), but I would have to vouch for Elm. It is a very small simple
application that runs straight from your shell and lets you choose your text
editor. They are both usuallyincludedwith the major UNIX/Linux distributions.
Programming Tools
Whenever you start programming Webpages, you will have to choose which
software to use, and you might think you need a lot of money for licenses and
so on. Well, think again, because you have excellent tools that will be more
than enough to program Websites (and I strongly recommend that you use
these when working with this book). On Windows platform you have two
great tools called Notepad and Wordpad. I personally prefer the first one
because it is much simpler and does not have all the unnecessary things that
Wordpad has. On UNIX you have "vi" and "emacs," which is pretty much
like choosing between Red Sox and Yankees (or between Real Madrid and
Fe Barcelona), since in most cases people that like one hate the other. In my
case it is true: I love emacs and hate vi. But it is only a question of taste.
If you think those tools are too basic for you and you would like to see
some colors in your code when you type it, you might want to choose some-
thing like HomeSite by Macromedia (www.macromedia.com/software/home-
site). It is a simple text editor adapted to Web development, so it recognizes
the syntax and highlights special words and tags. It also allows you to preview
THE TOOLBOX 15
the page and comes with a great tool for the creation of style sheets. Similar
to HomeSite but a bit simpler is UltraEdit (www.ultraedit.com). which allows
you to import or create your own set of syntax rules and colors associated
with those rules.
Another well-known editing tool is Macromedia's DreamWeaver (www.
macromedia.com/software/dreamweaver). The basic way to use Dream-
Weaver is to simply drag and drop the elements you wish to have in the page.
You can also type directly in a "preview" of the page, having DreamWeaver
take care of all the actual coding. Because of this feature, I do not recommend
it for this course, since it promotes laziness, and adds too much useless code.
If you really want to use it, please use the split view and type in the code
directly. (The split view will allow you to see both the preview and code at
the same time).
Finally, we have Microsoft's FrontPage (www.microsoft.com/frontpage).
which is definitely not my favorite tool for Web programming. It creates a
large amount of unnecessary folders and files when you are just trying to
create a simple Website, and adds useless code in the pages that you create.
It might be a great option for people wanting to create a Webpage without
having to understand any of the code, like web designers, for example. If you
are a Web developer, code should be your number one priority, making Front-
Page my last choice. Last, and least, is Microsoft's Word "Export to HTML"
feature, which should be used only by non-Web-savvy people to quickly create
pages from Word documents. It is very problematic, and I discourage its
use.
Before I head on and start explaining the different languages available in the
Web programming market, let me stress that all the opinions stated are exclu-
sively my personal views. I tend to be very opinionated, but I will try to justify
both my criticism and praises of the different languages presented.
THE BASICS-HTML
The very first programming language that must be mentioned when discuss-
ing Web programming is obviously HTML. The WWW could not be what it
is today if it weren't for this language. The HTML (Hypetrext Markup Lan-
guage) is, as the name indicates, a "markup" language, which generally means
that it is based on the use of tags to provide functionality. The "code" in an
HTML file is simply text containing those tags that provide functionality and
different looks to the page. It is an interpreted client-side language, meaning
that for an HTML page to be viewed, a browser must first download it from
a server into a client machine and then execute the code line by line.
HTML relies strongly on the use of Universal Resource Identifiers (URI).
Each URI represents a way to refer to a page, an image, or even an email
Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavaScript, and
Linux/UNIX, by Steven A. Gabarr6 .
Copyright © 2007 by John Wiley & Sons, Inc.
17
18 THE DIFFERENT APPROACHES OF WEB PROGRAMMING
mydomain.com (I)
images
t mypic.jpg
myotherpic.jpg
t
files
foobar.html
otherfile.html
yetanotherfile.html
As you noticed, relative paths usually start with "..1", which means "go to
parent directory" or "'/", which means "current directory." Relative paths
are an easy way to make a Website more portable since they are independent
of the domain that the pages are in. It is especially useful if, like me, you
test all your pages in a local computer before uploading the files to your
host.
The use of URIs is pretty much a necessity in HTML because they allow
you to embed images to a page, send information from a form to a processing
script, create an image map, link to an external style sheet, create frame docu-
ments, cite an external reference, or also refer to metadata conventions to
describe the page.
THE CREATOR-SGML
Because the output produced by browsers when opening a basic XML file
tends to provide too much information, and it does not have a flexible appear-
ance, XSL was created. The eXtensible Style sheet Language is used as a
20 THE DIFFERENT APPROACHES OF WEB PROGRAMMING
In order to link our .XML file to the XSL file, you would simply add the
following line right after the «Yxml. . . . ?> line of the XML file:
SOMETHING DIFFERENT-JavaScript
Here comes one of the greater sources of confusion among young developers.
Despite the name "JavaScript," this programming language is very different
from Java. First, it is a compact, object-based scripting language, generally
used to develop client-side scripting pages, and sometimes server Internet
applications. In many cases, JavaScript is code that is embedded directly in
the HTML code of a page, to be executed by the client. This means that the
code is downloaded at the same time as is the rest of the page, making it
entirely visible. It is then interpreted line by line at the same time as are the
HTML tags. Again, it is different from Java; some of the major differences
are listed in Table 2.1.
THE SAVIOR-PHP
Well, you are probably wondering about the title I gave this section, but let
me explain my logic behind it. I am one of those old-school developers who
believe that C language is one of the best programming languages ever,
because of its flexibility and how easy it is to learn. C is a language that, with
a small toolset, can allow you to achieve pretty much anything you wish to
achieve. Well, for me, PHP is pretty much "C for the Web." The syntax is very
similar, with less syntax restrictions, as we will see little by little, but follows
the two concepts of C that I like the most: flexibility and ease of use. It is
really easy to learn; an experienced programmer can pick it up in a couple of
days. Another great asset of PHP is the fact that it runs server-side, meaning
that the code is executed before the client has access to it, but we shall discuss
this later on. Let us talk about the basics.
PHP is a recursive acronym of Hypertext PreProcessor and, as the name
indicates, works like many preprocessors found in other languages. This
means that the code is read line by line and interpreted as it goes, or at least
that was how PHP started. It is an open-source scripting language, so you will
be able to find many sites enhancing its development. It also means that the
PHP project is created and maintained by developers who wish to invest their
free time in making the product better, yet free.
PHP was designed to work for the Web, and its code is embedded directly
in HTML pages, although, as we shall see later, it is possible to separate
HTML and PHP through the use of templates. Interestingly, PHP is not
limited to work on the Web, and can actually be used to create command-line
scripts that you could run from a shell, or even GUI (Graphical User Inter-
face) applications through the use of the PHP-GTK library.
PHP is also designed to work closely with a wide variety of databases,
including Oracle, MySQL, PostgreSQL, ODBC, and Sybase among others,
making it an excellent choice for database-driven Websites, regardless of the
database you wish to use. It also includes an extensive set of libraries that
allows developers to interact with a wide range of other technologies. PHP
developers can write applications that will generate images, PDF documents,
work LDAP authentication servers, communicate with flash animations, and
many other things that unfortunately we will not be able to discuss, since it
would probably take several volumes.
THE RIVAL-ASP.NET'
Active Server Pages (ASP) and now ASP.NET are probably among the major
sources of confusion among developers. ASP used to be an actual program-
ming language developed by Microsoft that worked similarly to PHP; it was
a server-side scripting language, hence the title "the rival." With the arrival
of the .NET platform, ASP.NET received an entirely new meaning, referring
ANOTHER BIG OPTION-Perl 23
THE MYTH-CGI
Now, here is a good source of laughter among recruiters who know about Web
programming. Many people think that CGI (Common Gateway Interface) is
an actual programming language and tend to "beef up" their resumes, adding
it to their list of known programming languages, without really understanding
what CGI is. CGI is a common gateway interface, and is definitely not a pro-
gramming language. It is a standard for interfacing external applications with
information servers, or, if you prefer, a "magical door" that will allow you to
run your normal executable files in a Webpage. CGI applications are executed
in real time, allowing a dynamic output, such as, for example, generating a
Webpage adapted to a set of received inputs. The way it works is simple; you
first write an application in your favorite language and compile it to an execut-
able rename it to "file.cgi" (note that this is technically optional, and many
developers leave script names as "file.exe"; I personally discourage this).
Some of the most common allowed programming languages are etc++,
FORTRAN, Perl, TCL, UNIX Shell script, Visual Basic, and Apple script.
Of course, to make your application more useful for the Web, it is usually
written to receive a set of parameters and produce HTML code that will be
displayed as the page's output on the browser.
Even though I used Perl only when I was a computer science student, and
considering that it is never in my list of languages to use, I have nothing nega-
tive to say about it. Perl is a very powerful programming language, and also
very flexible, if anything, it is more complicated to learn and use than PHP.
It is also open-source, and one of the best options if your application is meant
to work extensively with text manipulation. Some of the most powerful regular
expression tools were created for Perl, and then exported to other languages,
24 THE DIFFERENT APPROACHES OF WEB PROGRAMMING
THE FUTURE?-C#
C# was a language created to work with .NET as a simple yet powerful object-
oriented programming language, mixing a programming interface similar to
the old Visual Basic, yet having the object-oriented features you could find
in C++. It is Microsoft's answer to Sun's Java. Java became increasingly
popular through J2EE, so Microsoft decided to create a language following
the same principles on their version of the three-tier architecture program-
ming platform, .NET. It strongly relies on XML as information exchange
format, and it is gaining popularity for programming Web services. As do
other .NET languages, it requires code to be compiled, yet it follows the
principle of Java's byte codes, by compiling into a platform-free language,
that will be interpreted by clients.
The reason behind the question mark is that even though C# is a fairly
recent language it is meant to be the flagship in the .NET revolution-or at
least that is what Microsoft representatives were announcing when they pre-
sented .NET. The reality is that its acceptance is still growing, but many .NET
developers prefer relying on older programming languages that they are more
familiar with ..NET is still gaining importance, and who knows, maybe it will
be the most predominant platform for Web services, not only on Microsoft
applications and Websites, but as a more global solution. If that happens,
surely C# will become increasingly popular and will be the first choice of
programming language for new developers.
any calculations or actions that might take place, which allows programmers
to create Webpages that will change dynamically as the code is executed.
Server-side applications run in the server, as the term indicates. This means
that when a client attempts to access a script programmed that way, the query
is sent to the server along with any input that the script might need. The script
then runs on the server, utilizing server resources only, and then sends the
final output to the client, who can see only that result, and has no access to
the source code itself. This obviously is a great asset since it protects the code,
which is very important for security reasons. Another great advantage of
having scripts run directly on the server is that you need to worry only
whether the server knows how to run it properly. Unlike the scenario in client-
side applications, the script will run exactly the same way, producing the same
output regardless of the client's platform or browser. On the negative side,
each time you wish to do something dynamic, you must communicate back
and forth between client and server.
Now that we know the differences between both sides, it is generally the
time to choose your preference, by selecting the language to use. Most devel-
opers, and therefore most books out there, tend to choose only one side, but
not me. Even though it is possible to create Websites based on just one tech-
nology, taking advantage of server-side and client-side programming simulta-
neously gives much more flexibility and allows a greater set of functionalities.
Some features run better in client-side, some in server-side, so restricting
yourself to only one will potentially limit your final project. Throughout this
book we will learn when .it is better to use a client-side language such as
JavaScript, or a server-side language like PHP.
Now that we have seen some of the most common options that programmers
face when engaging in Web programming, we must choose which technologies
to use. In our case, the choices are obviously known. One question you might
ask is why those choices and not others.
First, we have PHP. It is one of the most powerful and flexible programming
languages for the Web. It is free, is easy to learn (making it ideal for a one-
semester course), and simplifies any database access you might want to use.
JavaScript, although I do not like it as much as a language itself as it is
much more restrictive syntaxwise than PHP, is a really useful programming
language. As we will see, it is important to have a client-side language to
couple with PHP to make our pages more lifelike, dynamically changing
without having to constantly communicate with the server, and JavaScript will
help us fulfill that need.
MySQL, even though we have not discussed it yet, is a free database that
can be installed in any platform, providing a reliable solution for information
handling. It is also extremely easy to use MySQL databases with PHP, which
26 THE DIFFERENT APPROACHES OF WEB PROGRAMMING
will make our job so much easier. My "second best" option for databases
would be PostgreSQL, similar to MySQL with even some extra features, but
again, we shall follow the path of simplicity for this book.
Finally, and pretty much most importantly, these are the languages that I
have been using for years, and I never had any problems with them. Knowing
how to properly mix these three programming languages should allow you to
create any professional database-driven Website you would like to. Also,
although you might use different technologies in the future, mastering these
three will give you the mindset needed for Web development. It is like learn-
ing how to play soccer; you must learn how to kick the ball, regardless of the
shoes you will wear or the team you will support. Web programming is much
the same; if you know how to properly design a Website, the language choice
will be only secondary.
3
Introduction to HTML
Before we start discussing HTML, let me give you a checklist of things you
should have with you when programming. First, you need a basic text editor
like Notepad or emacs. You can also use more advanced tools, like the ones
mentioned in Chapter 1, but if you really wish to learn the ins and outs of
HTML, you are better off with a basic editor. The next needed thing is a
browser, which will be used to test the pages and make sure that they look
the way you want. Third, you need, obviously, some basic HTML knowledge.
Last but not least, you need good music. People usually think I'm kidding
when I mention music as a necessity, but from my experience, the right music
can activate the brain to work more efficiently. The right music will depend
on your own personal taste, but I would recommend either classical if you
work better in a calm environment or hard rock, punk, and other fast-paced
music if, like me, you prefer the music tempo to drive your fingers into a typing
frenzy. This chapter will try to make sure you have element number three:
basic HTML knowledge.
Web Application Design and Implementation: Apache 2, PHP5, MySQL, JavaScript, and
Linux/UNIX, by Steven A. Gabarr6
Copyright © 2007 by John Wiley & Sons, Inc.
27
28 INTRODUCTION TO HTML.
Syntax Basics
HTML is a markup language and, as such, works entirely through the use of
tags. Each tag is used to define different parts of the file, different styles, links,
images, embedded elements, forms, and so on. Each tag starts with the char-
acter "<" and finishes with ">". Keep this in mind because those characters
are restricted for tags, meaning that your page might behave in a strange way
if you attempt to use it in a normal string. If you wish to use that character,
refer to the special characters table shown in Appendix A. Now, some tags
require an opening and a closing tag in order to show the area of effect of the
tag. In those cases the closing tag will always start with "«I", followed by the
name of the tag it is closing (without the attributes list) and ">".
For example, to have some text appearing in white, you could use the
FONT tag, with the attribute color set to "white." To do so, your opening tag
would be <FONT color = "white"> and your closing tag would be </FONT>.
Your final portion of code would look like this:
Note that HTML is not case-sensitive, so you can mix uppercase and lower-
case letters. Nevertheless, I strongly advise everyone to capitalize all tags
since it makes code reading much easier.
Finally, remember to name your files with either .html or .htm as their
extension.
File Structure
It is very important to understand the basic structure of an HTML file,
knowing exactly where each part of your code must be written in. It is some-
thing fairly easy to remember, but unfortunately there are still people who
claim to be Web programmers but who misuse the file's main areas. Good
Web design and programming demands efficient and effective use of the
available tools. This book is designed to avoid these pitfalls.
The first thing is the full file, which must always start with the tag <HTML>
and finish with </HTMI~>. You should never have HTML tags before the
opening tag, nor after the closing one. One of the reasons for this occasional
error is the fact that most browsers can now ignore major errors like this one
and still manage to create a proper-looking output, but please always start
your files by setting up these two tags.
The next section to know is the header, limited by the tags <HEAD> and
</HEAD>. This section holds all information related to the file, including its
author, its keywords, its title, and sometimes even some JavaScript functions
that will be used in the page. Most basic pages use the header only to specify
HOW DOES HTML WORK? 29
the title that will appear on the browser window.To do so, use the <TITLE> ...
</TITLE> tags. Any text written between the opening and closing tags will
appear in the title bar of the browser.
The final area is the body, starting with <BODY> and finishing with
</BODY>. The body of a page is the actual content of the page, meaning that
the data that will appear inside the browser window. The body tag can accept
a set of properties that allow you to set up a background image (background)
or color (bgcolor); specify font colors for text (color), links (link), visited links
(vlink), active links (alink), and even action scripts to run on load or unload
of the page. There should always be a body section in a Webpage, unless you
are using the page as a frameset definition page (see discussion later).
Here is an example of what a "Hello world" HTML page should look
like:
<HTML>
<HEAD>
<TITLE>Hello World Page</TITLE>
</HEAD>
<BODY>
HELLO WORLD!!! <BR>
And have a nice day!
</BODY>
</HTML>
Note the indentation I have used. This is not required, but will improve the
readability of your code. You will also note the use of the tag <BR>, which
forces a break of line. It is important to realize that any group of white spaces
(whether it is a tab, a new line, or basic spaces) is always translated on the
screen as a single white space. This is important to know since the appearance
your code has will not necessarily be the same as in the output. Check the
following example:
<HTML>
<HEAD>
<TITLE>Hello World Page</TITLE>
</HEAD>
<BODY>
HELLO WORLD!!!
And have a nice day!
</BODY>
</HTML>
You probably noticed that this code is almost exactly the same as the previous
one except that there is no <BR> tag after "Hello World!! L" In this example,
the text "And have a nice day!" would show on the same line as "HELLO
30 INTRODUCTION TO HTML
WORLD!!!," even though it is written a line below it, because the "new line"
will be translated into a single white space.
As a teacher I enforce the use of the basic six tags needed for an HTML
proper structure, so I would recommend everyone to make it a habit to write
them all as soon as a page is created, and then fill in the blanks.
Tag Parameters
As we saw previously with the FONT and BODY tags, it is possible to add
attributes to an opening HTML tag to make it more effective. Each attribute
will affect the area after the opening tag and will finish with the closing tag.
Remember that there is no need to write the attributes in the closing tag.
Checking the W3C website (www.w3c.orG) can get you an exhaustive list of
all the attributes that tags can use, but I will give you the ones I consider most
important for the tags that I will teach you at the end of this chapter.
There are many ways to format text in HTML, but we will discuss only the
real basics right now. There will be more details on styles in Chapter 10. The
tags I am about to show you are considered to be deprecated and should be
replaced with the use of style sheets, but as much as this is true, you probably
want to get started without having to learn advanced formatting features. In
that case, the following tags are ideal.
The first basic tool commonly used for formatting text is the <P> ... </P>
tag, which stands for "paragraph." As the name indicates, it defines an area
that works as a single block, and most browsers will automatically break a new
line at the end of a paragraph. I try not to use this tag when writing normal text
since the output on the screen might be different depending on the browser, so
I prefer to handle my paragraphs manually. On the other hand, paragraphs are
really useful when using style sheets, as we will see in Chapter 10.
A very useful tool in HTML is the different heading styles that can be
used. There are six basic: levels of headings that can be used to easily write
titles, chapters, or sections. Each heading is treated as a paragraph, so a new
line is added automatically when the tag is closed. To use a heading, simply
wrap your title with «Hn» ... <IHn>, where "n" is the level of title you wish
to use from 1 to 6 (with HI the biggest heading and H6 the smallest). If you
wish to add extra linebreaks you can use, as seen earlier, the <BR> tag.
To change the appearance of text, you can use <I» ... <II> to italicize a
text, <B> . . . </B> to make it bold, or <V> . . . <IV> to underline it. As
always, these tags affect the text only between opening and closing tags. It is
also possible to use the <FONT> tag to specify colors, fonts, sizes, and back-
ground colors, for example, but it is considered poor programming practice
to use these in your HTML code since it makes it much more difficult to read.
Instead, you should use styles, which, again, we will see in Chapter 10.
BASIC TEXT FORMATTING 31
Most tags, including <P>, accept an attribute called ALIGN that allows
setting of the horizontal alignment of a block by setting it to "left," "center,"
"right," or "justify." It is also possible to center an area of the page by using
the <CENTER> . . . </CENTER> tag. The advantage of the <CENTER> tag
is that it will act on anything between opening and closing tags, regardless of
the type of element (form input, image, paragraph, button, etc.).
To do a basic enhancement on your page's look, you can use horizontal
rules. These are horizontal lines used mostly to separate sections and para-
graphs. To use it, just write <HR> with any of the following attributes:
ALIGN (left, center, or right), NOSHADE to remove the shade under the
line, SIZE (in pixels) to specify the height of the line, and WIDTH (length
in either pixels or percentage of the page) to specify the linewidth. An example
ofa nice-looking rule could be <HRALIGN=centerSIZE=l WIDTH=75%>,
which would create a line of 750/0 of the page's width, centered in the page,
and with 1 pixel height. Note that this tag does not need to be closed.
Finally, to conclude this set of basic formatting tools, I would have to add
the <BLOCKQUOTE> . . . </BLOCKQUOTE> tag. This tag was created
to be used to quote other people in a text, but it has a nice property. Any
text inside a <BLOCKQUOTE> tag is automatically indented, which is great
for a really fast indentation solution. I personally have used it in the past to
force a blank margin at the beginning of my pages, making the output
cleaner.
Here is an example using all these tags:
<HTML>
<HEAD>
<TITLE>Formatting example</TITLE>
</HEAD>
<BODY>
<BLOCKQUOTE>
All my text will show up with an indentation!
<P ALIGN=right>This is a first paragraph with right
alignment</P>
<P ALIGN=left>And this is a separate left-aligned
paragraph with things written in <I>italic</I>, <B>bold</B>,
<U>underlined</U> and even <U><B><I>all mixed up</I></B></U></P>
<CENTER>
<HR size=l width=75%>
<Hl>Headingl</Hl>
<H2>Heading2</H2>
<H6>Heading6, and like the others I'm centered!</H6>
</CENTER>
</BLOCKQUOTE>
</BODY>
</HTML>
Another Random Document on
Scribd Without Any Related Topics
Angriff, woher er auch komme, zu verteidigen und sich meinen
Befehlen und meiner Leitung, wohin ich ihn auch führen würde,
niemals zu widersetzen. Jeder hat heilig zu versprechen, mein Wohl
nach seinen Kräften zu fördern. – Alles dies soll von sämtlichen
Leuten beschworen und durch eigenhändige Unterschrift anerkannt
werden.«
Sehnsuchtsvolle Umschau.
Dreizehntes Kapitel.
Durch Kampf zum Sieg.
Abreise von Caballos und Freitags Vater. – Ankunft weißer Männer. – Ein
englisches Schiff. – Vergebliche Furcht vor Seeräubern. – Die Gefangenen. – Die
Befreiung derselben. – Bestrafung der Meuterer. – Die Meuterer werden in die Irre
geführt, überfallen und gefangen. – Wiedergewinnung des Schiffes. – Der
englische Gouverneur.
Es mochte wohl nach meiner ungefähren Schätzung, denn ich
hatte die genaue Fortführung meines Pfahlkalenders vernachlässigt,
im Monat Oktober des Jahres 1686 sein, als Don Caballos mit
Freitags Vater nach dem Festlande von Amerika absegelte. Freitag
war bei dem Abschiede von seinem Vater so betrübt, daß er Thränen
vergoß. Auch ich selbst sah mit Rührung der kleinen Barke nach;
und doch empfand ich eine innerliche hohe Freude, wenn ich
bedachte, daß dies nach 27 Jahren die erste Veranstaltung war, die
ich zu meiner Errettung aus meinem einsamen Insellande ins Werk
gesetzt hatte und welche vielleicht einen günstigen Erfolg haben
konnte. Alle meine Gedanken beschäftigten sich jetzt mit der nahen
Abreise in die Heimat, tausend frohe Hoffnungen, aber auch manche
Zweifel stiegen in mir auf. Welch ein Zeitraum, überreich an
Erfahrungen, lag zwischen meinen Jünglingsjahren und der
Gegenwart! Welche Veränderungen mochten unterdes in England
vor sich gegangen sein! Wie mochten sich vor allem meine guten
Eltern befinden, die mich gewiß längst als einen Toten beweinten?
Ich hatte jedem der beiden Reisenden eine Muskete nebst sieben
oder acht Ladungen Pulver und Blei mitgegeben und ihnen zugleich
geraten, recht sparsam und haushälterisch damit umzugehen.
Außerdem waren sie mit so viel Brot und Rosinen ausgerüstet
worden, daß sie nicht nur für sich, sondern auch für die zu
Befreienden wohl auf acht Tage ausreichten. Um den Vertrag,
dessen ich Erwähnung gethan, unterzeichnen zu lassen, gab ich dem
Spanier ein Fläschchen mit Tinte und einigen Federn mit und
verabredete das Signal, durch welches sie ihre Rückkehr schon von
fern kundgeben sollten.
Acht Tage waren seit der Abreise des Spaniers und des alten
Wilden verflossen, aber vergeblich harrten wir von Tag zu Tag der
Rückkehr meiner Gesandten entgegen. Da weckte mich eines
Morgens Freitag mit dem lauten, freudenvollen Rufe: »Herr, sie
sind wiedergekommen, sie sind da!«
Sogleich sprang ich auf, warf meine Kleider über, und ohne ein
Gewehr mitzunehmen, eilte ich dem Strande zu. Aber wie groß war
meine Bestürzung, als ich aus dem Buschwäldchen trat, das meine
Burg umgab, und, nach der See hinauslugend, eine Schaluppe
erblickte, welche mit einem lateinischen Segel versehen war und mit
frischem Winde gegen die Küste zusteuerte! Das war nicht unser
Boot, kam auch nicht von Norden her, sondern von Südost; ich rief
Freitag, der mir schon vorausgeeilt war, schnell zurück und befahl
ihm, sich dicht neben mir im Wäldchen im Versteck zu halten, denn
ich wußte nicht, ob die Leute, die da kamen, Freunde oder Feinde
seien. Dann zogen wir uns vorsichtig in unsre Burg zurück, und ich
bestieg dort sogleich mit einem Fernrohr meine Warte, um die
Ankömmlinge zu beobachten.
Kaum hatte ich den Hügel erklommen, als ich in einer Entfernung
von dritthalb Stunden gegen Südsüdost ein Schiff vor Anker liegen
sah und ganz deutlich erkannte, daß Schiff und Schaluppe
englische waren.
Unmöglich kann ich die Gefühle schildern, die sich meiner
bemächtigten. Einmal war es unaussprechliche Freude, in den
Fremden Landsleute, Engländer, Freunde zu begrüßen, dann aber
verdrängten Zweifel und Besorgnisse den Jubel in meiner Brust. Was
konnte wohl ein englisches Fahrzeug in diesem Winkel der Erde, in
diesen Gewässern suchen, in denen nie ein englischer Kauffahrer
seine Wimpel blähte? Was führte die zweifelhaften Gäste hierher, da
doch die Witterung anhaltend schön war und sie keine »Mütze voll
Wind«, wie einst mich, an dieses Eiland getrieben haben konnte?
Hier war höchste Vorsicht geboten, um nicht in die Gewalt von
Räubern oder Freibeutern zu fallen. Nicht lange stand ich auf
meinem Warteposten, als die Schaluppe sich dem Ufer näherte und
dann auf den flachen Strand trieb. Die Mannschaft stieg aus, und ich
erkannte in den Personen Engländer, acht mit Säbeln bewaffnet, drei
aber ohne Waffen und gebunden. Letztere schienen in verzweifelter
Lage zu sein, denn sie streckten die Hände flehend empor. Dieses
Schauspiel setzte mich in große Verwirrung, und Freitag, der mir
nachkam, raunte mir zu: »Sieh, Herr, diese englischen Männer essen
Gefangene, ebenso wie meine Landsleute.«
»Wie, Freitag«, entgegnete ich, »glaubst du wirklich, daß sie so
unmenschlich wären, ihre Gefangenen zu essen?«
»Ja, ja, Herr; o ich weiß, auch die Engländer essen ihre weißen
Brüder.«
»Nicht doch, Freitag«, suchte ich ihn zu belehren; »wohl möglich,
daß sie ihre Feinde dort töten werden, aber essen! – niemals!
niemals!«
»Ist aber doch kein großer Unterschied, Herr!«
Ich überlegte, wie ich wohl am besten die Gefangenen zu befreien
vermöchte, zumal ich in den Händen ihrer Peiniger Feuerwaffen nicht
bemerkte. Die Engländer selbst gingen am Ufer auf und ab, ohne
sich weiter um ihre Gefangenen zu kümmern. Obgleich nun diese
hätten frei umherlaufen können, so waren sie doch zu sehr
eingeschüchtert und setzten sich auf den Boden nieder. Ihre Lage
erinnerte mich lebhaft an jenen Augenblick, wo ich selbst durch die
Gewalt des Sturmes an diesen Strand geschleudert wurde, unter
Aufbietung der letzten Kräfte die Felsen erkletterte und jeden
Augenblick den Tod erwartete. Wie ich damals auf die Stunde der
Befreiung kaum hoffen konnte, so saßen auch jetzt diese drei armen
Unglücklichen an ödem Strande und ahnten nicht, wie nahe ihnen
die Errettung bevorstünde.
Als die fremden Gäste an der Insel angelangt waren, hatte die Flut
gerade ihre äußerste Höhe erreicht. Während sich nun die Seeleute
auf der Insel sahen, war die Ebbe bereits eingetreten, und die
Schaluppe lag gänzlich auf dem Trockenen. Ich gelangte alsbald zu
der Überzeugung, daß wenigstens zehn Stunden vergehen müßten,
ehe die Schaluppe wieder flott werden könne. Deshalb stieg ich von
meinem Beobachtungsposten herunter und ging in meine trefflich
verschanzte Burg. Da ich jedoch wußte, daß ich es jetzt mit einem
viel gewandteren Feinde zu thun haben würde, als die Wilden waren,
so lud ich mit Freitag sowohl die Kanonen als auch unsre übrigen
Feuerwaffen.
Es mochte gegen 2 Uhr nachmittags geworden sein, die Hitze
hatte eine erdrückende Höhe erreicht. Ich sah jetzt keinen der
Seeleute mehr; sie hatten sich wahrscheinlich in den Wald
zurückgezogen, um sich im Schatten der Bäume dem Schlafe zu
überlassen. Nur die drei Gefangenen saßen noch in dem Schatten
eines Baumes, ohne jedoch der Ruhe zu pflegen. Nur eine kleine
Strecke von meinem Schlößchen lagernd, befanden sie sich
gewissermaßen unter meinen Augen, dagegen gänzlich aus dem
Gesichtskreise ihrer sorglosen Verfolger.
Dieser Augenblick schien mir geeignet, die Rettung der
Gefangenen zu wagen und sie in Sicherheit zu bringen. Ich nahm
zwei Flinten, ein Pistol und ein Seitengewehr und bewaffnete Freitag
mit drei Musketen, einem Seitengewehr und einem Pistol.
Mein Aussehen flößte Furcht ein; man denke nur an meinen Anzug
aus Ziegenfellen, die hohe Mütze und den langen Bart! Auch Freitag
sah phantastisch und fürchterlich genug aus. In solchem Aufzuge
nun und wohl bewehrt gingen wir ganz nahe bis zu den Fremden
heran. Ohne von denselben bemerkt zu werden, rief ich ihnen auf
spanisch zu: »Wer sind Sie, meine Herren?«
Sie fuhren erschrocken auf, schienen jedoch bei dem Anblick
unsrer abenteuerlichen Erscheinung noch mehr überrascht zu sein;
ja sie zeigten Lust, sich davonzumachen, bis ich ihnen zurief:
»Fürchten Sie nichts von mir, Ihr Retter ist näher, als Sie glauben.«
Da zog einer von den Gefangenen den Hut ab und erwiderte sehr
ernst: »So muß er uns geradeswegs vom Himmel gesandt sein, denn
von Menschen erwarten wir keine Hilfe mehr.«
»Ich sah Ihre Not«, sagte ich. »Sie schienen Ihre rohen Begleiter
anzuflehen, und ich bemerkte, wie einer derselben drohend seinen
Säbel schwang. Sagen Sie mir, wie ich Sie erlösen kann!«
Der unglückliche Mann war außer sich vor Überraschung. »Sind
Sie ein Mensch oder ein Bote des Himmels?« rief er.
»Ich bin ein Engländer, der bereit ist, Ihnen beizustehen. Wir sind
zwar, wie Sie sehen, nur unser zwei, aber wir haben Waffen und
Munition. Sagen Sie mir daher ohne Rückhalt, was für ein Ungemach
Sie betroffen und was wir für Sie thun können.«
»Ich war Kapitän von jenem Schiffe, dessen Besatzung sich gegen
mich empörte und meinen Tod beschloß. Man kam überein, mich
nebst zwei Männern, meinem Leutnant und einem Passagier an
dieses Land auszusetzen, um uns einem ungewissen Schicksale
preiszugeben.«
»Wo sind Ihre Feinde? Wissen Sie, wohin sie gegangen sind?«
»Dort in jenen Wald«, antwortete der Kapitän.
»Sind Ihre Feinde mit Schießgewehren versehen?«
»Sie haben zwei Flinten, eine dritte liegt noch in der Schaluppe.«
»Gut, Kapitän, so folgen Sie mir vorsichtig nach dem Wäldchen.«
Sogleich setzten wir uns in Bewegung und sahen bald die Männer,
die sich sämtlich dem Schlafe überlassen hatten.
»Jetzt wäre es leicht, sie zu töten«, begann ich wieder, »ohne daß
ein einziger entkommt; oder wollen Sie die Meuterer lieber zu
Gefangenen machen?«
»Zwei von ihnen sind ausgemachte Schurken, welche auf keinen
Fall Gnade verdienen. Könnte man sich dieser beiden Menschen
bemächtigen, so würden hoffentlich die andern zu ihrer Pflicht
zurückkehren.«
»Hören Sie mich jetzt an, Sir! Wenn ich alles wage, um Sie zu
retten, würden Sie dann wohl in einige Bedingungen willigen?«
»Ich und mein Schiff, wenn wir desselben wieder habhaft werden
können, sollen ganz zu Ihrer Verfügung stehen.«
»Nun gut!« fuhr ich fort, »ich stelle Ihnen nur zwei Bedingungen.
Erstens: Solange Sie auf dieser Insel bleiben, verpflichten Sie sich
zum Gehorsam gegen mich. Die Waffen, welche ich Ihnen
anvertraue, haben Sie mir stets auf mein Verlangen zurückzugeben
und zu geloben, weder mir noch den Meinigen zu schaden, vielmehr
nur mein Bestes zu fördern. Zweitens: Kommen Sie wieder in
Besitz ihres Schiffes, so bringen Sie mich und meinen Diener samt
den Habseligkeiten, die ich besitze, unentgeltlich nach England.«
»Sir«, erwiderte darauf sofort der Kapitän, »diese Bedingungen
sind so natürlich, daß ich freudig auf dieselben eingehe.«
»Und wir«, fielen des Kapitäns beide Gefährten ein, »wir geloben,
Ihnen zu folgen, wohin es auch sein mag!«
»Brav gesprochen, ihr Männer!« erwiderte ich und drückte ihnen
die Hände. »Wohlan, ans Werk! Hier sind drei Musketen nebst Pulver
und Blei. Das beste wäre, auf die Meuterer zu feuern, während sie
noch schlafen. Bleiben einige von der Weckungssalve verschont und
bitten um Pardon, so können wir sie begnadigen.«
Währenddessen sahen wir zwei der Männer aus dem nahen
Gebüsch treten.
»Sind das die Rädelsführer?« fragte ich den Kapitän.
»Nein, Sir!«
»Gut, so lassen wir sie laufen, da sie die Vorsehung rettet. Nun
aber vorwärts!«
Angefeuert durch meine Worte, nahm der Kapitän sein Gewehr
auf, seine Gefährten thaten desgleichen, und vorwärts ging der
Marsch. Durch das entstandene Geräusch wachte ein dritter von den
Seeleuten auf. Er stieß, als er die Anrückenden sah, ein Geschrei
aus, um die Schläfer zu wecken. Letztere sprangen erschrocken auf,
aber in demselben Augenblicke feuerten der Leutnant und der
Passagier so glücklich, daß einer der Rädelsführer auf der Stelle tot
blieb, der andre verwundet wurde. Der Kapitän, der sich des
Schießens weislich enthalten hatte, stürzte auf ihn los und streckte
ihn durch einen kräftigen Kolbenschlag vollends zu Boden. Ein
andrer war leicht verwundet, die übrigen drei baten, als sie mich und
Freitag heranrücken sahen, flehentlich um Gnade. Während sie noch
auf ihren Knieen lagen, kamen auch jene beiden, die zuerst erwacht
waren, angelockt durch die gefallenen Schüsse, herbeigeeilt. Als sie
jedoch merkten, wie sehr sich die Verhältnisse verwandelt hatten
und wie ihre bisherigen Gefangenen, mit Flinten bewaffnet, Herren
des Feldes waren, so versuchten sie keinen unnützen Widerstand,
sondern unterwarfen sich gleich ihren Gefährten. Somit hatten wir
einen vollständigen Sieg errungen.
Der Kapitän wandte sich nun mit folgenden ernsten Worten an die
Besiegten: »Ihr wißt, daß ihr als Empörer und Meuterer den Tod
verdient habt. Ich will jedoch Gnade für Recht ergehen lassen und
euch das Leben schenken, aber nur unter der Bedingung, daß ihr
euern Verrat bereut und schwört, mir beizustehen, um mein Schiff
zurückzuerobern!«
Hiergegen hatte ich zwar nichts einzuwenden, verpflichtete ihn
aber dazu, die Gefangenen, solange sie auf der Insel sein würden,
an Händen und Füßen gebunden in Sicherheit zu halten. Ich ließ
ihnen daher sogleich an den Händen Fesseln anlegen und gab dem
Leutnant und Freitag den Auftrag, die Gefangenen nach der Grotte
zu bringen und ihnen die Füße zu binden.
Es befanden sich noch 26 Seeleute an Bord des Schiffes. Alle
hatten wegen ihrer Auflehnung gegen ihr Oberhaupt das Leben
verwirkt. Der Kapitän sprach sich dahin aus, daß es sehr schwierig
sein würde, ihnen wirksam beizukommen, denn sie würden sich
wohl aufs äußerste zur Wehre setzen. Wir mußten daher auf eine
List sinnen, um sie an einer Landung zu verhindern. Zu rechter Zeit
fiel mir noch ein, daß die auf dem Schiffe zurückgebliebenen Leute,
wenn ihre Kameraden mit der Schaluppe nicht zurückkämen, diese
unfehlbar mit dem zweiten Boote suchen würden und uns dann viel
zu schaffen machen könnten.
Zuerst mußte die eine Schaluppe, die sich bereits in unsern
Händen befand, unbrauchbar gemacht werden, damit sie nicht
fortgeführt werden könne. Unverweilt begaben wir uns an diese
Arbeit, nahmen Ruder, Mast, Segel, Steuerruder, ferner die Flinte, ein
Pulverhorn, eine Flasche Branntwein, eine zweite mit Rum, Zwieback
und ein großes Stück Zucker heraus. Nachdem wir alles an den
Strand gebracht, bohrten wir ein großes Loch in den Boden der
Barke, um ihre Wegführung unmöglich zu machen. Nun kamen auch
der Leutnant und Freitag zurück, und unsern vereinten
Anstrengungen gelang es bald, die Schaluppe so hoch auf den
Strand zu ziehen, daß selbst die höchste Flut sie nicht erreichen oder
wegspülen konnte.
Für jetzt ließ sich nichts weiter thun. Wir brachen deshalb nach
meiner Burg auf. Nur wenige Schritte waren wir fortgegangen, als
ein Kanonenschuß vom Schiffe her über die Wellenfläche erscholl,
jedenfalls in der Absicht, die Schaluppe zurückzurufen. Aber diese
lag in guter Ruhe und rührte sich nicht. Da der erste Signalschuß
wirkungslos blieb, so feuerte die Mannschaft des Schiffes von Zeit zu
Zeit mehrere Schüsse hintereinander ab, natürlich ohne jeden Erfolg.
Wir beschleunigten unsre Schritte, um möglichst rasch die Burg zu
erreichen. Der Kapitän sowie seine beiden Gefährten bewunderten
meine Befestigungswerke und die Kunst, wie ich sie so geschickt vor
jedem Späherauge verborgen hatte. Freilich war aber auch das
Wäldchen vor mehr als 20 Jahren gepflanzt und schnell zu solchem
Dickicht verwachsen, daß man schlechterdings nicht durchkommen
konnte, außer auf dem engen, sich durchschlängelnden Pfade, der
nur von mir und Freitag begangen wurde.
»Nun, Kapitän«, fragte ich, »wie gefällt Ihnen mein Schloß?
Gewährt diese Mauer nicht ein ganz prächtiges Versteck?«
»Vortrefflich, Sir! Hinter dieser lebendigen Mauer sind wir besser
geschützt, als wenn wir unser zwanzig wären.«
»Das ist aber noch nicht alles, Kapitän«, fuhr ich rasch fort; »ich
besitze auch noch eine Sommerresidenz, in welcher ich einen Teil
der schönen Jahreszeit zubringe. Die sollten Sie sehen, Herr; dort
liegt das Paradies der Insel! Auch diese werde ich Ihnen ehestens
zeigen können. Jetzt aber ist es notwendig, daß Sie mir samt Ihren
Genossen auf meine Warte folgen, um von dort aus das Schiff zu
beobachten. Du, Freitag, bringe die Ferngläser und einige
Erquickungen hinauf!«
Oben angelangt, bemerkten wir, wie die Schiffsmannschaft des
heftig vom Winde geschüttelten Fahrzeugs, nachdem alle ihre
Schüsse ohne die erwartete Wirkung geblieben waren, eine bunte
Flagge aufgehißt und, weil auch dieses Mittel nicht verfing, das
andre Boot ausgesetzt hatte, welches sofort der Küste zusteuerte.
Das Meer befand sich in starkem Wogengang, und die Leute in der
Schaluppe hatten kräftig zuzugreifen, um vorwärts zu kommen. Das
Boot mochte etwa mit zehn Männern, einschließlich des
Schiffsjungen, bemannt und diese sämtlich mit Schießgewehren
versehen sein.
»Leider«, sagte der Kapitän, »befinden sich unter diesen Leuten
nur drei ehrliche Burschen, welche durch Furcht zur Empörung
gezwungen worden sind. Die andern aber, hauptsächlich der
Hochbootsmann, welcher die Schaluppe kommandiert, sind so
abgefeimte Schurken, daß wir uns des Ärgsten von ihnen versehen
dürfen.«
»Oho, Leute wie wir, Kapitän«, entgegnete ich, »brauchen sich
nicht zu fürchten. Ich habe auf dieser Insel schon schlimmere Zeiten
überstanden; darum fassen Sie Mut und Vertrauen, mein Herr!«
»Ich will es!«
»Nun gut! Zunächst scheint es doch zweckmäßig gewesen zu sein,
die übrigen in der Höhle fern zu halten. Nur eins beunruhigt mich
etwas, daß nämlich drei brave Burschen unter den Ankommenden
sind, die wir schonen und uns zu eigen machen möchten.«
Jetzt näherte sich die Schaluppe dem Ufer und steuerte
demselben entlang bis zu jener Stelle, wo das zuerst angekommene
Boot angelegt hatte. Hier stieg die Rotte ans Land und zog ihre
Schaluppe hoch auf den Strand hinauf. Zuerst sahen sie nach ihrem
Boote. Wer aber malt ihre Bestürzung, als sie dasselbe fest, wie die
Arche Noahs, auf dem Trockenen sitzen, stark durchbohrt und von
der ganzen Ausrüstung entblößt sahen! Dann erhoben sie einen
dreimaligen lauten Ruf; aber keine Antwort tönte ihnen zurück. Da
dieses Signal, wie die früheren, vergeblich blieb, stellten sie sich in
einen Kreis und schossen ihre Gewehre auf einmal los, so daß es
durch die Felsenthäler wie dröhnender Donner rollte. Atemlos
lauschten sie auf eine Antwort. Doch kein menschliches Wesen ließ
seinen Ruf ertönen; nur das Echo der Berge gab den Klang der
Feuerwaffen wieder.
Da schien es den Fremden nicht mehr geheuer zu sein: schnell
setzten sie ihr Boot ins Wasser und stießen vom Strande ab. Bald
aber wendeten sie sich wieder rechtsum und steuerten geraden
Laufes von neuem auf die Insel los, um ihre vermißten Kameraden
aufzusuchen. Wirklich stiegen sieben aus, und es blieben drei Mann
zur Bewachung des Bootes zurück. Das lag freilich nicht in unsrer
Berechnung; denn was half es uns, jene sieben Männer zu
überwältigen, wenn unterdes die Zurückgebliebenen dem Schiffe
wieder zusteuern und mit demselben sich auf und davon machen
konnten?
Die sieben Gelandeten schritten, sich dicht beisammen haltend,
am Saume des dichten Buschwäldchens vor meiner Festung hin und
stiegen auf einen jener westlichen Hügel, von denen sich eine weite
Fernsicht über die Ebenen nach Nordost darbot. Oben auf dem
Gipfel begannen sie laut zu rufen. Augenscheinlich mochten sie sich
nicht weiter landeinwärts wagen, denn sie setzten sich im Schatten
eines Baumes nieder, um Rat zu halten. Plötzlich brachen sie wieder
auf und schlugen den Rückweg nach der Schaluppe ein. Dieser
Augenblick forderte zu schneller Entscheidung auf; hier konnte nur
eine List helfen.
Ich trug dem Leutnant und Freitag auf, linker Hand nach
derselben Hügelreihe, von welcher die Mannschaft hergekommen,
vorsichtig vorzugehen, dann auf einen Hügel zu steigen und aus
allen Leibeskräften so lange zu schreien, bis die Matrosen ihnen
antworten würden. Wenn dies geschehe, so sollten sie dieselben
unter wiederholtem Rufen langsam von Hügel zu Hügel in das
Gehölz des Innern locken, ohne sich jedoch von ihnen einholen zu
lassen.
Die Meuterer wollten eben wieder in See stechen, als der Leutnant
den ersten Ruf erschallen ließ. Sofort machten jene Halt und
schritten der Richtung zu, aus welcher der Ton erscholl. Unsre Leute
wiederholten ihr Geschrei, und unter fortgesetzten Lockrufen ging es
immer tiefer landeinwärts.
Jetzt schien der günstige Augenblick gekommen zu sein, um die
Schaluppe zu überfallen. Nur ein Mann befand sich in derselben; von
den beiden andern Wächtern war der eine ausgestiegen und dem
Haufen nachgerannt, während der andre ein nahegelegenes
Gebüsch aufsuchen wollte, um sich daselbst niederzulegen. Der
Kapitän schmetterte ihn durch einen Kolbenschlag tot zu Boden;
dann rief er den in der Schaluppe an, sich zu ergeben. Dieser, einer
von den verführten Meuterern, bat seinen Vorgesetzten flehentlich
um Gnade, indem er schwur, künftig Gut und Leben für den Kapitän
einsetzen zu wollen.
In der Höhle waren sechs Gefangene, von denen einer verwundet
war. Zwei andern konnte man zur Not trauen; die letzten drei aber
hielt der Kapitän so weit für zuverlässig, um sie unserm Trupp als
Verstärkung einverleiben zu können. Auch aus der zweiten
Schaluppe der Meuterer entfernten wir Mast, Segel, Ruder und
legten sie ebenfalls am hohen Strand ins Trockene. Diese Arbeit
verursachte natürlich viel Mühe, da wir nur unser vier waren. Dann
zogen wir uns in die Burg zurück.
Als wir daselbst anlangten, brach bereits die Nacht an. Wir
erquickten uns nach überstandener Mühe und Gefahr durch Reis,
Rosinen, Ziegenfleisch und Rum. Noch saßen wir um die Flamme des
Talglichtes versammelt, als auch Freitag und der Leutnant
zurückkamen. Beide hatten sich ihres Auftrags zu unsrer völligen
Zufriedenheit entledigt, hatten durch Rufen und Schreien die
Bootsleute von Hügel zu Hügel gelockt und endlich dieselben
plötzlich sich selbst überlassen. Dann waren sie nach der Festung
geeilt, so daß schwerlich vor zwei oder drei Stunden ein
Zusammentreffen bevorstand.
Nach dem Mahle schickte ich den Kapitän, den Passagier, Freitag
und jenen begnadigten Meuterer von der Schaluppe, Namens
Robertson, nach der Grotte ab, um jene drei Gefangenen, auf
deren Treue zu zählen war, hierher zu bringen, so daß wir dann
zusammen die Zahl von neun Mann ausmachten. In kurzer Zeit
kamen sie sämtlich zurück, und nachdem ich eine Musterung
gehalten, besonders aber die Meuterer in strengste Pflicht
genommen hatte, verteilte ich Waffen und Munition, im ganzen zwölf
Feuergewehre, ferner fünf Degen, wovon natürlich zwei auf meine
Person kamen.
So vorbereitet, warteten wir auf unserm Posten. Es mochte
ungefähr eine Stunde vergangen sein, als wir bemerkten, wie unsre
Feinde herannahten. Nach großer Anstrengung gelangten sie endlich
an ihren Landungsplatz. Doch wie versteinert blieben sie stehen, als
sie ihr Boot nicht im Wasser, sondern auf dem Trockenen und noch
dazu der ganzen Ausrüstung beraubt sahen! Ihr Aberglaube schien
ihnen Gespenster und Höllenspuk vorzumalen, die dieses Werk
vollbracht hätten. Kaum konnte ich jetzt meine Leute in Schranken
halten, die vor Begier brannten, auf sie loszustürzen. Indes bedachte
ich, daß in dieser Dunkelheit gar leicht auch einer der Unsrigen
verwundet werden könnte, und so wartete ich auf einen günstigen
Augenblick zum Angriff.
Der Hochbootsmann, der Verwegenste der rebellischen Schar, bot
ein verächtliches Bild, jammerte wie ein Kind, rang verzweiflungsvoll
die Hände und rannte hin und her. Er rief die verlorenen Kameraden
wiederholt laut beim Namen, aber keine Stimme der Genossen
antwortete ihm durch die finstere Nacht.
Um sicher zu gehen, rückte ich meinen Hinterhalt näher und gebot
Freitag und dem Kapitän, möglichst geräuschlos an den Feind
heranzukriechen. Es währte auch nicht lange, so kam der
Hochbootsmann mit zwei seiner Spießgesellen in die Nähe der
verborgen Lauernden. Jetzt stand der Kapitän mit Freitag auf; beide
drückten zu gleicher Zeit ab, und der Schändliche lag tot in seinem
Blute. Der eine seiner Genossen ward so getroffen, daß er nach
einer Stunde seinen Geist aufgab; der dritte aber, nur leicht
verwundet, entfloh.
Der Knall der Flinten und das Geschrei der Verwundeten galten für
uns als Zeichen des gemeinschaftlichen Vorrückens. Wie schon
bemerkt, bestand unsre ganze Armee aus neun Mann. Der Wald war
so dicht und die Nacht so dunkel, daß es den Gegnern nicht möglich
war, unsre Streitkräfte abzuschätzen. Um ihre sofortige
Unterwerfung herbeizuführen, forderte ich Robertson auf, jeden der
Feinde mit seinem Namen anzurufen.
Er rief also zuerst: »Tom Smith!«
Sogleich antwortete dieser zurück: »Bist du es, Robertson?«
»Ja, ja, ich bin's. Streckt die Waffen, oder ihr seid alle des Todes!«
»Wem sollen wir uns ergeben?« fragte Smith.
»Unser Kapitän ist hier mit 50 Mann«, antwortete Robertson. »Der
Hochbootsmann ist tot, Will Fry ist verwundet, ich selbst bin
gefangen; wenn ihr euch nicht unterwerft, so seid ihr alle verloren.«
»Wird man uns aber auch Gnade bezeigen?« fragte Tom Smith
weiter. »Wenn man uns das Leben läßt, so wollen wir uns ergeben.«
»Ich werde sogleich den Kapitän fragen«, gab Robertson zur
Antwort.
Der Kapitän ergriff aber selbst das Wort und rief: »Smith! Was ich
versprochen, halte ich. Streckt ihr sofort die Waffen, so ist euch das
Leben geschenkt, außer Will Atkins!«
»Um Gotteswillen!« rief dieser flehend, »gebt auch mir Pardon,
Kapitän. Habe ich etwa Schlimmeres verübt als die übrigen?«
»Du lügst, Atkins«, fuhr ihn der Kapitän an; »bist du es nicht
gewesen, der zuerst Hand an mich legte, der mir die Hände
gebunden und mich wehrlos gemacht hat?«
»Gnade, Gnade, Kapitän!« wimmerte Atkins.
»Das wird sich finden. Jetzt noch einmal, ihr alle streckt entweder
sofort das Gewehr, oder – –!«
Ohne Widerstand ergaben sich die Meuterer, die nun als
Gefangene durch das Wäldchen auf den freien Platz neben dem
äußeren Walle geführt wurden. Hier redete der Kapitän ihnen ins
Gewissen und stellte ihnen die traurigen Folgen, die sie sich selbst
zuzuschreiben hätten, vor.
»Ihr habt geglaubt«, schloß er seine Ansprache, »mich auf eine
öde Insel auszusetzen, aber es hat Gott gefallen, mich zu retten;
denn hier herrscht ein englischer Gouverneur, der mich
menschenfreundlich aufnahm. Ihr habt mich vorhin um Gnade
angefleht; meine Gewalt über euch ist hier zu Ende. Ihr gehört von
nun an vor den Richterstuhl des Gouverneurs.«
Diese Worte wirkten erschütternd auf die Gefangenen; sie baten
ihren Kapitän, sich für sie bei dem Gouverneur der Insel zu
verwenden.
Der inhaltschwere Titel »Gouverneur« galt meiner eignen Person.
Aber ich hielt mich nebst Freitag zurück und ließ mich nicht sehen,
denn mein Anzug war jener Würde nichts weniger wie angemessen.
Doch die Kriegslist gefiel mir, und ich erklärte mich einverstanden,
die Rolle fortzuspielen. Ich beorderte also den Leutnant an den
Kapitän.
»Herr«, berichtete jener, »Seine Exzellenz der Gouverneur
wünscht Sie zu sprechen.«
»Melden Sie Seiner Exzellenz«, erwiderte der Kapitän, »daß ich
unverweilt zu seinen Befehlen sein werde.«
Die Gefangenen mußten diesen Worten nach glauben, daß wirklich
ein Gouverneur mit Truppen in der Nähe stehe. Als der Kapitän aber
zu mir kam, schlug ich ihm vor, der Vorsicht halber unsre
Gefangenen zu teilen; ich forderte ihn auf, Atkins und die beiden
widerspenstigen Gesellen an Händen und Füßen gebunden nach der
Höhle zu schicken, die übrigen ließ ich in dem Raume zwischen den
beiden Wällen unterbringen und glaubte somit, die Mannschaft
unschädlich gemacht zu haben. Nunmehr hielt ich mit dem Kapitän,
dem Leutnant und dem Passagier Rat, wie wir uns des Schiffes
bemächtigen könnten; ich sprach die Zuversicht aus, daß uns die
Seeleute bei der Wiedereroberung unterstützen würden. Es kam
darauf an, die Stimmung derselben genau zu erforschen, weshalb
ich den Kapitän und Leutnant nach der Grotte schickte, wohin ihnen
Freitag mit einer brennenden Kerze den Weg zeigte. – Der Kapitän
sprach in mildem Tone zu seinen Matrosen: »Ich werde versuchen,
euch bei dem Gouverneur der Insel Verzeihung zu erwirken; aber ich
rechne bei euch noch auf etwas andres: Ihr sollt mir das Schiff
wiedererobern helfen, denn davon hängt alles ab. Seid ihr dazu
bereit?«
Einmütig versicherten die Seeleute, ihm in allen Stücken bis zum
letzten Blutstropfen beizustehen. Er solle sie führen, wohin er wolle,
und wenn es gegen die Hölle und den Teufel wäre.
»Ich rechne auf euch«, beendete der Kapitän das Gespräch.
Er kam zu mir zurück und teilte mir die Gesinnungen der Seeleute
mit. Da ich aber glaubte, daß unsre eigne Sicherheit keine allzugroße
Nachgiebigkeit gestattete, so sandte ich den Kapitän mit der Antwort
zurück: Die sechs gesunden Gefangenen sollten zur Expedition nach
dem Schiffe zugelassen werden; hingegen sollte Atkins mit den
beiden Verwundeten als Geiseln zurückbleiben und ohne weiteres
aufgeknüpft werden, wenn die andern der Untreue sich schuldig
machen würden. Die Begünstigten mußten feierlich geloben, dem
Gouverneur unverbrüchlichen Gehorsam zu leisten.
Die Streitkräfte, welche uns für die Eroberung des Schiffes zur
Verfügung standen, waren nun folgende. Erstens: der Kapitän, der
Leutnant und der Passagier. Zweitens: fünf Freigelassene von
der ersten Schaluppe. Drittens: Robertson, Tom Smith und drei
Freigelassene von der zweiten Schaluppe. Im ganzen also
dreizehn Mann. Ich und Freitag durften der Expedition nicht
beiwohnen, da wir unsre Burg und unser sonstiges Eigentum sowie
die Gefangenen im Auge behalten mußten.
Jetzt galt es, schnell das Loch, welches wir in eine der Schaluppen
gebohrt hatten, zu verstopfen und sie zur Kriegsfahrt auszurüsten.
Als alles instand gesetzt war, bestiegen der Kapitän, der Passagier
und fünf Mann das eine Boot, während der Leutnant mit ebenfalls
fünf Mann sich in dem andern einschiffte. Gegen Mitternacht segelte
die Mannschaft ab; ich aber harrte am Strande und lauschte über
das weite Meer, um zu vernehmen, welche Entscheidung der
nächtliche Kampf herbeiführen würde.
Es mochte gegen 2 Uhr sein, als ich vom Schiffe aus sieben
Kanonenschüsse vernahm, das verabredete Zeichen der gelungenen
Ausführung. Man kann sich keine Vorstellung von meiner Freude
machen, da ich den nahenden Augenblick meiner Rettung im Geiste
vor mir sah; ich sank auf die Kniee nieder und dankte Gott inbrünstig
für seine Barmherzigkeit. Dann begab ich mich mit Freitag nach
Hause, und bald senkte sich ein tiefer Schlaf auf unsre müden
Augen. Gegen Morgen wurden wir durch einen Kanonenschuß
geweckt, und wenige Augenblicke darauf hörte ich mich laut rufen:
»Gouverneur, Gouverneur!« Rasch bestieg ich, ein Fernglas in der
Hand, meine Warte, wo ich den Kapitän bereits anwesend fand. Er
schloß mich stürmisch in die Arme und sprach: »Mein Freund, mein
Erretter! Dort liegt Ihr, unser stattliches Schiff; es gehört Ihnen,
nebst allem, was wir besitzen!«
Ich wandte jetzt meine Blicke auf die See und sah das Schiff,
kaum eine halbe Stunde vom Ufer entfernt, in der Bai vor Anker
liegen.
Jetzt stand meiner Befreiung nichts mehr im Wege. Ein tüchtiges
Schiff war zu meiner Bereitschaft, um mich zu bringen, wohin mein
Herz begehrte. Ich umarmte den braven Kapitän und begrüßte ihn
als meinen vom Himmel gesandten Befreier, der mich aus
jahrelanger Verbannung erlösen sollte.
Als ich mich wieder erholt hatte, stiegen wir hinab. Im Innern der
Burg erzählte mir der Kapitän den Hergang.
»Sobald sich unsre Schaluppe dem Schiffe näherte«, begann
derselbe seinen Bericht, »befahl ich Robertson, die wachende
Schiffsmannschaft anzurufen und zu sagen, er brächte ihre
Kameraden zurück, die sie erst nach langem Suchen aufgefunden
hätten.
»Mit solchen Reden wußte er sie so lange zu beschäftigen, bis die
Schaluppe unter dem Schiffe beilegen konnte. Ich und unser
tapferer Mitreisender gerieten zuerst mit den Meuterern ins
Handgemenge. Sobald aber der noch schlaftrunkene stellvertretende
Hochbootsmann niedergestreckt und auch der Zimmermann
unschädlich gemacht worden, gelang es uns sehr bald, mit den
übrigen drei uns zu Meistern des Halbdecks des Schiffes zu machen.
Nachdem die gesamte Mannschaft des zweiten Bootes
nachgeklettert war, säuberten wir das Vorderdeck, drangen von da in
die Springluke, die nach der Küche führte, und nahmen hier den
Koch und noch zwei andre Meuterer gefangen.
Kampf mit den Meuterern.
ebookgate.com