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 (188) ORDER BY t.name ASC

HTTP代理服务器Squid安装 – Crazy knowledge base
Crazy knowledge base

HTTP代理服务器Squid安装

一、介绍
本文主要介绍了在linux使用squid和squidGuard配置代理服务器,以www代理服务为例介绍如何过滤有害站点和限制用户对internet的访问。
本次安装系统为RH AS 5 2.6.18
squid-2.7.STABLE9.tar.gz
db-2.7.7.tar.gz
squidGuard-1.4.tar.gz

二、安装
1、安装squid
tar -zxf squid-2.7.STABLE9.tar.gz
cd squid-2.7.STABLE9
./configure
make
make install
(默认安装到/usr/local/squid目录下)

2、安装Berkeley DB 2
tar -zxf db-2.7.7.tar.gz
cd db-2.7.7/build_unix
../dist/configure
make
make install
(默认安装到/usr/local/BerkeleyDB目录下)
注意:squidGuard不支持Berkeley DB 3.x版本

3、安装squidGuard
tar -zxf squidGuard-1.4.tar.gz
cd squidGuard-1.4
./configure –with-sg-config=/usr/local/squidGuard/squidGuard.conf –with-sg-logdir=/usr/local/squidGuard/logs –with-sg-dbhome=/usr/local/squidGuard/db
make
make install

三、配置
1、配置squid:
修改/usr/local/squid/etc/squid.conf

#squid的代理端口
http_port 8080
#允许所有的用户通过代理进行http访问
http_access allow all
#squid启用squidGuard进行过滤和转发
redirect_program /usr/local/squidGuard/bin/squidGuard -c /usr/local/squidGuard/squidGuard.conf

添加squid用户
uesradd squid

2、配置squidGuard
修改/usr/local/squidGuard/squidGuard.conf

#
# CONFIG FILE FOR SQUIDGUARD
#

dbhome /usr/local/squidGuard/db
logdir /usr/local/squidGuard/logs

src privileged {
  ip 192.168.1.185
}

#dest local {
# domainlist local/domains
#}

#src ncsauser {
#        user username
#}

acl {
#        ncsauser {
#                pass all
#        }

privileged {
  pass all
  }

default {
  pass none
  redirect http://localhost/block.html
  }
 }

具体参见http://www.squidguard.org/Doc/examples.html

四、启动
1、生成squid的缓存目录
/usr/local/squid/sbin/squid -z
(默认squid的缓存目录/usr/local/squid/cache)

2、设置可写权限
chown -R squid.squid /usr/local/squid/var/
chmod -R 777 /usr/local/squid/var/
chown -R squid.squid /usr/local/squidGuard/logs/
chmod -R 777 /usr/local/squidGuard/logs/

3、启动squid
/usr/local/squid/sbin/squid -N -d 1 -D
如果要后台运行把-N参数去掉就可
/usr/local/squid/sbin/squid -d 1 -D

ps ax|grep squid
查看启动是否正常,看到如下结果表示启动正常

22057 ? Ss 0:00 /usr/local/squid/sbin/squid -d 1 -D
22059 ? S 0:00 (squid) -d 1 -D
22106 ? S 0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
22107 ? S 0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
22108 ? S 0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
22109 ? S 0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf
22110 ? S 0:00 (squidGuard) -c /usr/local/squidGuard/squidGuard.conf

(此时squidGuard也已启用,每次修改配置后squid -k reconfigure重新起用即可,要杀掉squid执行squid -k kill)

4、查看日志
tail -f /usr/local/squidGuard/logs/squidGuard.log
注意:squidGuard对配置文件的语法要求很严,如果配置文件语法有误,squidGuard仍能运行,但是squidGuard已进入应急模式,此时代理服务不具有任何阻塞作用,所有通过该代理的访问都可通过,可以查看logs/squidGuard的日志文件,即可发现错误,例如:
2010-07-07 13:34:05 [6157] parse error in configfile /usr/local/squidGuard/squidGuard.conf line 8
2010-07-07 13:34:05 [6157] going into emergency mode

五、添加用户密码验证
cd squid-2.7.STABLE9/helpers/basic_auth/NCSA/
make ncsa_auth
cp ncsa_auth /usr/local/squid/libexec

用apache下程序htpasswd生成文件
htpasswd -c /usr/local/squid/etc/passwd username

修改squid.conf
vi /usr/local/squid/etc/squid.conf
找到相应行做以下修改

auth_param basic program /usr/local/squid/libexec/ncsa_auth /usr/local/squid/etc/passwd
acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

重新加载配置文件
/usr/local/squid/sbin/squid -k reconfigure

详细参见
http://www.phpfans.net/manu/Squid/index.html

HTTP代理服务器Squid安装

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 (187) 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 (192) ORDER BY t.name ASC

滚动到顶部