WEB的HTTP服务(基本网站)定型后,开始设置FTP_Serv吧。
Serv-U 6.2 使用 MsSQL05 管理用户配置数据
WEB的HTTP服务(基本网站)定型后,开始设置FTP_Serv吧。
Serv-U 6.2 使用 MsSQL05 管理用户配置数据
1. 安装数据库(在MsSQL05下)。
1-1. 新建数据库:FTP_Serv-U
1-2. 对数据库新建:数据库引擎查询(2newbie:相当于建表)
(05生成Sql语句相比00只能说是长一点~_~!):
![](/Images/OutliningIndicators/ContractedBlock.gif)
![](/Images/OutliningIndicators/ExpandedBlockStart.gif)
1
SET ANSI_NULLS ON
2
GO
3
SET QUOTED_IDENTIFIER ON
4
GO
5
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[groupdiraccess]') AND type in (N'U'))
6
BEGIN
7
CREATE TABLE [dbo].[groupdiraccess](
8
[id] [int] IDENTITY(1,1) NOT NULL,
9
[Access] [nvarchar](255) NULL DEFAULT (''),
10
[Index] [int] NULL DEFAULT ((0)),
11
[Name] [nvarchar](50) NULL DEFAULT (''),
12
PRIMARY KEY CLUSTERED
13
(
14
[id] ASC
15
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
16
) ON [PRIMARY]
17
END
18
GO
19
SET ANSI_NULLS ON
20
GO
21
SET QUOTED_IDENTIFIER ON
22
GO
23
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[groupipaccess]') AND type in (N'U'))
24
BEGIN
25
CREATE TABLE [dbo].[groupipaccess](
26
[id] [int] IDENTITY(1,1) NOT NULL,
27
[Access] [nvarchar](255) NULL DEFAULT (''),
28
[Index] [int] NULL DEFAULT ((0)),
29
[Name] [nvarchar](50) NULL DEFAULT (''),
30
PRIMARY KEY CLUSTERED
31
(
32
[id] ASC
33
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
34
) ON [PRIMARY]
35
END
36
GO
37
SET ANSI_NULLS ON
38
GO
39
SET QUOTED_IDENTIFIER ON
40
GO
41
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[useraccounts]') AND type in (N'U'))
42
BEGIN
43
CREATE TABLE [dbo].[useraccounts](
44
[id] [int] IDENTITY(1,1) NOT NULL,
45
[Access] [nvarchar](255) NULL CONSTRAINT [DF__useraccou__Acces__0BC6C43E] DEFAULT (''),
46
[AlwaysLogin] [int] NULL CONSTRAINT [DF__useraccou__Alway__0CBAE877] DEFAULT ((0)),
47
[ChangePass] [int] NULL CONSTRAINT [DF__useraccou__Chang__0DAF0CB0] DEFAULT ((0)),
48
[Disable] [int] NULL CONSTRAINT [DF__useraccou__Disab__0EA330E9] DEFAULT ((0)),
49
[Expirationtype] [int] NULL CONSTRAINT [DF__useraccou__Expir__0F975522] DEFAULT ((0)),
50
[Expiration] [datetime] NULL CONSTRAINT [DF__useraccou__Expir__108B795B] DEFAULT ('1980-1-1'),
51
[Groups] [nvarchar](50) NULL CONSTRAINT [DF__useraccou__Group__117F9D94] DEFAULT (''),
52
[HideHidden] [int] NULL CONSTRAINT [DF__useraccou__HideH__1273C1CD] DEFAULT ((0)),
53
[HomeDir] [nvarchar](100) NULL CONSTRAINT [DF__useraccou__HomeD__1367E606] DEFAULT (''),
54
[idleTimeOut] [int] NULL CONSTRAINT [DF__useraccou__idleT__145C0A3F] DEFAULT ((0)),
55
[LogMesfile] [nvarchar](100) NULL CONSTRAINT [DF__useraccou__LogMe__15502E78] DEFAULT (''),
56
[MaxIp] [int] NULL CONSTRAINT [DF__useraccou__MaxIp__164452B1] DEFAULT ((-1)),
57
[MaxSpeedDown] [decimal](18, 0) NULL CONSTRAINT [DF__useraccou__MaxSp__173876EA] DEFAULT ((0)),
58
[MaxSpeedUp] [decimal](18, 0) NULL CONSTRAINT [DF__useraccou__MaxSp__182C9B23] DEFAULT ((0)),
59
[MaxUsers] [int] NULL CONSTRAINT [DF__useraccou__MaxUs__1920BF5C] DEFAULT ((-1)),
60
[Name] [nvarchar](50) NULL CONSTRAINT [DF__useraccoun__Name__1A14E395] DEFAULT (''),
61
[Needsecure] [int] NULL CONSTRAINT [DF__useraccou__Needs__1B0907CE] DEFAULT ((0)),
62
[Notes] [nvarchar](255) NULL CONSTRAINT [DF__useraccou__Notes__1BFD2C07] DEFAULT (''),
63
[PassType] [int] NULL CONSTRAINT [DF__useraccou__PassT__1CF15040] DEFAULT ((0)),
64
[Password] [nvarchar](50) NULL CONSTRAINT [DF__useraccou__Passw__1DE57479] DEFAULT (''),
65
[Privilege] [int] NULL CONSTRAINT [DF__useraccou__Privi__1ED998B2] DEFAULT ((0)),
66
[QuotaCurrent] [decimal](18, 0) NULL CONSTRAINT [DF__useraccou__Quota__1FCDBCEB] DEFAULT ((0)),
67
[QuotaEnable] [int] NULL CONSTRAINT [DF__useraccou__Quota__20C1E124] DEFAULT ((0)),
68
[QuotaMax] [decimal](18, 0) NULL CONSTRAINT [DF__useraccou__Quota__21B6055D] DEFAULT ((0)),
69
[RatioCredit] [decimal](18, 0) NULL CONSTRAINT [DF__useraccou__Ratio__22AA2996] DEFAULT ((0)),
70
[RatioDown] [int] NULL CONSTRAINT [DF__useraccou__Ratio__239E4DCF] DEFAULT ((0)),
71
[RatioType] [int] NULL CONSTRAINT [DF__useraccou__Ratio__24927208] DEFAULT ((0)),
72
[RatioUP] [int] NULL CONSTRAINT [DF__useraccou__Ratio__25869641] DEFAULT ((0)),
73
[RelPaths] [int] NULL CONSTRAINT [DF__useraccou__RelPa__267ABA7A] DEFAULT ((0)),
74
[SessionTimeOut] [int] NULL CONSTRAINT [DF__useraccou__Sessi__276EDEB3] DEFAULT ((0)),
75
[SkeyValues] [nvarchar](50) NULL CONSTRAINT [DF__useraccou__SkeyV__286302EC] DEFAULT (''),
76
[PassLastChange] [datetime] NULL,
77
CONSTRAINT [PK__useraccounts__0AD2A005] PRIMARY KEY CLUSTERED
78
(
79
[id] ASC
80
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
81
) ON [PRIMARY]
82
END
83
GO
84
SET ANSI_NULLS ON
85
GO
86
SET QUOTED_IDENTIFIER ON
87
GO
88
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[userdiraccess]') AND type in (N'U'))
89
BEGIN
90
CREATE TABLE [dbo].[userdiraccess](
91
[id] [int] IDENTITY(1,1) NOT NULL,
92
[Access] [nvarchar](255) NULL DEFAULT (''),
93
[Index] [int] NULL DEFAULT ((0)),
94
[Name] [nvarchar](50) NULL DEFAULT (''),
95
PRIMARY KEY CLUSTERED
96
(
97
[id] ASC
98
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
99
) ON [PRIMARY]
100
END
101
GO
102
SET ANSI_NULLS ON
103
GO
104
SET QUOTED_IDENTIFIER ON
105
GO
106
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[useripaccess]') AND type in (N'U'))
107
BEGIN
108
CREATE TABLE [dbo].[useripaccess](
109
[id] [int] IDENTITY(1,1) NOT NULL,
110
[Access] [nvarchar](255) NULL DEFAULT (''),
111
[Index] [int] NULL DEFAULT ((0)),
112
[Name] [nvarchar](50) NULL DEFAULT (''),
113
PRIMARY KEY CLUSTERED
114
(
115
[id] ASC
116
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
117
) ON [PRIMARY]
118
END
119
GO
120
SET ANSI_NULLS ON
121
GO
122
SET QUOTED_IDENTIFIER ON
123
GO
124
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[groupaccounts]') AND type in (N'U'))
125
BEGIN
126
CREATE TABLE [dbo].[groupaccounts](
127
[id] [int] IDENTITY(1,1) NOT NULL,
128
[Index] [int] NULL DEFAULT ((0)),
129
[Name] [nvarchar](50) NULL DEFAULT (''),
130
[Notes] [nvarchar](255) NULL DEFAULT (''),
131
PRIMARY KEY CLUSTERED
132
(
133
[id] ASC
134
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
135
) ON [PRIMARY]
136
END
137![](/Images/OutliningIndicators/None.gif)
执行!
1-2. 新增对数据库FTP_Serv-U所有权用户:FTP_Serv-U,密码:FTP_Serv-U(不要学)
2. 配置系统ODBC:
在控制面板-管理工具-ODBC数据源管理器中增加对FTP_Serv-U(SQL)的连接
注意:必须在系统DSN内添加!
![](/images/cnblogs_com/benl/48463/o_一步一步建网-4-Serv-U-1-使用MsSQL05管理用户数据-图1.JPG)
3. 设置Serv-U
3-1. 新建域(2newbie:建立一个FTP实例),其中域类型选择存储于ODBC数据库中
3-2. 添加ServUDaemon.ini(Serv-U 安装目录下)中的ODBC信息:
(2newbie:相当于在Serv-U管理员-域-新建域->ODBC多选框下编辑)
ODBCSource=FTP_Serv-U|FTP_Serv-U|6214736B600E49551D39
ODBCTables=useraccounts|groupaccounts|userdiraccess|groupdiraccess|useripaccess|groupipaccess
ODBCColumns=Name|Password|SkeyValues|HomeDir|LogMesfile|Access|Disable|Needsecure|RelPaths|HideHidden
|AlwaysLogin|ChangePass|QuotaEnable|MaxIp|MaxSpeedUp|MaxSpeedDown|MaxUsers|idleTimeOut|SessionTimeOut
|RatioUP|RatioDown|RatioCredit|QuotaCurrent|QuotaMax|Expiration|Privilege|PassType|RatioType|Groups
|Notes|Index|ExpirationType|PassLastChange |
注意:这里ODBCColumns顺序与Serv-U里设置顺序不一样,且ini文件中数据不能带空格或其它字符。
4. 此后可按三种方式设置Serv-U用户数据:
4-1. Serv-U管理员,正常方式。
4-2. 直接修改SQL数据库,改数据表。
4-3. 自己写个程序修改SQL数据库吧。Asp/aspx/php/.net/……
5. 简单的WEB运用:
设想:为网站注册用户自动增加FTP帐户,且按照级别设置不同配置:访问权限/空间/上载/下载速率……
注意这个:
Column name of password type
This field is used in the user accounts table and it is optional. It is a (small) integer field with the following values:
0 = regular password
1 = S/KEY one-time-password using MD4
2 = S/KEY one-time-password using MD5
Serv-U Help - Copyright ?1995-2003 Cat-Soft, All Rights Reserved |
写程序去……