webftp does not show folders below web?

Discussion in 'Installation/Configuration' started by Ben, Jul 27, 2006.

  1. Ben

    Ben HowtoForge Supporter

    I wanted to create a .htaccess to a directory of one web,
    but webftp does only show the folders in the root dir of the web, but nothing below ..../web etc. permissions are all correct, normal ftp upload works, but with webftp not.

    Any suggestions where to look at?
  2. till

    till Super Moderator

    If you click on the "web" folder, there appears no folder listing at the right side?
    If you login with a normal FTP client, do you see the folders inside web then?
  3. Ben

    Ben HowtoForge Supporter

  4. till

    till Super Moderator

    The webftp uses the normal FTP connection to connect to the server like any other client.

    Is there a folder in "web" with some uncommon chars in its name that may "confuse" the webftp script?
  5. Ben

    Ben HowtoForge Supporter

    No, it even happens with other webs....

    took a look at tcpdump but everything looked. I found out the following:
    Webftp does a LIST but in the dirlisting packet only "root" is listed not the dirs. So I guess WebFTP starts at the wrong dir and justs expects cgi-bin, phptmp, web, user etc to be there but they are not.

    Now what I have to find out is, where webftp fetches its information of ftp's root dir...
    But it seems that it does not "really" work like an ftp client... it "guesses" to much and not justs connects...
  6. till

    till Super Moderator

    WebFTP guesses nothing. It just outputs the listing it gets from the FTP server.
  7. Ben

    Ben HowtoForge Supporter

    Ok after looking at the code I see I was wrong... it reads from the right startdir, so far so good...

    but if I var_dump($contents) on line 119 of ispconfig_isp_webftp.lib.php it shows all data displayed for the users root dir, but nothign for web in that...

    EDIT 1: If I place var_dump(ftp_nlist($this->conn_id, $start)); before if($contents = @ftp_rawlist($this->conn_id, $start)) { in webftp-read, i shows me a dirlisting array for the root of the web, but FALSE which means any error, on the Listing for the dirs below...

    EDIT 2: I got the error. Anything with my ftp config seems not to be correct. It allows the users to access ALL directorys. that is why /web results in an error because web does not exists in /. So $start = ($start) ? substr($start,1) : $start; would fix the problem for a working webftp but not for my security in case of ftp... so I should take a look at my ftpconfig, why it is allowed for users browsing other dirs than their homedirs...
    Last edited: Jul 28, 2006
  8. Ben

    Ben HowtoForge Supporter

    Ok the problem I had was, proftpd allowed leaving the users homedir when connection to localhost instead of the servers IP.
    So what I did was to take the config from proftpd_ispconfig.conf pasted that to proftpd.conf and changed the IP to now it works fine....

Share This Page