Current time: 05-07-2024, 06:24 AM Hello There, Guest! (LoginRegister)


Post Reply 
[RESOLVED] Problem in using ftp_choose_dir.php with CentOS 5.4, PHP 5.2.11
Author Message
rexsham Offline
Newbie
*

Posts: 6
Joined: Dec 2009
Reputation: 0
Post: #1
[RESOLVED] Problem in using ftp_choose_dir.php with CentOS 5.4, PHP 5.2.11
I setup with a fresh CentOS 5.4 with all software packages listed in the documentation and followed the steps in the documentation.
php 5.2.11 mysql 5.1.41
Apache/2.2.3 (CentOS)
MySQL client version: 5.0.67
PHP extension: mysql
ispcp 1.0.2 stable also with ispcp 1.0.3 2009.12.17 nightly build, both with same problem

phpmyadmin , SQL and email are ok but the FTP and filemanager do not work.

I cannot get the FTP working correctly, when I access "Add FTP user"
I see the page like this:
   

I have used over a week to find the problem but i am too stupid to have that problem found.
(This post was last modified: 12-20-2009 08:58 AM by rexsham.)
12-19-2009 05:36 AM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #2
RE: Problem in using ftp_choose_dir.php
Hello ;

Work fine on OpenSUSE ; I'll try with centos.
12-19-2009 07:03 AM
Quote this message in a reply
motokochan Offline
Member
***

Posts: 274
Joined: Jul 2008
Reputation: 1
Post: #3
RE: Problem in using ftp_choose_dir.php
I see template names in the page output, which probably means that the issue with substr and PHP 5.3 wasn't resolved (or you're using a version without the fix).

Try applying the change mentioned in this post and see if you still have issues.
12-19-2009 09:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #4
RE: Problem in using ftp_choose_dir.php
Hello motokochan ;

(12-19-2009 09:22 AM)motokochan Wrote:  I see template names in the page output, which probably means that the issue with substr and PHP 5.3 wasn't resolved (or you're using a version without the fix).

No, it's not a problem with PHP5.3. Wink

Code:
[root@ispcp etc]# php -v
PHP 5.1.6 (cli) (built: Apr  7 2009 08:00:04)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
[root@ispcp etc]#

For testing, I performed a fresh install of Centos 5.4 in strict compliance with the procedure described in the howto comes with ispCP and the same hostname as rexsham for the panel access.

As I could reproduce the error, I will now correct the problem. Wink

   

EDIT:

I found the source of the problem.

That is just an FTP authentication issue due to a mistakes in the proftpd configuration file. To fix it, edit your "/etc/proftpd.conf" and change the line:

Code:
AuthOrder                  mod_sql.c mod_auth_pam.c* mod_auth_unix.c
To
Code:
AuthOrder                  mod_sql.c mod_auth_pam.c mod_auth_unix.c
Note: Here, we are simply removed the asterisk (*) after the module name because ispCP dot use PAM. So, the module "mod_auth_pam.c" should not be authoritative. See http://www.proftpd.org/docs/directives/l...Order.html for more information about this issue.

And then, restart your Proftpd server:
Code:
# /etc/init.d/proftpd/restart

Note: For the record : The fact that the template variable is not be replaced does not come from a PHP error. It is simply because when the FTP authentication fails ( I will not go into the details here ), the script stops before the variable is replaced.


logs ( /var/log/secure):

Example with no changes:
Code:
Dec 19 03:45:35 ispcp proftpd: pam_unix(proftpd:auth): check pass; user unknown
Dec 19 03:45:35 ispcp proftpd: pam_unix(proftpd:auth): authentication failure; logname= uid=0 euid=0 tty=/dev/ftpd14024 ruser=tmp_4b2c3e4f8321d@nuxwin.com rhost=127.0.0.1
Dec 19 03:45:35 ispcp proftpd: pam_succeed_if(proftpd:auth): error retrieving information about user tmp_4b2c3e4f8321d@nuxwin.com
Dec 19 03:45:37 ispcp proftpd[14024]: ispcp.nuxwin.com (127.0.0.1[127.0.0.1]) - USER tmp_4b2c3e4f8321d@nuxwin.com (Login failed): Incorrect password.
Dec 19 03:45:38 ispcp proftpd[14024]: ispcp.nuxwin.com (127.0.0.1[127.0.0.1]) - FTP session closed.

Example with my changes:
Code:
Dec 19 03:44:02 ispcp proftpd[14003]: ispcp.nuxwin.com (127.0.0.1[127.0.0.1]) - USER tmp_4b2c3df074f3f@nuxwin.com: Login successful.
Dec 19 03:44:02 ispcp proftpd[14003]: ispcp.nuxwin.com (127.0.0.1[127.0.0.1]) - FTP session closed.

Cheers ;
12-19-2009 10:31 AM
Quote this message in a reply
rexsham Offline
Newbie
*

Posts: 6
Joined: Dec 2009
Reputation: 0
Post: #5
RE: Problem in using ftp_choose_dir.php
Thanks so much for your help nuwin, it works like a charm now! The wildcard there is really causing the wrong authentication error and screwed up the display on ftp.

motokochan, thanks for your suggestion too, but my PHP is 5.2.11, not 5.3 and the error is not thrown from PHP, I have checked the logs. nuwin is right, I tried with latest stable 1.0.2 and 1.0.3 nightly build and both are reproducing the same error. That wildcard in the proftpd.conf is really causing the problem and that should be filed as a bug.

Attached is the log from my /var/log/secure and it shows the same errors in nuwin's test.

Code:
Dec 17 04:48:43 host proftpd: pam_unix(proftpd:auth): check pass; user unknown
Dec 17 04:48:43 host proftpd: pam_unix(proftpd:auth): authentication failure; logname= uid=0 euid=0 tty=/dev/ftpd23511 ruser=tmp_4b2947ab8911d@~~~~~~~~~.com rhost=127.0.0.1
Dec 17 04:48:43 host proftpd: pam_succeed_if(proftpd:auth): error retrieving information about user tmp_4b2947ab8911d@~~~~~~~~~.com
Dec 17 04:48:45 host proftpd[23511]: host.~~~~~~~~~.com (127.0.0.1[127.0.0.1]) - USER tmp_4b2947ab8911d@~~~~~~~~~.com (Login failed): Incorrect password.
Dec 17 04:48:45 host proftpd[23511]: host.~~~~~~~~~.com (127.0.0.1[127.0.0.1]) - FTP session closed.
Dec 17 04:58:59 host proftpd: pam_unix(proftpd:auth): check pass; user unknown
Dec 17 04:58:59 host proftpd: pam_unix(proftpd:auth): authentication failure; logname= uid=0 euid=0 tty=/dev/ftpd23897 ruser=tmp_4b294a130e537@~~~~~~~~~.com rhost=127.0.0.1
Dec 17 04:58:59 host proftpd: pam_succeed_if(proftpd:auth): error retrieving information about user tmp_4b294a130e537@~~~~~~~~~.com

Code:
(218.254.184.138[218.254.184.138]) - USER ftp@~~~~~~~~~.com: Login successful.
Dec 19 14:38:02 host proftpd[30325]: host.~~~~~~~~~~.com (218.254.184.138[218.254.184.138]) - FTP session closed.
(This post was last modified: 12-20-2009 01:18 AM by rexsham.)
12-20-2009 01:02 AM
Find all posts by this user Quote this message in a reply
Nuxwin
Unregistered

 
Post: #6
RE: Problem in using ftp_choose_dir.php
Hi ;

No problem ;

Please, mark the thread as RESOLVED
12-20-2009 01:07 AM
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)