Ik ben nu inmiddels twee volle dagen bezig met het installeren en configureren van ProFTPd en MySQL 5 onder Ubuntu 6.06 Server. Hiervoor gebruikt ik o.a. de packages proftpd en proftpd-mysql op een automatisch LAMP-installatie van de serverversie van Ubuntu Dapper.
Ik heb even gelezen:
http://www.castaglia.org/...oFTPD-mini-HOWTO-SQL.html
En daarna heb ik grotendeels de tutorial op howtoforge gevolgd:
http://www.howtoforge.com/proftpd_mysql_virtual_hosting
Tot ik bij de volgende regel kwam:
Wat ik gedaan heb, stap voor stap:
Als ik ProFTPd met de oorspronkelijke config draai, dus zonder mod_sql te gebruiken, draait alles prima. Voeg ik de config uit de tutorial toe, dan gooit ProFTPd direct elke verbinding dicht zodra deze geopend wordt.
De logs zeggen niets, alleen 'session closed' als er geprobeerd wordt te connecten. Er zou een debug-mode moeten zijn, maar ik kan deze niet vinden, omdat ProFTPd hier via apt is geïnstalleerd.
Heeft er iemand een goed idee voor me, ik weet even niet wat ik fout doe.
proftpd.conf:
Database:
Ik heb even gelezen:
http://www.castaglia.org/...oFTPD-mini-HOWTO-SQL.html
En daarna heb ik grotendeels de tutorial op howtoforge gevolgd:
http://www.howtoforge.com/proftpd_mysql_virtual_hosting
Tot ik bij de volgende regel kwam:
Ik blij, en testen maar! Niet dus...If you are able to connect - congratulations!

Met die conclusie was ik het dan eens.If not, something went wrong.
Wat ik gedaan heb, stap voor stap:
- Verse installatie van Ubuntu 6.06 Server, met de optie: Install a LAMP server.
- MySQL root password instellen, PHPMyAdmin erop, inloggen daarop gaat goed.
- Group 'ftpgroup' en user 'ftpuser' aanmaken, op de manier die is beschreven in de tutorial:
groupadd -g 2001 ftpgroup useradd -u 2001 -s /bin/false -d /bin/null -c "proftpd user" -g ftpgroup ftpuser
- ProFTPd met MySQL-connector erop:
sudo apt-get install proftpd-mysql
- proftpd.conf aanpassen, configuratie uit de tutorial toegevoegd en de SQLConnectInfo daarin juist ingevuld. Ik weet hierbij zeker dat deze user i.c.m. met password toegang heeft tot de database.
- Database gevuld met de voorbeeldqueries uit de tutorial.
Als ik ProFTPd met de oorspronkelijke config draai, dus zonder mod_sql te gebruiken, draait alles prima. Voeg ik de config uit de tutorial toe, dan gooit ProFTPd direct elke verbinding dicht zodra deze geopend wordt.
De logs zeggen niets, alleen 'session closed' als er geprobeerd wordt te connecten. Er zou een debug-mode moeten zijn, maar ik kan deze niet vinden, omdat ProFTPd hier via apt is geïnstalleerd.
Heeft er iemand een goed idee voor me, ik weet even niet wat ik fout doe.
proftpd.conf:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
| # # /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file. # To really apply changes reload proftpd after modifications. # # Includes DSO modules Include /etc/proftpd/modules.conf ServerName "Debian" 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 is the standard FTP port. Port 21 # In some cases you have to specify passive ports range to by-pass # firewall limitations. Ephemeral ports can be used for that, but # feel free to use a more narrow range. # PassivePorts 49152 65534 # 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 proftpd 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 # Uncomment this if you are using NIS or LDAP to retrieve passwords: # PersistentPasswd off # Be warned: use of this directive impacts CPU average load! # # Uncomment this if you like to see progress and transfer rate with ftpwho # in downloads. That is not needed for uploads rates. # UseSendFile off TransferLog /var/log/proftpd/xferlog SystemLog /var/log/proftpd/proftpd.log ExtendedLog /var/log/proftpd/extended.log <IfModule mod_tls.c> TLSEngine off </IfModule> <IfModule mod_quota.c> QuotaEngine on </IfModule> <IfModule mod_ratio.c> Ratios on </IfModule> # 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. <IfModule mod_delay.c> DelayEngine on </IfModule> <IfModule mod_ctrls.c> ControlsEngine on ControlsMaxClients 2 ControlsLog /var/log/proftpd/controls.log ControlsInterval 5 ControlsSocket /var/run/proftpd/proftpd.sock </IfModule> <IfModule mod_ctrls_admin.c> AdminControlsEngine on </IfModule> ## HIERONDER MIJN TOEVOEGINGEN 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 hierstaatmijnpassword # 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 |
Database:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| Database: ftp Tabel: ftpgroup [groupname] [gid] [members] ftpgroup 2001 ftpuser Tabel: ftpquotalimits [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] exampleuser user true hard 15728640 0 0 0 0 0 Tabel: ftpquotatallies [name] [quota_type] [bytes_in_used] [bytes_out_used] [bytes_xfer_used] [files_in_used] [files_out_used] [files_xfer_used] Tabel: ftpusers [id] [userid] [passwd] [uid] [gid] [homedir] [shell] [count] [accessed] [modified] 1 exampleuser secret 2001 2001 /home/www.example.com /sbin/nologin 0 0000-00-00 00:00:00 0000-00-00 00:00 |
[ Voor 7% gewijzigd door ERIKvanPAASSEN op 19-05-2007 22:59 . Reden: Onnodig lange comments uit proftpd.conf gehaald ]