Pure-FTPd虚拟用户的配置及基于MySQL的虚拟用户配置详解

一、安装及配置
推荐下载
    wget http://fossies.org/unix/misc/pure-ftpd-1.0.34.tar.gz
下载phpweb管理组件
    wget http://www.yiyou.org/docs/PureAdmin_03_php/PureAdmin-0.3.tar.gz 
mysql.conf
解压编译及安装&常见问题排错
    tar zxvf pure-ftpd-1.0.34.tar.gz
    cd pure-ftpd-1.0.34/ 
    ./configure --prefix=/usr/local/pureftpd --with-cookie --with-language=simplified-chinese --with-puredb --with-mysql --with-tls --with-virtualchroot

…………………………………………………………………………………………………
checking for mysql_init in -lmysqlclient... no
configure: error: libmysqlclient is needed for MySQL support
编译时候若出现上面的提示,则安装mysql和mysql-devel RPM包,这里为了简便,直接使用rpm方式解决
[root@server1 pure-ftpd-1.0.29]# yum -y install mysql mysql-devel
若编译方式安装mysql数据库,前面的编译选项可以改成"--with-mysql=/usr/local/mysql",并将/usr/local/mysql目录下的头文件和开发库文件加入ld.so.conf,该文件维护着系统的动态链接库
# echo "/usr/local/mysql/" >> /etc/ld.so.conf
# ldconfig
……………………………………………………………………………………………………

安装配置

    make && make install 
    cp configuration-file/pure-config.pl /usr/local/pureftpd/sbin/ 
    chmod 755 /usr/local/pureftpd/sbin/pure-config.pl 
    mkdir -p /usr/local/pureftpd/etc/ 
    cp configuration-file/pure-ftpd.conf /usr/local/pureftpd/etc/ 
    cp contrib/RedHat.init /etc/init.d/pureftpd

3、修改启动配置文件
    vi /etc/init.d/pureftpd
修改18/19行
        fullpath=/usr/local/sbin/$prog
        pureftpwho=/usr/local/sbin/pure-ftpwho
  为:
        fullpath=/usr/local/pureftpd/sbin/$prog
        pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho
修改24行
        $fullpath /etc/pure-ftpd.conf --daemonize
   为   $fullpath /usr/local/pureftpd/etc/pure-ftpd.conf --daemonize
  
或者用下面命令更改
    sed -i '18c\fullpath=/usr/local/pureftpd/sbin/$prog' /etc/init.d/pureftpd 
    sed -i '19c\pureftpwho=/usr/local/pureftpd/sbin/pure-ftpwho' /etc/init.d/pureftpd 
    sed -i '24c\$fullpath /usr/local/pureftpd/etc/pure-ftpd.conf --daemonize' /etc/init.d/pureftpd

    chmod 755 /etc/init.d/pureftpd 
    chkconfig --add pureftpd 
    chkconfig pureftpd on

相关推荐