"Fossies" - the Fresh Open Source Software Archive 
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
1 <?xml version='1.0' encoding='UTF-8' ?>
2 <!DOCTYPE manualpage SYSTEM "../style/manualpage.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision: 420990 $ -->
5
6 <!--
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
13
14 http://www.apache.org/licenses/LICENSE-2.0
15
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
21 -->
22
23 <!--
24 Original Copyright (c) 2005 Covalent Technologies
25
26 FTP Protocol module for Apache 2.0
27 -->
28
29 <manualpage metafile="ftp_intro.xml.meta">
30 <parentdocument href="../"/>
31
32 <title>Introduction to the FTP Protocol</title>
33
34 <summary>
35
36 <p>The <strong>File Transfer Protocol (FTP)</strong> is a classic
37 standard for transfer of files and records over a TCP/IP network. It
38 was defined by Jon Postel and Joyce Reynolds in <a
39 href="http://www.rfc-archive.org/getrfc.php?rfc=959">RFC 959</a>,
40 which was released in 1985. This means that FTP precedes the HTTP
41 protocol that is usually associated with the Apache server by more
42 than half a decade. The <code>mod_ftp</code> module brings support
43 for FTP to the Apache server and includes several updates to the
44 original protocol. Most notably, <code>mod_ftp</code> implements FTP
45 over Transport Layer Security (TLS) as described in <a
46 href="http://www.rfc-archive.org/getrfc.php?rfc=4217">RFC
47 4217</a>.</p>
48
49 <p>On this manual page, a brief technical overview of the FTP protocol
50 is provided, followed by a discussion of the FTP implementation by
51 <code>mod_ftp</code>. </p>
52
53 </summary>
54
55 <seealso><a href="http://www.rfc-archive.org/getrfc.php?rfc=959">RFC
56 959 — FILE TRANSFER PROTOCOL (FTP)</a></seealso>
57 <seealso><a href="http://www.rfc-archive.org/getrfc.php?rfc=1579">RFC
58 1579 — Firewall-Friendly FTP</a></seealso>
59 <seealso><a href="http://www.rfc-archive.org/getrfc.php?rfc=4217">RFC
60 4217 — Securing FTP with TLS</a></seealso>
61 <seealso><module>mod_ssl</module></seealso>
62 <seealso><a href="../howto/auth.html">Authentication, Authorization
63 and Access Control</a></seealso>
64
65
66 <section id="protocol_overview">
67
68 <title>Overview of the FTP Protocol</title>
69
70 <p>The File Transfer Protocol (FTP) is designed to facilitate
71 bi-directional transfer of files and records between hosts on a TCP/IP
72 network. Unlike HTTP, the FTP protocol is stateful: the client
73 establishes a <em>Control Connection</em> for the duration of an FTP
74 session that typically spans multiple data transfers.</p>
75
76 <p>FTP uses a separate TCP connection for data transfer. Commands are
77 issued and acknowledged over the <em>Control Connection</em>, a TCP
78 connection to well-known port 21. If the user issues a command that
79 requires a response more elaborate than a one-line response code, a
80 <em>Data Connection</em> is established between the client and the
81 server. The response data—the contents of a file or a
82 directory listing—is sent over that data connection.</p>
83
84 <p>Historically, the data connection was established from the server
85 back to the client. The client would bind to an arbitrary port, and
86 then transmit its IP address and the port number to the server using
87 the <em>PORT</em> command. The server then set up a data connection
88 to that port on the client host, whereupon the client issues the data
89 transfer command. This approach is referred to as <em>Active</em> FTP
90 (since the server acts to set up the data connection). Unfortunately,
91 active FTP does not work well with firewalls and Network Address
92 Translation (NAT) because incoming connections are often blocked. In
93 the case of NAT, the client only instructs the server to connect to
94 its internal, non-routable IP address. Some firewalls and NAT routers
95 support the FTP protocol, but this support is not universal. In cases
96 where FTP is supported, these devices can rewrite the PORT command and
97 establish ad-hoc access rules for FTP data connections.</p>
98
99 <p>Because of these limitations, an alternative approach was developed
100 in which the direction of the data connection is reversed. This is
101 known as <em>Passive</em> FTP. Before starting a data transfer, the
102 client issues a <em>PASV</em> command. The server binds to an
103 arbitrary port number and transmits its IP address and that port
104 number back to the client. The client then sets up a data connection
105 to this address and port on the server, and issues the data transfer
106 command. Passive FTP is more firewall-friendly than Active FTP,
107 because client-side firewalls are typically more lenient on outgoing
108 connections than inbound ones.</p>
109
110 <p>While it is possible for FTP to support unauthenticated sessions,
111 in practice all sessions are authenticated. Typically, FTP servers
112 authenticate against the user database of the server on which they
113 run. To facilitate downloads by the general public, FTP servers
114 generally support a special username (by convention <em>"anonymous"</em>
115 or <em>"ftp"</em>) to provide read-only access. Users are asked (but
116 often not required) to provide their e-mail address as response to the
117 <code>Password</code> prompt.
118 </p>
119
120 <p>For more information on the basic functionality of the FTP protocol
121 please refer to <a
122 href="http://www.rfc-archive.org/getrfc.php?rfc=959">RFC 959</a> or <a
123 href="http://en.wikipedia.org/wiki/FTP">Wikipedia</a>.</p>
124
125 </section>
126
127 <!--
128 <section id="protocol_extensions">
129
130 <title>FTP Protocol Extensions</title>
131
132
133
134 </section>
135
136 <section id="mod_ftp_implementation">
137 <title>Implementation of the FTP Protocol by <code>mod_ftp</code></title>
138 </section>
139 -->
140
141 </manualpage>