FTP-Upload

Master-Basti

Registered User
Hallo zusammen,

ich habe einen Root-Server mit Confixx 3 Pro und habe festgestellt, dass das Tool WebFTP nicht richtig funktioniert, bzw. diverse Einstellungen auf dem Server nicht stimmen können.

Beim Upload einer Datei erhalte ich folgende Fehlermeldung:
Code:
Warning: fopen(): open_basedir restriction in effect. File(/tmp/phpW5YlpR) is not within the allowed path(s): (/var/www/confixx) in /var/www/confixx/html/ftplogin/ftp_index.php on line 64

Warning: fopen(/tmp/phpW5YlpR): failed to open stream: Operation not permitted in /var/www/confixx/html/ftplogin/ftp_index.php on line 64

Warning: filesize(): open_basedir restriction in effect. File(/tmp/phpW5YlpR) is not within the allowed path(s): (/var/www/confixx) in /var/www/confixx/html/ftplogin/ftp_index.php on line 65

Warning: fread(): supplied argument is not a valid stream resource in /var/www/confixx/html/ftplogin/ftp_index.php on line 65

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/confixx/html/ftplogin/ftp_index.php on line 66
Fällt einem dazu was ein ?
Ich denke es betrifft den Safe-Mode... aber sollte Confixx nicht ohnehin die richtigen Einstellungen bereits mitliefern ?

Freue mich auf eure Antworten und verbleibe

Mit freundlichem Gruß

Master-Basti
 
Last edited by a moderator:
Warning: fopen(): open_basedir restriction in effect. File(/tmp/phpW5YlpR) is not within the allowed path(s):
Die Fehlermeldung ist wichtig... der Rest sind Folgefehler.

Das hat mit openbase_dir zu tun. WebFTP will Daten in "/tmp" zwischenspeichern, darf aber laut Serverkonfig nicht darauf zugreifen.
Vielleicht kann man in einer Config Datei von WebFTP angeben, wo er die Daten speichern soll.


aber sollte Confixx nicht ohnehin die richtigen Einstellungen bereits mitliefern?
Wer weiss, was du am Server rumgestellt hast ;)
"Ich habe nichts gemacht" zaehlt nicht.
 
Hallo Guin,

ich danke Dir erstmal für deine Antwort. Der Support möchte mir ausschließlich folgendes verraten:

das von Ihnen angemietete System funktioniert einwandfrei. Das Sie einstellungen wie safemode und openbasedir unterliegen ist gewollt. Sie können die Einstellungen in der zentralen Serverkonfiguration selbständig ändern.

Toll oder ? Die Zentrale Serverkonfiguration wird dann denke ich mal die /etc/apache2/confixx_mhost.conf

Dort steht unter anderem dass drinne und könnte relevant sein ?!
Code:
<VirtualHost 85.25.147.151:80>

  ServerName meinserver.de
	
  #User confixx
  #Group confixx
  DocumentRoot /var/www/confixx/html
  Options FollowSymLinks

  php_admin_flag safe_mode Off
  php_admin_flag file_uploads On
  php_admin_flag track_vars On
  php_admin_flag magic_quotes_runtime Off
  php_admin_flag magic_quotes_gpc Off
  php_admin_value upload_tmp_dir /var/www/confixx/tmp
  php_admin_value include_path ".:/var/www/confixx/html/include:/var/www/confixx/html"
  php_admin_value default_charset none
  php_admin_value open_basedir /var/www/confixx

  php_admin_value session.cookie_path /
  php_admin_value session.auto_start 0
  php_admin_value session.gc_maxlifetime 1800
  php_admin_value session.use_cookies 1
  php_admin_value session.cookie_lifetime 0
  php_admin_value session.cookie_secure Off
  php_admin_value session.use_trans_sid 0

  ScriptAlias /cgi-bin/ /var/www/confixx/html/cgi-bin/
	
  <IfModule mod_dir.c>
    DirectoryIndex index.html index.htm index.shtml index.cgi index.php
  </IfModule>


  CustomLog /var/log/apache2/meinserver.de_access.log "%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\""
  ErrorLog /var/log/apache2/meinserver.de_error.log


</VirtualHost>

Ich habe jetzt auch schonmal wo gelesen, dass es unter anderem mit dem Servernamen zusammenhängen kann ? Aber welche Einstellungen, sind dann wo relevant ?

Hat noch jemand eine Idee ?

In Zeile 64 in der ftp_index.php steht übrigens das:
PHP:
$fd = fopen ($filename, "rb");

Gruß

MAster-Basti
 
Der Support hat dir eine gut umfassende Antwort gegeben. Fuer die Serverkonfiguration ist der Support nicht zustaendig.

"/etc/apache2/confixx_mhost.conf" sieht gut aus.
Du kannst mal testweise den "openbase_dir" Eintrag mit "/tmp" erweitern und schauen, ob es dann geht.
 
Mir ist in diesem Zusammenhang auch aufgefallen, dass WEBFTP unnormal viele Systemresourcen benötigt. Die Auslastung liegt während eines Aurufs von WebFTP bei 99,9%. Halte ich nicht für normal ?!?!?

OpenBaseDir habe ich jetzt wie folgt erweitert:
Code:
php_admin_value open_basedir ".:/var/www/confixx:/tmp"

und funktioniert einwandfrei. Leider muss ich aber auch bei WebFTP 5-6 mal klicken, bevpr irgendetwas geht. Das lässt sich vll. damit erklären, dass auch die normale FTP-Verbindung nicht richtig funktioniert....

Folgende Fehlermeldung erhalte ich im Client:
Code:
[11:33:24] SmartFTP v2.0.1000.2
[11:33:24] Resolving host name "servername.de"
[11:33:24] Connecting to IP-Adresse Port: 21
[11:33:24] Connected to servername.de.
[11:33:24] 220 FTP Server ready.
[11:33:24] USER web22
[11:33:24] 331 Password required for web22.
[11:33:24] PASS (hidden)
[11:33:24] Cannot login waiting to retry (30s)...
[11:33:24] Server closed connection

Man beachte, Benutzer und Passwort sind richtig. Versuche ich es dann ein 2tes odder 3tes mal, funktioniert es!

In den Log-Dateien steht folgendes, weshalb ich vermute, dass es an dem Modul mod_delay liegt:

Code:
Jan  2 11:34:28 s9 proftpd[23388]: servername.de (p5083CB23.dip0.t-ipconnect.de[80.131.203.35]) - FTP session opened. 
Jan  2 11:34:28 s9 proftpd[23388]: servername.de (p5083CB23.dip0.t-ipconnect.de[80.131.203.35]) - mod_delay/0.4: delaying for 5 usecs 
Jan  2 11:34:28 s9 proftpd[23388]: servername.de (p5083CB23.dip0.t-ipconnect.de[80.131.203.35]) - mod_delay/0.4: delaying for 417 usecs 
Jan  2 11:35:23 s9 proftpd[23314]: servername.de (Nb6be.n.pppool.de[89.50.182.190]) - FTP session closed.

Ich habe daher bereits folgenden Eintrag in der /etc/proftpd.conf hinterlegt:

Code:
DelayEngine	  off

Anscheint ohne Erfolg! Wobei mir aufgefallen, ist, dass der Fehler scheinbar nur im Passive Mode auftritt!

Wäre nochmals dankbar für Hilfe! :)

Gruß

Master-Basti
 
Keiner eine Idee ?

IdentLookups off bringt übrigens auch nichts......
Ich verstehe nur nicht, warum das deaktivieren der DelayEngine nichts bringt, wenn der Fehler in den Logs genau sagt, dass es daran liegt.... :(

Gruß

MAsterBasti
 
mod_delay/0.4: delaying for 5 usecs
Es liegt nicht unbedingt an mod_delay. Diese Meldung bedeutet nur, dass die Serverantwort um 5usec verzoegert wurde. Dies wird gemacht, damit man gueltige Benutzernamen nicht schon an der Antwortzeit des Servers erkennen kann.
mod_delay kann unter Umstaenden Probleme machen. In deinem Fall sieht es nicht unbedingt danach aus.

Seit heute oder gestern gibt es ein Update fuer ProFTP per apt (ich weiss jetzt nicht genau aus welcher Quelle das Update stammt). Vielleicht hift das bei dir ein wenig weiter.

Ansonsten poste mal deine proftpd.conf .
 
Gute Frage.....

Hier die proftpd.conf:
Code:
#### CONFIXX PRO-FTPD CONFIG FILE ####
    #### created at Fri Oct 20 11:21:34 UTC 2006 ###

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName      server.de
ServerType      standalone
DefaultServer   on
ServerAdmin     admin@domain.de
ServerIdent     on "FTP Server ready."
ListOptions     "-a"
DelayEngine	  off
IdentLookups    off

# Port 21 is the standard FTP port.
Port                            21

# Umask 022 is a good standard umask to prevent new dirs and files
# from being group and world writable.
Umask                           022

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances                    30

# Set the user and group that the server normally runs at.
User                            nobody
Group                           nogroup

TransferLog                     /var/log/xferlog

# Normally, we want files to be overwriteable.
AllowOverwrite                  on

#
# Do a chroot for web-users (i.e. public or www group), but
# do not change root if the user is also in the users group...
#
#DefaultRoot ~/public_html       public,!users
#
DefaultRoot                     ~

# Groups that are not allowed to login
<Limit LOGIN>
 DenyGroup poponly
</Limit>


    ### ENDE ####

Hoffe es hat noch jmd. eine Idee... :)
 
Unter "IdentLookups off" noch "UseReverseDNS off" einfuegen.

Vielleicht hilft es noch die PassivPorts zu beschraenken
PassivePorts 60000 60100

Koennte es sein, dass eine lokale Firewall die Verbindung wieder trennt?
Bei FTP wird mit Port 21 angefangen. Dann wird aber fuer den Datenstrom auf andere Ports ausgewichen. Wenn da nun eine sehr resolute Firewall im gange ist, kommt es zum Verbindungsabbruch (sollte aber eigentlich nicht sein).
 
So, habe die Logs nochmal angeschaut. Da tut sich eine Menge...


Code:
Jan  9 18:06:08 s9 proftpd[18620]: server.de (localhost.localdomain[127.0.0.1]) - FTP session opened. 
Jan  9 18:06:08 s9 proftpd[18620]: server.de (localhost.localdomain[127.0.0.1]) - mod_delay/0.4: delaying for 228 usecs 
Jan  9 18:06:08 s9 proftpd[18620]: server.de (localhost.localdomain[127.0.0.1]) - mod_delay/0.4: delaying for 3071 usecs 
Jan  9 18:06:08 s9 proftpd[18620]: server.de (localhost.localdomain[127.0.0.1]) - FTP session closed. 
Jan  9 18:49:07 s9 inetd[18907]: restart: No such file or directory
Jan  9 18:49:43 s9 proftpd[19275]: server.de (p5083A9A3.dip0.t-ipconnect.de[IP]) - FTP session opened. 
Jan  9 18:49:44 s9 proftpd[19275]: server.de (p5083A9A3.dip0.t-ipconnect.de[IP]) - FTP session closed. 
Jan  9 18:49:45 s9 proftpd[19276]: server.de (p5083A9A3.dip0.t-ipconnect.de[IP]) - FTP session opened. 
Jan  9 18:49:45 s9 proftpd[19276]: server.de (p5083A9A3.dip0.t-ipconnect.de[IP]) - ProFTPD terminating (signal 11) 
Jan  9 18:49:45 s9 proftpd[19276]: server.de (p5083A9A3.dip0.t-ipconnect.de[IP]) - FTP session closed. 
Jan  9 18:50:26 s9 proftpd[19365]: server.de - Failed binding to 0.0.0.0, port 21: Address already in use 
Jan  9 18:50:26 s9 proftpd[19365]: server.de - Check the ServerType directive to ensure you are configured correctly. 
Jan  9 18:50:44 s9 proftpd[19374]: server.de - Failed binding to 0.0.0.0, port 21: Address already in use 
Jan  9 18:50:44 s9 proftpd[19374]: server.de - Check the ServerType directive to ensure you are configured correctly. 
Jan  9 18:52:03 s9 proftpd[2843]: server.de - ProFTPD killed (signal 15) 
Jan  9 18:52:03 s9 proftpd[21275]: server.de (pD9575F09.dip.t-dialin.net[217.87.95.9]) - FTP session closed. 
Jan  9 18:52:03 s9 proftpd[2843]: server.de - ProFTPD 1.2.10 standalone mode SHUTDOWN 
Jan  9 18:52:15 s9 proftpd[19574]: server.de - ProFTPD 1.2.10 (stable) (built do mrt 22 18:28:32 CET 2001) standalone mode STARTUP 
Jan  9 18:52:19 s9 proftpd[19585]: server.de - Failed binding to 0.0.0.0, port 21: Address already in use 
Jan  9 18:52:19 s9 proftpd[19585]: server.de - Check the ServerType directive to ensure you are configured correctly.

Die proftpd.conf sieht jetzt wie folgt aus:

Code:
#### CONFIXX PRO-FTPD CONFIG FILE ####
    #### created at Fri Oct 20 11:21:34 UTC 2006 ###

# This is a basic ProFTPD configuration file (rename it to
# 'proftpd.conf' for actual use.  It establishes a single server
# and a single anonymous login.  It assumes that you have a user/group
# "nobody" and "ftp" for normal operation and anon.

ServerName      server.de
ServerType      standalone
DefaultServer   on
ServerAdmin     admin@domain.de
ServerIdent     on "FTP Server ready."
ListOptions     "-a"
DelayEngine	  off
IdentLookups    off
UseReverseDNS   off
PassivePorts 60000 60100
 
server.de - Failed binding to 0.0.0.0, port 21: Address already in use
Jan 9 18:52:19 s9 proftpd[19585]: server.de - Check the ServerType directive to ensure you are configured correctly.

Kann es sein, dass du deinen Proftpd zwar auf standalone konfiguriert hast, ihn aber nicht aus dem inetd genommen hast?

MfG
 
DAs ist eine berechtigte Frage, die ich mir jetzt auch selber stellen muss.
NAch Einsicht in die /etc/inetd.conf, musste ich allerdings feststellen, dass dort alles auskommentiert ist "#". Das finde ich komisch....

Wö könnte ich den proftpd sonst noch entfernen ?

Gruß
 
Hallo,

durch das Update auf Confixx 3.1 hat sich die URL zum WebFTP aus
Sicherheitsgründen geändert. Bitte logge dich dazu auf den
Webserver mit diesem Link ins Confixx-Endkundenmenü ein:
entweder mit http://host.domain.tld/ftplogin/
Danach klicke auf Tools -> WebFTP und logge dich im WebFTP ein (die gleichen Daten wie fürs Confixx).
Der Upload sollte dann funktionieren.

Oder du änderst die datei confixx_mhost.conf wie folgt ab:
Alle
php_admin_value open_basedir /srv/www/htdocs/confixx
in
php_admin_value open_basedir none

Gruss Salvi :cool:
 
Last edited by a moderator:
Back
Top