You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Carsten Wiedmann <ca...@gmx.de> on 2011/02/08 17:57:03 UTC

[users@httpd] [mod_ftp] accessing root path with firefox

Hello all,

there seems to be a problem, if I try to access "ftp://localhost/" with 
firefox. Access is not not possible. Instead Apache is trying to serve 
an index document (DirectoryIndex) or if enabled an autoindex (Options 
Indexes).

e.g. without mod_autoindex and "DirectoryIndex none" the error in 
"ftp_error.log" is:
| [Tue Feb 08 16:58:42 2011] [error] [client ::1] \
|      Attempt to serve directory: C:/Users/Public/Downloads/


command.log:
| - [::1] USER anonymous
| anonymous [::1] PASS xxx
| anonymous [::1] SYST
| anonymous [::1] PWD
| anonymous [::1] TYPE I
| anonymous [::1] EPSV
| anonymous [::1] SIZE /
| anonymous [::1] MDTM /
| anonymous [::1] RETR /
| anonymous [::1] EPSV
| anonymous [::1] CWD /

The same in a subdir "ftp://localhost/test/" is working:
| - [::1] USER anonymous
| anonymous [::1] PASS xxx
| anonymous [::1] SYST
| anonymous [::1] PWD
| anonymous [::1] TYPE I
| anonymous [::1] EPSV
| anonymous [::1] SIZE /test/
| anonymous [::1] MDTM /test/
| anonymous [::1] RETR /test/
| anonymous [::1] EPSV
| anonymous [::1] CWD /test/
| anonymous [::1] LIST

With e.g. Internet Explorer it's every time working:
| - [::1] USER anonymous
| anonymous [::1] PASS xxx
| anonymous [::1] CWD /
| anonymous [::1] TYPE A
| anonymous [::1] EPSV
| anonymous [::1] LIST
| - [::1] USER anonymous
| anonymous [::1] PASS xxx
| anonymous [::1] CWD /test/
| anonymous [::1] TYPE A
| anonymous [::1] EPSV
| anonymous [::1] LIST


BTW:
in the sample configuration file "ftpd.log", there is an error in the 
transfer log LogFormat:
| LogFormat    "%{%b %e %H:%M:%S %Y}t ...

should be:
| LogFormat    "%{%a %b %e %H:%M:%S %Y}t ...


System:
Windows 7
Apache/2.2.17 (Win32) mod_ftp/0.9.6
Firefox 3.6.13

Regards,
Carsten


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] [mod_ftp] accessing root path with firefox

Posted by Carsten Wiedmann <ca...@gmx.de>.
Am 13.02.2011 23:17, schrieb Carsten Wiedmann:
> Just some more Infos on this. In my "httpd.conf" I have:
> | AddHandler cgi-script .pl .php
>
> My "ftpd.conf" is:
> | <VirtualHost _default_:21>
> | DocumentRoot "C:/Users/Public/Downloads"
> | FTP On
> | <Directory "C:/Users/Public/Downloads">
> |
> | <Files "*">
> | ForceType None
> | SetHandler None
> | </Files>
> |
> | </Directory>
> | </VirtualHost>
>
> Now if I try to access "ftp://localhost/perlinfo.pl", I get this in
> "ftp_error.log":
> | [Sun Feb 13 22:59:22 2011] [error] [client 127.0.0.1] \
> | Options ExecCGI is off in this directory: \
> | C:/Users/Public/Downloads/perlinfo.pl

Ok, If I change my "httpd.conf" (and other "AddHandler") to:
| <FilesMatch "\.(pl|php)$">
| SetHandler cgi-script
| </FilesMatch>

it's working. But I still think it should also work with AddHandler.

In addition, instead of
| <Files "*">
| ForceType None
| SetHandler None
| </Files>

I now using:
| <Location />
| ForceType None
| SetHandler None
| </Location>
because I also don't want thinks like "ftp://localhost/server-info" are 
working.


BTW:
Why is there no "SetOutputFilter None"? At the moment, every time I 
download a .shtml file through ftp, I get a [warn] in my "ftp_error.log".
It would also be nice to have something like "IndexIgnore" for mod_ftp.

Regards,
Carsten





Re: [users@httpd] [mod_ftp] accessing root path with firefox

Posted by Carsten Wiedmann <ca...@gmx.de>.
Am 10.02.2011 12:40, schrieb Carsten Wiedmann:
> Then I've found my next problem:
> I can't download any cgi/pl/php file... e.g. Firefox shows me:
> | 550 /phpinfo.php: Not a directory
>
> This happens for all files I have defined a handler somewhere. Of
> course, I've added this to my ftpd.conf:
> | <Files "*">
> | ForceType None
> | SetHandler None
> | </Files>
> Still the same problem.

Just some more Infos on this. In my "httpd.conf" I have:
| AddHandler cgi-script .pl .php


My "ftpd.conf" is:
| <VirtualHost _default_:21>
| DocumentRoot "C:/Users/Public/Downloads"
| FTP On
| <Directory "C:/Users/Public/Downloads">
|     DirectoryIndex none
|     Options None
|
|     Order Allow,Deny
|     Allow from all
|
|     <FilesMatch "(desktop\.ini|folder\.jpg|Thumbs\.db)">
|         Deny from all
|     </FilesMatch>
|
|     <Files "*">
|         ForceType None
|         SetHandler None
|     </Files>
|
|     AuthName "Use 'anonymous' and email address for guest entry"
|     AuthType basic
|     AuthBasicProvider anon
|
|     Anonymous *
|     Anonymous_MustGiveEmail Off
|     Anonymous_LogEmail Off
|     Anonymous_VerifyEmail Off
|     Anonymous_NoUserId On
|
|     require valid-user
| </Directory>
| </VirtualHost>

Now if I try to access "ftp://localhost/perlinfo.pl", I get this in 
"ftp_error.log":
| [Sun Feb 13 22:59:22 2011] [error] [client 127.0.0.1] \
| Options ExecCGI is off in this directory: \
| C:/Users/Public/Downloads/perlinfo.pl

BTW:
I also get this error message, if "perlinfo.pl" not exists...


If I remove:
| AddHandler cgi-script .pl .php

from my "httpd.conf", I can download the file. But should "SetHandler 
None" in my ftpd.conf not doing the same? Or how must I configure my 
"ftpd.conf" to be able to download .pl files (without removing the entry 
from "httpd.conf")?


Regards,
Carsten



Re: [users@httpd] [mod_ftp] accessing root path with firefox

Posted by Carsten Wiedmann <ca...@gmx.de>.
Am 08.02.2011 21:23, schrieb William A. Rowe Jr.:
> Hi Carsten, you've certainly found dev@ worthy flaws :)

Hi William, I guess I should move my problem with mod_fcgid also to 
dev@? But first some more infos about mod_ftp...


>> command.log:
>> | anonymous [::1] RETR /
>
>> | anonymous [::1] RETR /test/

With the console ftp I see a difference:
| ftp> literal RETR /
| 150 Opening ASCII mode data connection for /
| ftp> literal RETR /test/
| 550 /test/: Permission denied


Then I've found my next problem:
I can't download any cgi/pl/php file... e.g. Firefox shows me:
| 550 /phpinfo.php: Not a directory

This happens for all files I have defined a handler somewhere. Of 
course, I've added this to my ftpd.conf:
| <Files "*">
|     ForceType None
|     SetHandler None
| </Files>
Still the same problem.


Now a question to the build process.
Should "Makefile-ftp.win" works with VS2008 (nmake build)? It's not 
working for me. Now I have changed the file so it looks like the 
Makefile from mod_fgcid. With this change I can build the module in the 
shell with:
| nmake /f Makefile-ftp.win _buildr SHORT=R LONG=Release



>> | LogFormat    "%{%b %e %H:%M:%S %Y}t ...
>>
>> should be:
>> | LogFormat    "%{%a %b %e %H:%M:%S %Y}t ...

The same you can found in "ftp_tls.xml" (and the online docu).

Regards,
Carsten


Re: [users@httpd] [mod_ftp] accessing root path with firefox

Posted by "William A. Rowe Jr." <wr...@rowe-clan.net>.
Hi Carsten, you've certainly found dev@ worthy flaws :)

On 2/8/2011 10:57 AM, Carsten Wiedmann wrote:
> Hello all,
> 
> there seems to be a problem, if I try to access "ftp://localhost/" with firefox. Access is
> not not possible. Instead Apache is trying to serve an index document (DirectoryIndex) or
> if enabled an autoindex (Options Indexes).
> 
> e.g. without mod_autoindex and "DirectoryIndex none" the error in "ftp_error.log" is:
> | [Tue Feb 08 16:58:42 2011] [error] [client ::1] \
> |      Attempt to serve directory: C:/Users/Public/Downloads/
> 
> 
> command.log:
> | - [::1] USER anonymous
> | anonymous [::1] PASS xxx
> | anonymous [::1] SYST
> | anonymous [::1] PWD
> | anonymous [::1] TYPE I
> | anonymous [::1] EPSV
> | anonymous [::1] SIZE /
> | anonymous [::1] MDTM /
> | anonymous [::1] RETR /
> | anonymous [::1] EPSV
> | anonymous [::1] CWD /

Interesting, will research, odd that they react differently but I suspect
it is the response code from httpd/mod_ftp and not Mozilla's fault.

> The same in a subdir "ftp://localhost/test/" is working:
> | - [::1] USER anonymous
> | anonymous [::1] PASS xxx
> | anonymous [::1] SYST
> | anonymous [::1] PWD
> | anonymous [::1] TYPE I
> | anonymous [::1] EPSV
> | anonymous [::1] SIZE /test/
> | anonymous [::1] MDTM /test/
> | anonymous [::1] RETR /test/
> | anonymous [::1] EPSV
> | anonymous [::1] CWD /test/
> | anonymous [::1] LIST
> 
> With e.g. Internet Explorer it's every time working:
> | - [::1] USER anonymous
> | anonymous [::1] PASS xxx
> | anonymous [::1] CWD /
> | anonymous [::1] TYPE A
> | anonymous [::1] EPSV
> | anonymous [::1] LIST
> | - [::1] USER anonymous
> | anonymous [::1] PASS xxx
> | anonymous [::1] CWD /test/
> | anonymous [::1] TYPE A
> | anonymous [::1] EPSV
> | anonymous [::1] LIST
> 
> 
> BTW:
> in the sample configuration file "ftpd.log", there is an error in the transfer log LogFormat:
> | LogFormat    "%{%b %e %H:%M:%S %Y}t ...
> 
> should be:
> | LogFormat    "%{%a %b %e %H:%M:%S %Y}t ...

Will review, thanks