全力打造多功能FreeBSD服务器( 四 )


改为UserDir /home/ftp/*/
然后重启apache使改动生效,再启动proftpd用test帐号登陆,进行测试 。
# /usr/local/proftpd/sbin/proftpd –n &

注意:在FreeBSd4.7和5.0下运行Proftpd,这时可能会提示下面的错误
/usr/local/ftp/sbin/proftpd: error while loading shared libraries: libmysqlclient.so.10: cannot open shared object file:
No such file or directory
解决方案如下:
安装mysql时,将mysql库所在的目录添加进配置文件中,例如
echo "/usr/local/mysql/lib/mysql" >> /etc/ld.so.conf
然后执行ldconfig -v|grep libmysqlclient,再试试!

或者将/usr/local/mysql/lib/mysql/下的文件全部copy到/usr/lib中即可 。

如果test登陆成功的话,在test用户根目录里放置一个index.html文件
通过http://yourserver/~test/看能否访问 。

未完待续,希望起到抛砖引玉的作用,大家可以接着写啊,偶技术太烂了,已经好一阵子没玩过BSD了,555~~~~



我的proftpd.conf配置文件:

ServerName "白狐狸"s FTP Server"
ServerType standalone
DefaultServer on

# 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

#limit the user in his owner directory
DefaultRoot ~

#put the proftpd log files in /var/log/ftp.syslog
SystemLog /var/log/ftp.syslog

#TransferLog log files
TransferLog /var/log/ftp.transferlog

#set The maxtimes user Attempts times
MaxLoginAttempts 3

#setup the Restart
AllowRetrieveRestart on

#setup the download and upload speed
RateReadBPS 80000
RateWriteBPS 80000

#setup the disk quota
QuotaDirectoryTally on

#quota b"|"Kb"|"Mb"|"Gb"
#setup the disk quota
QuotaDirectoryTally on

#quota b"|"Kb"|"Mb"|"Gb"
QuotaDisplayUnits Kb
QuotaEngine on
QuotaLog /var/ftp/Quota.log
QuotaShowQuotas on


# We put our mod_sql directives in a block so they"ll be
# inherited by theblock below, and any other
# blocks we may want to add. For a simple server these don"t need to
# be in a block but it won"t hurt anything.


# Specify our connection information. Both mod_sql_mysql and
# mod_sql_postgres use the same format, other backends may specify a
# different format for the first argument to SQLConnectInfo. By not
# specifying a fourth argument, we"re defaulting to "PERSESSION"
# connections -- a connection is made to the database at the start of
# the session and closed at the end. This should be fine for most
# situations.

# SQLConnectInfo dbname@host:port username password
SQLConnectInfo ftp@localhost:3306 root 12345678

# Specify our authentication schemes. Assuming we"re using
# mod_sql_mysql, here we"re saying "first try to authenticate using
# mysql"s password scheme, then try to authenticate the user"s
# password as plaintext". Note that "Plaintext" isn"t a smart way to
# store passwords unless you"ve got your database well secured.
SQLAuthTypes Backend Plaintext

# Specify the table and fields for user information. If you"ve
# created the database as it specifies in "README.mod_sql", you don"t
# need to have this directive at all UNLESS you"ve elected not to
# create some fields. In this case we"re telling mod_sql to look in
# table "users" for the fields "username","password","uid", and
# "gid". The "homedir" and "shell" fields are specified as "NULL" --
# this will be explained below.

# SQLUserInfo users username password uid gid NULL NULL
SQLUserInfo ftpusers userid passwd uid gid home shell


# Here we tell mod_sql that every user it authenticates should have
# the same home directory. A much more common option would be to
# specify a homedir in the database and leave this directive out. Note

推荐阅读