Hướng dẫn Fix lỗi Pure-FTP trên Vpssim

Vpssim mặc định cài Pure-FTP làm FTP server cài đặt từ repos, tuy nhiên trên một số dạng ảo hóa như LXC VPS thì pure-ftp bị lỗi capabilities và kết quả lỗi trả về là : Permission Denied.

Giải pháp fix lỗi Pure-FTP trên Vpssim là biên dịch lại Pure-FTP từ source.

Thực hiện như sau:

#!/bin/bash
# buoc 1, bien dich tu ma nguon voi tham so -without-capabilities
yum -y groupinstall 'Development Tools'
yum install MariaDB-devel -y

cd /usr/local/src
#wget https://download.pureftpd.org/pub/pure-ftpd/releases/obsolete/pure-ftpd-1.0.30.tar.bz2
wget http://files.jdc.vn/fix-pureftpd-lxc/pure-ftpd-1.0.30.tar.bz2
tar xvjpf pure-ftpd-1*.tar.bz2
cd pure-ftpd-1*
# tao cau hinh bien dich
./configure --prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --datadir=/usr/share --sysconfdir=/etc --sharedstatedir=/usr/com --localstatedir=/var --libdir=/usr/lib64 --includedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --with-mariadb --with-virtualchroot --with-everything -without-capabilities

make
make install
### upload file nano /etc/init.d/pure-ftpd
####

wget -O /etc/init.d/pure-ftpd http://files.jdc.vn/fix-pureftpd-lxc/pure-ftpd
chmod +x /etc/init.d/pure-ftpd
mkdir /etc/pure-ftpd/

rm -rf /etc/pure-ftpd/pure-ftpd.conf
wget -O /etc/pure-ftpd/pure-ftpd.conf http://files.jdc.vn/fix-pureftpd-lxc/pure-ftpd.conf

rm -rf /usr/sbin/pure-config.pl
wget -O /usr/sbin/pure-config.pl http://files.jdc.vn/fix-pureftpd-lxc/pure-config.pl

chmod 744 /etc/pure-ftpd/pure-ftpd.conf
chmod 755 /usr/sbin/pure-config.pl

chkconfig --levels 235 pure-ftpd on
service pure-ftpd start

### SSL over TLS
### upload file /etc/pure-ftpd/pure-ftpd.conf

mkdir -p /etc/ssl/private/

openssl req \-new \-newkey rsa:2048 \-days 7300 \-nodes \-x509 \-subj "/C=VN/ST=VN/L=HN/O=HN/CN=user.jdc.vn" \-keyout /etc/ssl/private/pure-ftpd.pem \-out /etc/ssl/private/pure-ftpd.pem

# tao link de pure-ftpd hieu passsword do vpssim tao ra
ln -s /etc/pureftpd.passwd /etc/pure-ftpd/pureftpd.passwd

Was this article helpful?

Related Articles

Leave A Comment?

This site uses Akismet to reduce spam. Learn how your comment data is processed.