serv-u ODBC设置 及 MSSQL数据库设置

1、运行MSSQL企业管理器,新加数据库ServU,新建SQL登录账号ServU,密码xxxx,指定为数据库的dbowner,指定默认数据库为ServU
2、在企业管理器中选中数据库ServU,进入顶部菜单 工具——查询分析器,将下面"建表SQL语句"后面的所有内容复制到查询分析器中运行
4、创建系统DSN,名称为ServU,指向SQL Server的数据库ServU
5、在Serv-U Administrator里面新建域Simple Domain,使用ODBC存储,在树形菜单中选中Simple Domain,点击右侧控制面板上部的'ODBC'
选项卡,在下面第1、2、3格中分别填入系统DSN的名字、使用的账号、密码,点应用。
6、停止Serv-U服务,到Serv-u安装目录下打开ServUDaemon.ini,将[Domain1]小节下的两行设置"ODBCTables" and "ODBCColumns",替换为
ODBCTables=ftp_users|ftp_groups|ftp_userAccess|ftp_groupAccess|ftp_userIPs|ftp_groupIPs
ODBCColumns=ftpUserName|ftpPassword|sKey|dirHome|loginMsgFile|accessRule|disabled|sessionEncryption|dirHomeLock|hideHidden|alwaysAllowLogin|changePassword|quotaEnable|maxUsersLoginPerIP|speedLimitUp|speedLimitDown|maxUsersConcurrent|timeOutIdle|timeOutSession|ratioUp|ratioDown|ratioCredit|quotaCurrent|quotaMax|expiration|privilege|ftpPasswordType|ratioType|groups|notes|indexNo
7、启动Serv-U服务,OK了
注意:上面所有的名称均可更改;[DomainXX]中的XX应为新建的域对应的数字
建表SQL语句

IF EXISTS (Select * FROM dbo.sysobjects Where id = object_id('dbo.ftp_groupAccess') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
Drop TABLE dbo.ftp_groupAccess
GO
IF EXISTS (Select * FROM dbo.sysobjects Where id = object_id('dbo.ftp_groupIPs') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
Drop TABLE dbo.ftp_groupIPs
GO
IF EXISTS (Select * FROM dbo.sysobjects Where id = object_id('dbo.ftp_groups') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
Drop TABLE dbo.ftp_groups
GO
IF EXISTS (Select * FROM dbo.sysobjects Where id = object_id('dbo.ftp_userAccess') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
Drop TABLE dbo.ftp_userAccess
GO
IF EXISTS (Select * FROM dbo.sysobjects Where id = object_id('dbo.ftp_userIPs') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
Drop TABLE dbo.ftp_userIPs
GO
IF EXISTS (Select * FROM dbo.sysobjects Where id = object_id('dbo.ftp_users') AND OBJECTPROPERTY(id, 'IsUserTable') = 1)
Drop TABLE dbo.ftp_users
GO
Create TABLE dbo.ftp_groupAccess (
indexNo smallint NOT NULL,
ftpUserName varchar (50) NOT NULL,
accessRule varchar (200) NOT NULL
)
GO
Create TABLE dbo.ftp_groupIPs (
indexNo smallint NOT NULL,
ftpUserName varchar (50) NOT NULL,
accessRule varchar (80) NOT NULL
)
GO
Create TABLE dbo.ftp_groups (
id int IDENTITY (1, 1) NOT NULL,
ftpUserName varchar (50) NOT NULL,
accessRule varchar (200) NULL,
notes varchar (255) NULL
)
GO
Create TABLE dbo.ftp_userAccess (
indexNo smallint NOT NULL,
ftpUserName varchar (50) NOT NULL,
accessRule varchar (200) NOT NULL
)
GO
Create TABLE dbo.ftp_userIPs (
indexNo smallint NOT NULL,
ftpUserName varchar (50) NOT NULL,
accessRule varchar (80) NOT NULL
)
GO
Create TABLE dbo.ftp_users (
id int IDENTITY (1, 1) NOT NULL,
ftpUserName varchar (50) NOT NULL,
ftpPassword varchar (50) NOT NULL,
ftpPasswordType tinyint NULL,
changePassword bit NOT NULL,
sKey varchar (50) NOT NULL,
accessRule varchar (200) NULL,
dirHome varchar (200) NOT NULL,
privilege tinyint NULL,
loginMsgFile varchar (80) NULL,
disabled bit NOT NULL,
sessionEncryption bit NOT NULL,
dirHomeLock bit NOT NULL,
hideHidden bit NOT NULL,
alwaysAllowLogin bit NOT NULL,
maxUsersConcurrent smallint NOT NULL,
speedLimitUp int NULL,
speedLimitDown int NULL,
maxUsersLoginPerIP smallint NOT NULL,
timeOutIdle int NULL,
timeOutSession int NULL,
quotaEnable bit NOT NULL,
quotaCurrent bigint NULL,
quotaMax bigint NULL,
ratioType tinyint NULL,
ratioUp smallint NULL,
ratioDown smallint NULL,
ratioCredit float NULL,
expiration smalldatetime NULL,
groups varchar (80) NULL,
notes varchar (255) NOT NULL
)
GO

Alter TABLE dbo.ftp_groups WITH NOCHECK ADD CONSTRAINT pk_ftp_groups PRIMARY KEY CLUSTERED (id)
GO
Alter TABLE dbo.ftp_users WITH NOCHECK ADD CONSTRAINT pk_ftp_users PRIMARY KEY CLUSTERED (id)
GO
Alter TABLE dbo.ftp_groupAccess ADD CONSTRAINT df_ftp_groupAccess_indexNo DEFAULT (2) FOR indexNo
GO
Create INDEX ix_ftp_groupAccess__ftpUserName ON dbo.ftp_groupAccess(ftpUserName, indexNo)
GO
Alter TABLE dbo.ftp_groupIPs ADD CONSTRAINT df_ftp_groupIPs_indexNo DEFAULT (2) FOR indexNo
GO
Create INDEX ix_ftp_groupIPs__ftpUserName ON dbo.ftp_groupIPs(ftpUserName, indexNo)
GO
Create UNIQUE INDEX ix_ftp_groups__ftpUserName ON dbo.ftp_groups(ftpUserName)
GO
Alter TABLE dbo.ftp_userAccess ADD CONSTRAINT df_ftp_userAccess_indexNo DEFAULT (2) FOR indexNo
GO
Create INDEX ix_ftp_userAccess__ftpUserName ON dbo.ftp_userAccess(ftpUserName, indexNo)
GO
Alter TABLE dbo.ftp_userIPs ADD CONSTRAINT df_ftp_userIPs_indexNo DEFAULT (2) FOR indexNo
GO
Create INDEX ix_ftp_userIPs__ftpUserName ON dbo.ftp_userIPs(ftpUserName, indexNo)
GO
Alter TABLE dbo.ftp_users ADD
CONSTRAINT df_ftp_users_changePassword DEFAULT (1) FOR changePassword,
CONSTRAINT df_ftp_users_sKey DEFAULT ('') FOR sKey,
CONSTRAINT df_ftp_users_disabled DEFAULT (0) FOR disabled,
CONSTRAINT df_ftp_users_sessionEncryption DEFAULT (0) FOR sessionEncryption,
CONSTRAINT df_ftp_users_dirHome DEFAULT ('') FOR dirHome,
CONSTRAINT df_ftp_users_dirHomeLock DEFAULT (1) FOR dirHomeLock,
CONSTRAINT df_ftp_users_hideHidden DEFAULT (1) FOR hideHidden,
CONSTRAINT df_ftp_users_alwaysAllowLogin DEFAULT (0) FOR alwaysAllowLogin,
CONSTRAINT df_ftp_users_maxUsersConcurrent DEFAULT (10) FOR maxUsersConcurrent,
CONSTRAINT df_ftp_users_speedLimitUp DEFAULT ((-1)) FOR speedLimitUp,
CONSTRAINT df_ftp_users_speedLimitDown DEFAULT ((-1)) FOR speedLimitDown,
CONSTRAINT df_ftp_users_maxUsersLoginPerIP DEFAULT (5) FOR maxUsersLoginPerIP,
CONSTRAINT df_ftp_users_timeOutSession DEFAULT ((-1)) FOR timeOutSession,
CONSTRAINT df_ftp_users_quotaEnable DEFAULT (1) FOR quotaEnable,
CONSTRAINT df_ftp_users_quotaCurrent DEFAULT (0) FOR quotaCurrent,
CONSTRAINT df_ftp_users_quotaMax DEFAULT (52428800) FOR quotaMax,
CONSTRAINT df_ftp_users_notes DEFAULT ('') FOR notes
GO
Create UNIQUE INDEX ix_ftp_users__ftpUserName ON dbo.ftp_users(ftpUserName)
GO


上一篇: 把兴趣放下,把责任拣起!
下一篇: asp.net(vb.net)连接sql server 2000数据库的连接模块(module)
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags:
相关日志:
评论: 0 | 引用: 0 | 查看次数: 4702
发表评论
昵 称:
密 码: 游客发言不需要密码.
邮 箱: 邮件地址支持Gravatar头像,邮箱地址不会公开.
网 址: 输入网址便于回访.
内 容:
验证码:
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.
字数限制 300 字 | UBB代码 开启 | [img]标签 关闭