WordPress数据库错误: [Got error 28 from storage engine]
SHOW FULL COLUMNS FROM `wp_options`

WordPress数据库错误: [Got error 28 from storage engine]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format') AND tr.object_id IN (37) ORDER BY t.name ASC

pure-ftpd+mysql用户认证安装 – Crazy knowledge base
Crazy knowledge base

pure-ftpd+mysql用户认证安装

一、下载pureftp源代码,并确定mysql已经安装好
tar zxvf pure-ftpd-1.0.20.tar.gz
cd pure-ftpd-1.0.20

./configure –prefix=/usr/local/pureftpd –with-cookie –with-throttling –with-ratios –with-quotas –with-sysquotas –with-welcomemsg –with-upload-script –with-virtualhosts  –with-virtualchroot –with-diraliases –with-peruserlimits –with-language=simplified-chinese –with-mysql=/usr/local/mysql –with-paranoidmsg –with-altlog

注意如果出现如下错误:
configure: error: Your MySQL client libraries aren’t properly installed
执行:
cp /usr/local/mysql/lib/mysql/* /usr/lib/

make
make install
cp pureftpd-mysql.conf /etc/pureftpd-mysql.conf
cp configuration-file/pure-ftpd.conf /etc/pure-ftpd.conf
cp configuration-file/pure-config.pl /usr/local/pureftpd/bin/pure-config.pl

注意
–prefix=/usr/local/pureftpd 参数指定了pureftpd的安装路径
–with-mysql=/usr/local/mysql 参数指定了mysql的安装路径
–with-language=simplified-chinese 参数指定了服务器返回信息使用的语言

二、建立mysql认证数据库表

在mysql服务器中建立pureftpd数据库

mysql> CREATE DATA_base_ pureftpd;
mysql> grant all on pureftpd.* to pureftpd@localhost identified by ‘pureftpd’;
mysql> use pureftpd;
mysql> CREATE TABLE `users` (
`id` int(32) unsigned NOT NULL auto_increment,
`User` varchar(16) NOT NULL default ”,
`Password` varchar(64) NOT NULL default ”,
`Uid` varchar(11) NOT NULL default ‘-1’,
`Gid` varchar(11) NOT NULL default ‘-1’,
`Dir` varchar(128) NOT NULL default ”,
`QuotaSize` smallint(5) NOT NULL default ‘0’,
`QuotaFiles` int(11) NOT NULL default ‘0’,
`ULBandwidth` smallint(5) NOT NULL default ‘0’,
`DLBandwidth` smallint(5) NOT NULL default ‘0’,
`ULRatio` smallint(6) NOT NULL default ‘0’,
`DLRatio` smallint(6) NOT NULL default ‘0’,
`comment` tinytext NOT NULL,
`ipaccess` varchar(15) NOT NULL default ‘*’,
`status` enum(‘0′,’1’) NOT NULL default ‘0’,
`create_date` datetime NOT NULL default ‘0000-00-00 00:00:00’,
`modify_date` datetime NOT NULL default ‘0000-00-00 00:00:00’,
PRIMARY KEY (`id`,`User`),
UNIQUE KEY `User` (`User`)
) TYPE=MyISAM AUTO_INCREMENT=5 ;

三、建立用于pureftpd认证用户的系统信息

建立用于pureftpd认证用户的登陆目录

groupadd -g 参数的含义
ID值。除非使用-o参数不然该值必须是唯一,不可相同。数值不可为负。预设为最小不得小于500而逐次增加。0~499传统上是保留给系统帐号使用。

mkdir /var/www/mytest
groupadd pureftp -g 2000
useradd pureftp -u 2000 -g pureftp -d /var/www/mytest -s /sbin/nologin
chown pureftp.pureftp /var/www/mytest

四、修改pureftpd的配置文件

修改配置文件
vi /usr/local/pureftpd/etc/pure-ftpd.conf

代码:
MySQLConfigFile /usr/local/pureftpd/etc/pureftpd-mysql.conf
AllowUserFXP yes
NoChmod yes
IPV4Only yes
DisplayDotFiles no
NoAnonymous yes
PassivePortRange 30000 50000
Daemonize yes
# 不同DNS下,不设此参数可能出现“425 抱歉,给的是无效的地址”错误
# 详细说明见 http://download.pureftpd.org/pub/pure-ftpd/doc/README.Configuration-File
DontResolve  yes

代码:
vi /usr/local/pureftpd/etc/pureftpd-mysql.conf

代码:
MYSQLSocket     /tmp/mysql.sock
MYSQLUser       pureftpd
MYSQLPassword   pureftpd
MYSQLDatabase   pureftpd
MYSQLCrypt      cleartext
MYSQLGetPW      SELECT Password FROM users WHERE User=”\L”
MYSQLGetUID     SELECT Uid FROM users WHERE User=”\L”
MYSQLGetGID     SELECT Gid FROM users WHERE User=”\L”
MYSQLGetDir     SELECT Dir FROM users WHERE User=”\L”

五、运行pureftpd

INSERT INTO `users` VALUES (1, ‘loginname’, ‘passwd’, ‘2000’, ‘2000’, ‘/var/www/mytest’, 0, 0, 0, 0, 0, 0, ”, ‘*’, ‘1’, ‘2008-08-31 09:20:33’, ‘2008-08-31 09:20:33’);

六、打开被动模式端口
vi /etc/sysconfig/iptables

添加下面这行代码
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 30000:50000 -j ACCEPT
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT
/etc/init.d/iptables restart

七、运行pureftp服务器
代码:
/usr/local/pureftpd/bin/pure-config.pl /etc/pure-ftpd.conf

八、高级应用
pureftpd认证用户是使用其影射到的系统用户的uid和gid来访问文件系统的,所以要设置目录的写权限,只需要设置对应的系统用户的对该目 录的写入权限即可。

九、自动启动

可以将启动脚本写入/etc/rc.d/rc.local里,自启动,但不太方便
可以写一个脚本,如下:

vi /etc/init.d/pureftpd

#!/bin/sh

# Startup script for the FTP Server

#

# chkconfig: – 99 99

# description: FTP Serve

case “$1” in

start)

/usr/local/pureftpd/bin/pure-config.pl /etc/pure-ftpd.conf

;;

stop)

killall pure-ftpd > /dev/null

;;

*)

echo “Usage: `basename $0` {start | stop}” >&2

;;

esac

exit 0

添加init脚本
chkconfig –add pureftpd

用 chkconfig的查询,我们能核实我们所作的添加:
chkconfig –list | grep pureftpd
我们可以用标准的 find 命令察看chkconfig如何设定符号连接:
find /etc/rc.d -name ‘*pureftpd’ -print

开启pureftpd 脚本
chkconfig pureftpd on

pure-ftpd+mysql用户认证安装

WordPress数据库错误: [Got error 28 from storage engine]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (36) ORDER BY t.name ASC

WordPress数据库错误: [Got error 28 from storage engine]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (38) ORDER BY t.name ASC

2条评论在“pure-ftpd+mysql用户认证安装

评论已关闭。

滚动到顶部