From: TJ S. <cas...@us...> - 2011-11-10 23:06:40
|
Update of /cvsroot/pdd/www.proftpd.org/docs/howto In directory vz-cvs-3.sog:/tmp/cvs-serv32384 Modified Files: DisplayFiles.html ListOptions.html Rewrite.html Scoreboard.html Sendfile.html Log Message: Updating howtos for website. Index: Sendfile.html =================================================================== RCS file: /cvsroot/pdd/www.proftpd.org/docs/howto/Sendfile.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Sendfile.html 9 Feb 2009 16:34:59 -0000 1.1 +++ Sendfile.html 10 Nov 2011 23:06:37 -0000 1.2 @@ -104,6 +104,11 @@ "UseSendfile off" in your <code>proftpd.conf</code>. <p> +Bugs in certain network cards have been reported on Linux, where the use +of <code>sendfile(2)</code> triggers TCP checksum offloading bugs on these +cards when using IPv6. + +<p> <a href="http://bugs.proftpd.org/show_bug.cgi?id=3081">Bug 3081</a> also demonstrates an interesting <code>sendfile(2)</code> issue. It is a special case where the FTP client and server are on the same machine, @@ -113,10 +118,11 @@ "hang". The fix for this situation is relatively simple: "Don't do that." <p> -Finally, if your Unix kernel and your filesystems work together to support +If your Unix kernel and your filesystems work together to support the use of <code>sendfile(2)</code> properly, you may run into one last potential issue with ProFTPD's <code>ftptop</code> and <code>ftpwho</code> -utilities when <code>sendfile(2)</code> is used. These utilities rely on +utilities when <code>sendfile(2)</code> is used (at least for versions of +<code>proftpd</code> prior to 1.3.4rc1). These utilities rely on data in ProFTPD's <a href="Scoreboard.html"><code>ScoreboardFile</code></a> for providing their information, including transfer rates. The progress of a file being downloaded is tracked in the <code>ScoreboardFile</code> @@ -133,10 +139,11 @@ <code>ftptop</code> and <code>ftpwho</code>, however. <p> -<b>Future Plans</b><br> -Apache supports disabling the use of <code>sendfile(2)</code> at run-time -on a <i>per <code><Directory></code></i> basis. It would be great -if ProFTPD supported the same, so that sites could do the following: +In <code>proftpd-1.3.4rc1</code> and later, the <code>UseSendfile</code> +directive changed. Now you can use <code>UseSendfile</code> in +<code><Directory></code> sections and <code>.ftpaccess</code> files. +This allows sites to disable use of <code>sendfile(2)</code> just for specific +directories/filesystems where it might be a problem, <i>e.g.</i>: <pre> <Directory /path/to/nfs/files> UseSendfile off @@ -144,6 +151,21 @@ </pre> <p> +Instead of the usual <em>on/off</em> parameters, the <code>UseSendfile</code> +directive can also take a byte length, or a file size percentage, as parameters. +These parameters can be used so that <code>sendfile(2)</code> is used for +more optimal downloads <b>while still letting <code>ftptop</code> and +<code>ftpwho</code> display download progress rates</b>. To use this, the +best way to use specify a file size percentage such as 10% or 25%; this means +that <code>sendfile(2)</code> will be used for each 10% or 25% percent of +the size of the file being downloaded: +<pre> + <Directory /> + UseSendfile 10% + </Directory> +</pre> + +<p> <hr> <i>$Date$</i><br> Index: Rewrite.html =================================================================== RCS file: /cvsroot/pdd/www.proftpd.org/docs/howto/Rewrite.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Rewrite.html 27 May 2009 23:15:47 -0000 1.2 +++ Rewrite.html 10 Nov 2011 23:06:37 -0000 1.3 @@ -141,6 +141,30 @@ For more variables like <code>%P</code>, see the <a href="../contrib/mod_rewrite.html#RewriteCondition"><code>RewriteCondition</code></a> and <a href="../contrib/mod_rewrite.html#RewriteRule"><code>RewriteRule</code></a> descriptions. <p> +<b>Replacing Backslashes With Slashes</b><br> +Some sites have FTP clients which seem to send <code>CWD</code> and +<code>RETR</code>/<code>STOR</code> commands which use Windows-style +backslashes, <i>e.g.</i> "path\to\file". And ideally, these sites would like +to work seamlessly with such clients, without having to get the clients to +change. Can <code>mod_rewrite</code> be used to change those backslashes +into more Unix-friendly regular slashes? Absolutely. + +The following <code>mod_rewrite</code> configuration should do the trick: +<pre> + <IfModule mod_rewrite.c> + RewriteEngine on + + # Use the replaceall internal RewriteMap + RewriteMap replace int:replaceall + + RewriteRule (.*) "${replace:!$1!\\\\!/}"' + </IfModule> +</pre> +Yes, you will need the four consecutive backslashes there, in order to make it +past proftpd's config file parser (which thinks backslashes are escape +sequences) as well as the regular expression compiler. + +<p> <b>Modifying User Names</b><br> Is there a way that I can transparently change the login name that the FTP client sends, from one set of known login names to the new set of names Index: Scoreboard.html =================================================================== RCS file: /cvsroot/pdd/www.proftpd.org/docs/howto/Scoreboard.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Scoreboard.html 21 Oct 2009 16:46:43 -0000 1.2 +++ Scoreboard.html 10 Nov 2011 23:06:37 -0000 1.3 @@ -13,12 +13,14 @@ <hr> <p> -<b>What is the Scoreboard</b><br> +<b>What is the Scoreboard?</b><br> The <code>ScoreboardFile</code> is used by <code>proftpd</code> for tracking information for each current FTP session. It is necessary for things like <code>MaxClients</code>, <code>MaxClientsPerUser</code>, <i>etc</i>. -The utility programs (<code>ftpwho</code>, <code>ftpcount</code>, -<code>ftptop</code>) read the scoreboard and display its information. +The utility programs (<a href="../utils/ftpwho.html"><code>ftpwho</code></a>, +<a href="../utils/ftpcount.html"><code>ftpcount</code></a>, +<a href="../utils/ftptop.html"><code>ftptop</code></a>) read the scoreboard and +display its information. <p> Here's how <code>proftpd</code> handles its scoreboard: There is a default @@ -47,6 +49,50 @@ to see if the daemon ran into problems using that defined location. <p> +In proftpd-1.3.4rc1, a new <code>ScoreboardMutex</code> directive was added. +This file is used as a mutex for starting/ending sessions, for improving +performance under load; see <a href="http://bugs.proftpd.org/show_bug.cgi?id=3208">Bug#3208</a> for the technical details. The default path (usually +<code>var/proftpd/proftpd.scoreboard.lck</code>) for +<code>ScoreboardMutex</code> should suffice. If you need to explicitly +configure a different <code>ScoreboardMutex</code> file, make absolutely +sure that you <b>do not place the file on a networked filesystem</b>. Your +performance will suffer greatly if you do. + +<p> +<b>What's in the Scoreboard?</b><br> +What types of information about each session is tracked in the scoreboard? +What else is recorded in the scoreboard? + +<p> +The <code>ScoreboardFile</code> records the following information about +the parent/daemon <code>proftpd</code> process: +<ul> + <li>scoreboard file format identifier + <li>daemon PID + <li>daemon uptime + <li>daemon version +</ul> +and for each session, the <code>ScoreboardFile</code> records: +<ul> + <li>session PID + <li>session protocol (<i>e.g.</i> "ftp", "ftps", "sftp") + <li>session UID + <li>session GID + <li>session user name + <li>session server IP address/port + <li>session virtual host name + <li>session client IP address, DNS name + <li>session <a href="Classes.html">class</a> + <li>time since session started +</ul> +and some other data related to data transfers. The data transfer-related fields +include the filename being transferred (may be relative or absolute, depending +on what the client sent), the transfer command (<i>e.g.</i> <code>RETR</code> +for downloads, <code>STOR</code> for uploads, <i>etc</i>), the amount of +data transferred so far, and percentage of transfer completed (for downloads +only). + +<p> <b>Scrubbing the Scoreboard</b><br> There is a bad habit among system administrators of using <code>`kill -9'</code> to kill a misbehaving process. Any process that is Index: DisplayFiles.html =================================================================== RCS file: /cvsroot/pdd/www.proftpd.org/docs/howto/DisplayFiles.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- DisplayFiles.html 24 Feb 2010 18:55:58 -0000 1.2 +++ DisplayFiles.html 10 Nov 2011 23:06:36 -0000 1.3 @@ -36,13 +36,6 @@ <p> <li> - <dt><code>DisplayGoAway</code> - <dd>Displayed to a client when it cannot connect because the maximum - number of connections from its <code>Class</code> has been reached</dd> - </li> - - <p> - <li> <dt><code>DisplayFileTransfer</code> <dd>Displayed to the client whenever a file is successfully transfer, either uploaded or downloaded</dd> @@ -233,6 +226,20 @@ </tr> </table> +<p><a name="FAQ"></a> +<b>Frequently Asked Questions</b><br> + +<p><a name="DisplayPathsWithSpaces"> +<font color=red>Question</font>: I configured path which contains spaces for +<code>DisplayLogin</code>, and it doesn't work. Why not?<br> +<font color=blue>Answer</font>: If using paths/files which contains spaces, +make sure that you enclose the path in quotation marks, <i>e.g.</i>: +<pre> + DisplayLogin "/path/to/display login.txt" +</pre> +Otherwise, the configuration file parser will treat the space-separated +portions of the path as separate directive parameters. + <p> <hr> <i>$Date$</i><br> Index: ListOptions.html =================================================================== RCS file: /cvsroot/pdd/www.proftpd.org/docs/howto/ListOptions.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ListOptions.html 5 Jan 2010 17:03:51 -0000 1.2 +++ ListOptions.html 10 Nov 2011 23:06:37 -0000 1.3 @@ -30,6 +30,8 @@ <dd>Force printing of non-printable filename characters as \<i>xxx</i>, where <i>xxx</i> is the octal value of the character</dd> <li><dt>-C</dt> <dd>List entries by columns</dd> + <li><dt>-c<dt> + <dd>Sort by file status change time when <code>-t</code> is also used</dd> <li><dt>-d</dt> <dd>List directory entries instead of directory contents</dd> <li><dt>-F</dt> @@ -49,7 +51,9 @@ <li><dt>-S</dt> <dd>Sort by file size</dd> <li><dt>-t</dt> - <dd>Sort by modification time</dd> + <dd>Sort by file modification time</dd> + <li><dt>-u<dt> + <dd>Sort by file access time when <code>-t</code> is also used</dd> </ul> <p> |