Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Absolute BSD - The Ultimate Guide To FreeBSD (2002).pdf
Скачиваний:
25
Добавлен:
17.08.2013
Размер:
8.15 Mб
Скачать

Chapter 15: Web and FTP Services

Overview

Although the Internet started back in the 1970s, it wasn't until the advent of Web pages in the mid−1990s that the Internet became a household name. The Netscape Corporation took the open−source Web browser Mosaic and turned it into a commercial product. The result was an information and communication revolution that is still going on. While many dot−com companies have crashed and burned, an age of person−to−person communication began with the Netscape Web browser. Technologies such as peer−to−peer are expanding the Internet even further, but the Web is still what comes to mind when people think of the Internet.

FreeBSD's Web server performance is legendary. For many years, some Microsoft subsidiaries even used FreeBSD in preference to their own Windows NT platform. (The very day I write this, the Wall Street Journal announced that Microsoft is still using FreeBSD internally, despite corporate protestations to the contrary.) This has led to Microsoft releasing a shared−source ".NET for FreeBSD" toolkit. Yahoo! runs FreeBSD, as do a wide variety of other high−demand Web server farms. The Apache Web server, the most popular Web server in the world, is developed on FreeBSD.

This chapter will discuss building your own high−performance Web and FTP server with FreeBSD.

How a Web Server Works

A basic Web server is fairly straightforward: A Web browser requests a page and a Web server spits it out then closes the connection. That's the easy part. Things get considerably more complicated when you start to use modules, dynamic pages, and so on, but we'll discuss the basics in this chapter.

The Web uses Hypertext Transfer Protocol, or HTTP, a very simple protocol like POP3. Over the last few years, functions have been added to HTTP to make it more complicated, but basic HTTP operations are simple enough to be performed by hand. Let's try it: We'll telnet(1) to connect to port 80 on a server, and type GET /.

...............................................................................................

# telnet blackhelicopters.org 80

Trying 209.69.178.18...

Connected to blackhelicopters.org. Escape character is '^]'.

GET /

<font color=white> Nothing to see here.

This is not the site you're looking for. Connection closed by foreign host.

#

...............................................................................................

If you've ever looked at any HTML, the output from this command should look very familiar to you. If not, you might check the "view source" option on your Web browser the next time you call up a Web page. You'll see that this is the actual HTML that generates the pretty picture in your browser. (If you can't get this much from your Web server, it probably isn't working. Check your error logs.)

335