Linux FTP 备份服务器部署文档
时间:2014-07-20 19:45 来源:linux.it.net.cn 作者:it
客户需求部署
4台网站服务器 1台备份服务器
需求 : 集中备份 每天/每周/每月的网站数据至独立的备份服务器
网站服务器 均采用cPanel 支持周期备份
完成后测试了一下 速度还可以 100M端口跑满

部署安装
# 编译安装ProFTPD
#设置开机启动
chkconfig proftpd on
#启动
service proftpd start
#添加备份的用户组和用户
groupadd cdnway
useradd -d /backup -g cdnway -s /sbin/nologin cdnway
#生成随机密码
cat /dev/urandom|tr -dc “a-zA-Z0-9-_\$\?”|fold -w 8|head
#挑选一个作为备份FTP账户的密码
passwd cdnway
#修改权限 否则可能FTP无法上传下载数据
#解决权限问题
chown cdnway:cdnway -R /backup
chmod 755 -R /backup
PROFTPD.CONF 配置文件代码
/usr/local/proftpd/etc/proftpd.conf
proftpd 启动脚本
/etc/init.d/proftpd
# 权限需755 否则无法执行
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
#!/bin/sh
# $Id: proftpd.init,v 1.1 2004/02/26 17:54:30 thias Exp $
#
# proftpd This shell script takes care of starting and stopping
# proftpd.
#
# chkconfig: - 80 30
# description: ProFTPD is an enhanced FTP server with a focus towards \
# simplicity, security, and ease of configuration. \
# It features a very Apache-like configuration syntax, \
# and a highly customizable server infrastructure, \
# including support for multiple 'virtual' FTP servers, \
# anonymous FTP, and permission-based directory visibility.
# processname: proftpd
# config: /etc/proftp.conf
# pidfile: /var/run/proftpd.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x /usr/local/proftpd/sbin/proftpd ] || exit 0
RETVAL=0
prog="proftpd"
start() {
echo -n $"Starting $prog: "
daemon proftpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/proftpd
}
stop() {
echo -n $"Shutting down $prog: "
killproc proftpd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/proftpd
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
status proftpd
RETVAL=$?
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/proftpd ]; then
stop
start
fi
;;
reload)
echo -n $"Re-reading $prog configuration: "
killproc proftpd -HUP
RETVAL=$?
echo
;;
*)
echo "Usage: $prog {start|stop|restart|reload|condrestart|status}"
exit 1
esac
exit $RETVAL
(责任编辑:IT)
客户需求部署 需求 : 集中备份 每天/每周/每月的网站数据至独立的备份服务器 网站服务器 均采用cPanel 支持周期备份
完成后测试了一下 速度还可以 100M端口跑满
部署安装
#设置开机启动
#添加备份的用户组和用户
#修改权限 否则可能FTP无法上传下载数据
PROFTPD.CONF 配置文件代码
proftpd 启动脚本
(责任编辑:IT) |