PDA

View Full Version : setting up ftp access for clients


Jrdgames
23rd February 2006, 03:28
im having trouble setting up ftp access , I can login to webftp via ispconfig but i cant login to ftp with smartftp or internet explorer, I know Im typing the password right because I dont get a password error I just get a message saying "The target machine refused the connection" also I can't see anything at my address: runecore.no-ip.org when I manually put it into the folder /var/www/runecore.no-ip.org/web

Here is the content of my vhosts_ispconfig.conf file
###################################
#
# ISPConfig vHost Configuration File
# Version 1.0
#
###################################
#
NameVirtualHost 192.168.1.103:80
<VirtualHost 192.168.1.103:80>
ServerName localhost
ServerAdmin root@localhost
DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: runecore.no-ip.org:80
######################################
#
#
<VirtualHost 192.168.1.103:80>
ServerName runecore.no-ip.org:80
ServerAdmin webmaster@no-ip.org
DocumentRoot /var/www/web1/web
ServerAlias runecore.no-ip.org
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ScriptAlias /cgi-bin/ /var/www/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web1/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode On
php_admin_value open_basedir /var/www/web1/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web1/phptmp/
php_admin_value session.save_path /var/www/web1/phptmp/
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/web1/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/error_403.html
ErrorDocument 404 /error/error_404.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
</VirtualHost>
#
#
#

also my site address is at no-ip.com since i cant yet afford a domain also my isp blocks port 80 so at no-ip i have it redirected to port 82 and ports 82-80,21-21,25-25,53-53,110-110,81-81 directed by my router to my server

falko
23rd February 2006, 07:34
im having trouble setting up ftp access , I can login to webftp via ispconfig but i cant login to ftp with smartftp or internet explorer, I know Im typing the password right because I dont get a password error I just get a message saying "The target machine refused the connection"
Please post the output of netstat -tap and iptables -L

also I can't see anything at my address: runecore.no-ip.org when I manually put it into the folder /var/www/runecore.no-ip.org/web

Here is the content of my vhosts_ispconfig.conf file
###################################
#
# ISPConfig vHost Configuration File
# Version 1.0
#
###################################
#
NameVirtualHost 192.168.1.103:80
<VirtualHost 192.168.1.103:80>
ServerName localhost
ServerAdmin root@localhost
DocumentRoot /var/www/sharedip
</VirtualHost>
#
#
######################################
# Vhost: runecore.no-ip.org:80
######################################
#
#
<VirtualHost 192.168.1.103:80>
ServerName runecore.no-ip.org:80
ServerAdmin webmaster@no-ip.org
DocumentRoot /var/www/web1/web
ServerAlias runecore.no-ip.org
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ScriptAlias /cgi-bin/ /var/www/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl
ErrorLog /var/www/web1/log/error.log
AddType application/x-httpd-php .php .php3 .php4 .php5
<Files *.php>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php3>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php4>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
<Files *.php5>
SetOutputFilter PHP
SetInputFilter PHP
</Files>
php_admin_flag safe_mode On
php_admin_value open_basedir /var/www/web1/
php_admin_value file_uploads 1
php_admin_value upload_tmp_dir /var/www/web1/phptmp/
php_admin_value session.save_path /var/www/web1/phptmp/
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Alias /error/ "/var/www/web1/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/error_403.html
ErrorDocument 404 /error/error_404.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web1/user/$1/web/$3
</VirtualHost>
#
#
#

also my site address is at no-ip.com since i cant yet afford a domain also my isp blocks port 80 so at no-ip i have it redirected to port 82 and ports 82-80,21-21,25-25,53-53,110-110,81-81 directed by my router to my server
If you want your site to listen on port 82, then you must replace 80 with 82 in Vhosts_ispconfig.conf and restart Apache. And you better change that in the function make_vhost() in /root/ispconfig/scripts/lib/config.inc.php, too, otherwise ISPConfig will always write 80 instead of 82 in Vhosts_ispconfig.conf.

Jrdgames
24th February 2006, 04:12
netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost.localdo:32771 *:* LISTEN 2 6357/hpiod
tcp 0 0 localhost.localdo:32772 *:* LISTEN 2 6360/python
tcp 0 0 *:3784 *:* LISTEN 2 6173/ventrilo_srv
tcp 0 0 localhost.localdo:mysql *:* LISTEN 1 8706/mysqld
tcp 0 0 *:81 *:* LISTEN 2 4095/ispconfig_htt
tcp 0 0 *:ftp *:* LISTEN 3 0137/proftpd: (acc
tcp 0 0 192.168.1.103:domain *:* LISTEN 2 1828/named
tcp 0 0 localhost.locald:domain *:* LISTEN 2 1828/named
tcp 0 0 localhost.localdoma:ipp *:* LISTEN 9 391/cupsd
tcp 0 0 *:smtp *:* LISTEN 3 0192/master
tcp 0 0 localhost.localdoma:953 *:* LISTEN 2 1828/named
tcp 0 0 localhost.localdo:38904 localhost.localdoma:ipp ESTABLISHED8 934/gnome-cups-ico
tcp 0 0 192.168.1.103:38429 perm244-231.ij.net:www ESTABLISHED8 990/firefox-bin
tcp 0 0 localhost.localdo:32771 localhost.localdo:59399 ESTABLISHED2 6357/hpiod
tcp 0 0 localhost.localdo:59399 localhost.localdo:32771 ESTABLISHED2 6360/python
tcp 0 0 192.168.1.103:43743 perm244-232.ij.net:www ESTABLISHED8 990/firefox-bin
tcp 0 0 localhost.localdoma:ipp localhost.localdo:38904 ESTABLISHED9 391/cupsd
tcp 0 0 192.168.1.103:34893 perm244-230.ij.net:www ESTABLISHED8 990/firefox-bin
tcp6 0 0 *:imaps *:* LISTEN 1 3349/couriertcpd
tcp6 0 0 *:pop3s *:* LISTEN 1 3241/couriertcpd
tcp6 0 0 *:pop3 *:* LISTEN 1 3170/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 1 3286/couriertcpd
tcp6 0 0 *:www *:* LISTEN 2 3393/apache2
tcp6 0 0 *:ssh *:* LISTEN 8 745/sshd
tcp6 0 0 ip6-localhost:953 *:* LISTEN 2 1828/named
tcp6 0 0 *:https *:* LISTEN 2 3393/apache2
iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


I cant find make_vhost() in /root/ispconfig/scripts/lib/config.inc.php

also how would i restart apache?

thankyou for your help

falko
24th February 2006, 09:29
netstat -tap
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost.localdo:32771 *:* LISTEN 2 6357/hpiod
tcp 0 0 localhost.localdo:32772 *:* LISTEN 2 6360/python
tcp 0 0 *:3784 *:* LISTEN 2 6173/ventrilo_srv
tcp 0 0 localhost.localdo:mysql *:* LISTEN 1 8706/mysqld
tcp 0 0 *:81 *:* LISTEN 2 4095/ispconfig_htt
tcp 0 0 *:ftp *:* LISTEN 3 0137/proftpd: (acc
tcp 0 0 192.168.1.103:domain *:* LISTEN 2 1828/named
tcp 0 0 localhost.locald:domain *:* LISTEN 2 1828/named
tcp 0 0 localhost.localdoma:ipp *:* LISTEN 9 391/cupsd
tcp 0 0 *:smtp *:* LISTEN 3 0192/master
tcp 0 0 localhost.localdoma:953 *:* LISTEN 2 1828/named
tcp 0 0 localhost.localdo:38904 localhost.localdoma:ipp ESTABLISHED8 934/gnome-cups-ico
tcp 0 0 192.168.1.103:38429 perm244-231.ij.net:www ESTABLISHED8 990/firefox-bin
tcp 0 0 localhost.localdo:32771 localhost.localdo:59399 ESTABLISHED2 6357/hpiod
tcp 0 0 localhost.localdo:59399 localhost.localdo:32771 ESTABLISHED2 6360/python
tcp 0 0 192.168.1.103:43743 perm244-232.ij.net:www ESTABLISHED8 990/firefox-bin
tcp 0 0 localhost.localdoma:ipp localhost.localdo:38904 ESTABLISHED9 391/cupsd
tcp 0 0 192.168.1.103:34893 perm244-230.ij.net:www ESTABLISHED8 990/firefox-bin
tcp6 0 0 *:imaps *:* LISTEN 1 3349/couriertcpd
tcp6 0 0 *:pop3s *:* LISTEN 1 3241/couriertcpd
tcp6 0 0 *:pop3 *:* LISTEN 1 3170/couriertcpd
tcp6 0 0 *:imap2 *:* LISTEN 1 3286/couriertcpd
tcp6 0 0 *:www *:* LISTEN 2 3393/apache2
tcp6 0 0 *:ssh *:* LISTEN 8 745/sshd
tcp6 0 0 ip6-localhost:953 *:* LISTEN 2 1828/named
tcp6 0 0 *:https *:* LISTEN 2 3393/apache2
iptables -L


This looks ok...
I cant find make_vhost() in /root/ispconfig/scripts/lib/config.inc.phpSorry, I meant /root/ispconfig/scripts/lib/config.lib.php.

also how would i restart apache?

Depends on your distribution. On most systems it's either /etc/init.d/apache restart or /etc/init.d/apache2 restart or /etc/init.d/httpd restart
You can also use ISPConfig to restart Apache.

Jrdgames
25th February 2006, 18:45
is this the line?

function make_vhost($server_id) {
global $mod,$go_info;

where do i insert the port i want it to listen on?


for the restart it was:

/etc/init.d/apache2 restart

im running on ubuntu

till
26th February 2006, 10:04
is this the line?

function make_vhost($server_id) {
global $mod,$go_info;

where do i insert the port i want it to listen on?

A few line below you will find these lienes:

if($apache_version == 2){
$fp_resource_config = "";
$fp_access_config = "";
$web_port = ":80";
$ssl_port = ":443";
}


Just replace the number 80 with your port number.

Jrdgames
27th February 2006, 02:01
ok thankyou it was:
$apache_version = $this->apache_version();
if($apache_version == 1){
$fp_resource_config = "ResourceConfig /dev/null";
$fp_access_config = "AccessConfig /dev/null";
$web_port = "";
$ssl_port = "";
}
now it is:
$apache_version = $this->apache_version();
if($apache_version == 1){
$fp_resource_config = "ResourceConfig /dev/null";
$fp_access_config = "AccessConfig /dev/null";
$web_port = "82";
$ssl_port = "";
}
it looks like the ssl port should be set to something

falko
27th February 2006, 09:42
it looks like the ssl port should be set to something
If it isn't set, then the default value (443) is used.

Jrdgames
27th February 2006, 15:39
If it isn't set, then the default value (443) is used.
ok

the ftp is working now but im still getting ispconfig's shared ip page, in the site setup i have hostname as runecore and domain as no-ip.org since im going through the redirect so my servers ip cant easily be seen and because its easier to remember.

maybe i should setup another ip address for the site?

till
27th February 2006, 20:33
ok

the ftp is working now but im still getting ispconfig's shared ip page, in the site setup i have hostname as runecore and domain as no-ip.org since im going through the redirect so my servers ip cant easily be seen and because its easier to remember.

maybe i should setup another ip address for the site?

Did you use the internal IP in ISPConfig for the website, the IP where you forwarded your ports to?

Jrdgames
28th February 2006, 04:33
yes, my server only has one ip right now, i just double checked and the ip the ports are being redirected to is the same as when i do ifconfig on my server

falko
28th February 2006, 09:52
Can you check with dig runecore.no-ip.org that it actually points to the right IP address (your router's public one)? Maybe it doesn't get updated when your public IP address changes.

Jrdgames
1st March 2006, 03:12
ok here it is
; <<>> DiG 9.3.1 <<>> runecore.no-ip.org
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62033
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 3, ADDITIONAL: 3

;; QUESTION SECTION:
;runecore.no-ip.org. IN A

;; ANSWER SECTION:
runecore.no-ip.org. 60 IN A 204.16.252.98

;; AUTHORITY SECTION:
no-ip.org. 86400 IN NS nf1.no-ip.com.
no-ip.org. 86400 IN NS nf2.no-ip.com.
no-ip.org. 86400 IN NS nf3.no-ip.com.

;; ADDITIONAL SECTION:
nf1.no-ip.com. 86400 IN A 204.16.252.8
nf2.no-ip.com. 86400 IN A 216.66.37.12
nf3.no-ip.com. 86400 IN A 70.86.196.66

;; Query time: 257 msec
;; SERVER: 207.22.166.2#53(207.22.166.2)
;; WHEN: Tue Feb 28 21:02:08 2006
;; MSG SIZE rcvd: 163

when i go to ipchicken.com (www.ipchicken.com) it says my router is 209.216.71.252 but i dont see that ip anywhere on the output

falko
1st March 2006, 09:51
This means runecore.no-ip.org's IP address doesn't get updated when your router's IP address changes. That's why you can't see your site.

Jrdgames
1st March 2006, 19:07
but my router has a static ip and when i check runecore.no-ip.org in my no-ip control panel it says it goes to what my routers ip is, also would i be able to see the ispconfig sharedip page if it was wrong? even though it seems to be wrong

falko
1st March 2006, 22:05
but my router has a static ip and when i check runecore.no-ip.org in my no-ip control panel it says it goes to what my routers ip is, also would i be able to see the ispconfig sharedip page if it was wrong? even though it seems to be wrong
Ok, I see the Shared-IP page now, too. But at the bottom you see a message about some kind of redirecting from No-IP.com. I think what happens is this: When you type runecore.no-ip.org in your browser, it goes to a No-IP.com server; from there it loads the frameset with the redirect message at the bottom. And in the main frame it loads your web page - it seems as if it tries to load your web page using your public IP address instead of a FQDN (your FQDN runecore.no-ip.org is pointing to a NO-IP.com server).
You should contact NO-IP.com and ask if they have a solution for it; otherwise use another service like DynDNS.org where you can point your FQDN directly to your IP address instead of using redirects.

Jrdgames
2nd March 2006, 02:32
ok ive taken your advice and asked the staff at no-ip about it and ive also setup an account with dyndns and setup a second site on my server with hostname: runecore and domain: webhop.net my redirect on dyndns goes to http://209.216.71.252:82 I dont think its working right either unless im doing something wrong

falko
2nd March 2006, 10:12
Why do you use redirects? Point your domains directly to your public IP address!

Jrdgames
2nd March 2006, 15:36
I cant afford a real domain, but im going to try freedomain.co.nr and see if there service will work the way i need

falko
2nd March 2006, 16:22
At DynDNS.org you can point your domain to your public IP address instead of using redirects. I guess something like that is possible at No-IP.com, too.

Jrdgames
3rd March 2006, 14:53
At DynDNS.org you can point your domain to your public IP address instead of using redirects. I guess something like that is possible at No-IP.com, too.
I am pointing them to my public ip, would you mind taking a look at this screenshot to see if it looks right?
http://imgkit.com/jrdgames/thumbs/th_Screenshot4408496a3acf5.png (http://imgkit.com/jrdgames/Screenshot4408496a3acf5.png)

falko
3rd March 2006, 17:27
I am pointing them to my public ip, would you mind taking a look at this screenshot to see if it looks right?
http://imgkit.com/jrdgames/thumbs/th_Screenshot4408496a3acf5.png (http://imgkit.com/jrdgames/Screenshot4408496a3acf5.png)
No, it's redirect. Can you click on My Hosts -> Dynamic DNS and create a DNS record pointing to your server.

Jrdgames
4th March 2006, 06:48
thankyou very much!!
heres an image of the dns:
http://imgkit.com/jrdgames/thumbs/th_working.png (http://imgkit.com/jrdgames/working.png)
I didnt know that someone would offer dns service for free but it is working now thank you, my website is now accessible @ runecore.selfip.com:82 as long as the :82 is on the end.
Now I should be able to point a redirect to this address so that the port doesnt have to be remembered everytime right?

falko
4th March 2006, 11:54
Now I should be able to point a redirect to this address so that the port doesnt have to be remembered everytime right?
Yes, you can do it like that.

Jrdgames
5th March 2006, 09:04
hmm, my friends cant seem to view my site they get a timeout error but i am able to see it, can you see it?

falko
5th March 2006, 13:11
I can access http://runecore.webhop.net/ without problems.

Jrdgames
5th March 2006, 18:55
then it must be an error on there end and not with my server

till
5th March 2006, 18:58
then it must be an error on there end and not with my server

Yes, seems so. I can access it too and i have an other network provider then falko :)

Jrdgames
6th March 2006, 00:44
nice to know its not something wrong with my server, thanks for all your help guys

geek.de.nz
26th March 2006, 09:35
I cannot get FTP access for clients working. It works in webftp, but not over gftp for example. User name and password don't match apparently. Do I set this for the client or the site? I didn't find the option for user data under site???

To be honest, I found it almost easier to do it by command line, as I did already for a few people. Oh maybe it could be because I used http://www.howtoforge.com/proftpd_mysql_virtual_hosting before I installed ispconfig.

Maybe this information helps:
my /etc/proftpd.conf:

ServerName "myServer"
ServerType standalone
DeferWelcome off

MultilineRFC2228 on
DefaultServer on
ShowSymlinks on

TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200

DisplayLogin welcome.msg
DisplayFirstChdir .message
ListOptions "-l"

DenyFilter \*.*/

Port 21

MaxInstances 30

User nobody
Group nogroup

Umask 022 022

AllowOverwrite
DefaultRoot ~


SQLAuthTypes Plaintext Crypt
SQLAuthenticate users* groups*


# used to connect to the database
# databasename@host database_user user_password
SQLConnectInfo ftp@localhost proftpd xxxxx


# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
SQLUserInfo ftpuser userid passwd uid gid homedir shell

# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
SQLGroupInfo ftpgroup groupname gid members

# set min UID and GID - otherwise these are 999 each
SQLMinID 500

# create a user's home directory on demand if it doesn't exist
SQLHomedirOnDemand on

# Update count every time user logs in
SQLLog PASS updatecount
SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser

# Update modified everytime user uploads or deletes a file
SQLLog STOR,DELE modified
SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

# User quotas
# ===========
QuotaEngine on
QuotaDirectoryTally on
QuotaDisplayUnits Mb
QuotaShowQuotas on

SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"

SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"

SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatallies

SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" ftpquotatallies

QuotaLimitTable sql:/get-quota-limit
QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally

RootLogin off
RequireValidShell off


Include /etc/proftpd_ispconfig.conf

my /etc/proftpd_ispconfig.conf:

###################################
#
# ISPConfig proftpd Configuration File
# Version 1.0
#
###################################
<VirtualHost 85.25.66.254>
DefaultRoot ~
AllowOverwrite on
Umask 002
<Anonymous /home/www/web4/ftp>
User web4_anonftp
Group web4_anonftp
UserAlias anonymous web4_anonftp
UserAlias guest web4_anonftp
MaxClients 10
<Directory *>
<Limit WRITE>
DenyAll
</Limit>
</Directory>
<Directory /home/www/web4/ftp/incoming>
Umask 002
<Limit STOR>
AllowAll
</Limit>
<Limit READ>
DenyAll
</Limit>
</Directory>
</Anonymous>
</VirtualHost>


Also, when I restart proftpd manually, I get the following:

#/etc/init.d/proftpd restart
Restarting ProFTPD ftp daemon.proftpd.
.. - warning: "ProFTPD" address/port (85.25.66.254:21) already in use by "myServer"
proftpd.
done.



The user should be web2, but this is not even in the file, so where is the information about this client? How come web4 is there?

The thing i like about ISPConfig though is the client management system and the easy email setup etc.

falko
26th March 2006, 10:42
To be honest, I found it almost easier to do it by command line, as I did already for a few people. Oh maybe it could be because I used http://www.howtoforge.com/proftpd_mysql_virtual_hosting before I installed ispconfig.

This setup is totally incompatible with ISPConfig! ISPConfig uses system users, not virtual users.

geek.de.nz
26th March 2006, 11:30
This setup is totally incompatible with ISPConfig! ISPConfig uses system users, not virtual users.

Well, OK, I decided to uninstall the proftpd-mysql package for this reason, but it still says, after I did:

#apt-get remove proftpd-mysql
...
#apt-get install proftpd
...
Starting ProFTPD ftp daemon: - warning: "ProFTPD" address/port (85.25.66.254:21) already in use by "myServer"
proftpd.


Should I just ignore that warning or will ISPConfig not work that way?

falko
26th March 2006, 11:44
You must reconfigure /etc/proftpd.conf and restart ProFTPd then.

geek.de.nz
26th March 2006, 11:53
I did that though.

My /etc/proftpd.conf

#
# /etc/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes reload proftpd after modifications.
#

#ServerName "Debian"
ServerName "iHostNZ"
ServerType standalone
#ServerType inetd
DeferWelcome off

MultilineRFC2228 on
DefaultServer on
ShowSymlinks on

TimeoutNoTransfer 600
TimeoutStalled 600
TimeoutIdle 1200

DisplayLogin welcome.msg
DisplayFirstChdir .message
ListOptions "-l"

DenyFilter \*.*/

# Uncomment this if you are using NIS or LDAP to retrieve passwords:
#PersistentPasswd off

# Uncomment this if you would use TLS module:
#TLSEngine on

# Uncomment this if you would use quota module:
#Quotas on

# Uncomment this if you would use ratio module:
#Ratios on

# Port 21 is the standard FTP port.
Port 21

# 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

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask 022 022
# Normally, we want files to be overwriteable.
AllowOverwrite on

# Delay engine reduces impact of the so-called Timing Attack described in
# http://security.lss.hr/index.php?page=details&ID=LSS-2004-10-02
# It is on by default.
#DelayEngine off

# A basic anonymous configuration, no upload directories.

# <Anonymous ~ftp>
# User ftp
# Group nogroup
# # We want clients to be able to login with "anonymous" as well as "ftp"
# UserAlias anonymous ftp
# # Cosmetic changes, all files belongs to ftp user
# DirFakeUser on ftp
# DirFakeGroup on ftp
#
# RequireValidShell off
#
# # Limit the maximum number of anonymous logins
# MaxClients 10
#
# # We want 'welcome.msg' displayed at login, and '.message' displayed
# # in each newly chdired directory.
# DisplayLogin welcome.msg
# DisplayFirstChdir .message
#
# # Limit WRITE everywhere in the anonymous chroot
# <Directory *>
# <Limit WRITE>
# DenyAll
# </Limit>
# </Directory>
#
# # Uncomment this if you're brave.
# # <Directory incoming>
# # # Umask 022 is a good standard umask to prevent new files and dirs
# # # (second parm) from being group and world writable.
# # Umask 022 022
# # <Limit READ WRITE>
# # DenyAll
# # </Limit>
# # <Limit STOR>
# # AllowAll
# # </Limit>
# # </Directory>
#
# </Anonymous>

#DefaultRoot ~


# The passwords in MySQL are encrypted using CRYPT
#SQLAuthTypes Plaintext Crypt
#SQLAuthenticate users* groups*


# used to connect to the database
# databasename@host database_user user_password
#SQLConnectInfo ftp@localhost proftpd pr0ftptim


# Here we tell ProFTPd the names of the database columns in the "usertable"
# we want it to interact with. Match the names with those in the db
#SQLUserInfo ftpuser userid passwd uid gid homedir shell

# Here we tell ProFTPd the names of the database columns in the "grouptable"
# we want it to interact with. Again the names match with those in the db
#SQLGroupInfo ftpgroup groupname gid members

# set min UID and GID - otherwise these are 999 each
#SQLMinID 500

# create a user's home directory on demand if it doesn't exist
#SQLHomedirOnDemand on

# Update count every time user logs in
#SQLLog PASS updatecount
#SQLNamedQuery updatecount UPDATE "count=count+1, accessed=now() WHERE userid='%u'" ftpuser

# Update modified everytime user uploads or deletes a file
#SQLLog STOR,DELE modified
#SQLNamedQuery modified UPDATE "modified=now() WHERE userid='%u'" ftpuser

# User quotas
# ===========
#QuotaEngine on
#QuotaDirectoryTally on
#QuotaDisplayUnits Mb
#QuotaShowQuotas on
#
#SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM ftpquotalimits WHERE name = '%{0}' AND quota_type = '%{1}'"
#
#SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM ftpquotatallies WHERE name = '%{0}' AND quota_type = '%{1}'"
#
#SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" ftpquotatallies
#
#SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, #%{4}, %{5}, %{6}, %{7}" ftpquotatallies
#
#QuotaLimitTable sql:/get-quota-limit
#QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally
#
#RootLogin off
#RequireValidShell off


Include /etc/proftpd_ispconfig.conf


So, I practically reversed all the steps as shown in http://www.howtoforge.com/proftpd_mysql_virtual_hosting_p2

Am I missing something. Can you see anything wrong with what I did? Thanks for the help so far btw. :)

till
26th March 2006, 15:43
Should I just ignore that warning or will ISPConfig not work that way?

Does FTP works now for you? Then ignore the error.

geek.de.nz
27th March 2006, 12:49
Thanks, it's working today. Wonder why it wasn't working yesterday. There was no reboot of the server. Does ISPConfig automatically restart the servers at some point or why would it all of a sudden work?

falko
27th March 2006, 13:50
Does ISPConfig automatically restart the servers at some point or why would it all of a sudden work?
Yes, if you have configured ISPConfig to do so under Monitoring.

geek.de.nz
30th March 2006, 14:25
Thanks again.

Another thing:
How do I now manually add an ftp user? I thought ISPConfig is based on system users. So, why can't I log in via ftp with the existing system users other than webx_xxx?

I found webx_xxx in the file /etc/gshadow and didn't find my other system users there. Is that the file to change?? I do not want to screw up my system by editing that file if I don't know for sure.

Also, if I log in with a user from ISPConfig (webx_xxx), I get no directory listing and cannot do anything in gftp, such as upload files. Might this have to do with the error message:

Restarting ProFTPD ftp daemon.proftpd.
.. - warning: "ProFTPD" address/port (ip:21) already in use by "iHostNZ"
proftpd.
done.

when I restart the ftp server?

geek.de.nz
30th March 2006, 15:01
Btw, here the ouput of gFTP:

Trying myserver.com:21
Connected to myserver.com:21
220 ProFTPD 1.2.10 Server (iHostNZ) [ip]
USER webx_xxx

331 Password required for webx_xxx.
PASS xxxx
230 User webx_xxx logged in.
SYST

215 UNIX Type: L8
TYPE I

200 Type set to I
PWD

257 "/home/www/webx" is current directory.
Loading directory listing /home/www/webx from server (LC_TIME=en_NZ.UTF-8)
PASV

227 Entering Passive Mode (...).


But then I do not see the contents of the webx directory, which should have some content though. I think it worked before though????

falko
30th March 2006, 15:09
Thanks again.

Another thing:
How do I now manually add an ftp user? I thought ISPConfig is based on system users. So, why can't I log in via ftp with the existing system users other than webx_xxx?
The existing users must have a valid shell like /bin/bash or /bin/false, otherwise they aren't allowed to use FTP.


Also, if I log in with a user from ISPConfig (webx_xxx), I get no directory listing and cannot do anything in gftp, such as upload files. Might this have to do with the error message:

Restarting ProFTPD ftp daemon.proftpd.
.. - warning: "ProFTPD" address/port (ip:21) already in use by "iHostNZ"
proftpd.
done.

when I restart the ftp server?
You should kill the running FTP process and try again.

geek.de.nz
31st March 2006, 07:37
OK, did that but had some problems with the ftp server. It wouldn't start, although '#/etc/init.d/proftpd start' gave positive feedback ('starting proftpd...').

Anyway, I sorted that one out with changing the configuration back.

Now the new problem:
When I have the firewall from ISPConfig running, my ftp server is "not really" reachable. So, this means, I can run gFTP on it, and it gives no negative feedback. It connects to the server fine, but I do not get a directory listing. The last line of the ftp log in procedure is:

PASV


So, I thought, maybe the firewall is blocking the passive ports of ftp, but how come it worked before with the same firewall and ftp server settings? Did I change something that I'm unaware of? Why could this be? What are the passive ports of ftp? Should I open them in the firewall?

till
31st March 2006, 09:07
The ISPConfig firewall has not changed since version 2.0.0

geek.de.nz
31st March 2006, 09:33
Sorry, I have to correct myself. I didn't test it before. I just remembered it wrong. So, it's not working with the firewall on. :(

falko
31st March 2006, 10:50
Did you try both active and passive mode in your FTP client? Is port 21 open in your firewall? You might also have to open port 20.