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

原创zabbix安装 – Crazy knowledge base
Crazy knowledge base

原创zabbix安装

1、安装MYSQL

SHELL> ./configure –prefix=/usr/local/mysql –localstatedir=/var/lib/mysql –with-charset=utf8
SHELL> make
SHELL> make install
SHELL> cp support-files/my-medium.cnf /etc/my.cnf  

SHELL> cp support-files/mysql.server /etc/rc.d/init.d/mysqld
SHELL> chmod 700 /etc/rc.d/init.d/mysqld
SHELL> chkconfig –add mysqld

SHELL> groupadd mysql 
SHELL> useradd -g mysql mysql

SHELL> /usr/local/mysql/bin/mysql_install_db –user=mysql
SHELL> chown -R root.mysql /var/lib/mysql 

SHELL> chmod -R 770 /var/lib/mysql
SHELL> /usr/local/mysql/bin/mysqld_safe –user=mysql &
SHELL> /etc/rc.d/init.d/mysqld start
SHELL> ln -s /usr/local/mysql/bin/mysql /sbin/mysql
SHELL> ln -s /usr/local/mysql/bin/mysqladmin /sbin/mysqladmin

 



说明:
错误日志包含了服务器写入标准错误输出设备的所有消息,同时还包括了mysql服务的启动和关闭事件
常规日志用来记录有关mysql服务器运行的常规信息,包括用户的连接、查询及其他各种时间
更新日志用来记录修改数据库的查询信息,包括所有涉及数据库修改的SQl语句的查询记录
建议调试结束后关闭日志
用如下命令修改MYSQL密码,默认安装密码为空,为了安全你必须马上修改 
/usr/local/mysql/bin/mysqladmin -uroot password xuefeng
 
现在修改的密码为:xuefeng 

 
2、安装PHP

SHELL>./configure –prefix=/usr/local/php –enable-fastcgi –with-mysql=/usr/local/mysql –enable-force-cgi-redirect –with-freetype-dir=/usr –with-png-dir=/usr –with-gd –enable-gd-native-ttf –with-ttf –with-gdbm –with-gettext –with-iconv –with-jpeg-dir=/usr –with-zlib –with-xmlrpc –enable-calendar –enable-mbstring
SHELL> make
SHELL> make install
SHELL>cp -a php.ini-dist /usr/local/php/lib/php.ini

说明:
打开php.ini文件以后修改两处如下
1:date.timezone =Asia/Shanghai
2:max_execution_time = 300
 
 

3、PHP启动脚本

#!/bin/bash
PHPFCGI=”/usr/local/php/bin/php-cgi”
FCGIPORT=”8888″
FCGI_WEB_SERVER_ADDRS=”127.0.0.1″
FCGIADDR=”127.0.0.1″
PHP_FCGI_CHILDREN=5
PHP_FCGI_MAX_REQUESTS=1000
ALLOWED_ENV=”ORACLE_HOME PATH USER”
if test x$PHP_FCGI_CHILDREN = x; then
  PHP_FCGI_CHILDREN=5
fi
ALLOWED_ENV=”$ALLOWED_ENV PHP_FCGI_CHILDREN”
ALLOWED_ENV=”$ALLOWED_ENV PHP_FCGI_MAX_REQUESTS”
ALLOWED_ENV=”$ALLOWED_ENV FCGI_WEB_SERVER_ADDRS”
if test x$UID = x0; then
  EX=”/bin/bash -m -c \”$PHPFCGI -q -b $FCGIADDR:$FCGIPORT\” $USERID”
else
  EX=”$PHPFCGI -b $FCGIADDR:$FCGIPORT”
fi
echo $EX
E=
for i in $ALLOWED_ENV; do
  E=”$E $i=${!i}”
done
nohup env – $E sh -c “$EX” &> /dev/null &

 

4、安装Nginx

SHELL>  ./configure
SHELL>  make
SHELL>  maie install

虚似机主代码

server {
        listen       80;

       server_name  192.168.1.5;
       server_name  114.85.165.156;

       location / {
            root   /var/www/zabbix;
            index  index.html index.htm index.php;
        }
location ~ .php$ {
          fastcgi_pass   127.0.0.1:8888;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  /var/www/zabbix$fastcgi_script_name;
          fastcgi_param  QUERY_STRING     $query_string;
          fastcgi_param  REQUEST_METHOD   $request_method;
          fastcgi_param  CONTENT_TYPE     $content_type;
          fastcgi_param  CONTENT_LENGTH   $content_length;
        }
    }

 
5、配置ZABBIX数据库

SHELL> mysql -u<username> -p<password>
mysql> create database zabbix;
mysql> quit;
SHELL> cd create/schema
SHELL> cat mysql.sql | mysql -u<username> -p<password> zabbix
SHELL> cd ../data
SHELL> cat data.sql | mysql -u<username> -p<password> zabbix
SHELL> cat images_mysql.sql | mysql -u<username> -p<password> zabbix

 
 
6、ZABBIX编译安装
客户端+服务端

SHELL> ./configure –prefix=/usr/local/zabbix–enable-server –enable-agent –with-mysql=/usr/loca/mysql/bin/mysq_config –with-net-snmp –with-jabber –with-libcurl
SHELL> make
SHELL> make install
SHELL> vi  /etc/services
SHELL> zabbix-agent 10050/tcp Zabbix Agent
SHELL> zabbix-agent 10050/udp Zabbix Agent
SHELL> zabbix-trapper 10051/tcp Zabbix Trapper
SHELL> zabbix-trapper 10051/udp Zabbix Trapper

客户端安装

SHELL> ./configure –prefix=/usr/local/zabbix –enable-agent
SHELL> make
SHELL> make install


7、ZABBIX网站程序文件配置

SHELL> vi frontends/php/include/db.inc.php
SHELL> cp -a frontends/php /var/www/zabbix
$DB_TYPE =”MYSQL”;
$DB_SERVER =”localhost”;
$DB_DATABASE =”zabbix”;
$DB_USER =”zabbix”;
$DB_PWD =””;
SHELL> cp -a frontends/php /var/www/zabbix
SHELL> chown -R zabbix.zabbix /var/www/zabbix
SHELL> chmod -R 774 /var/www/zabbix

说明:
我配置时发现有个变量没有定义,可能是程序有个小BUG解决方法如下

SHELL>  vi /var/www/zabbix/include/page_header.php
把457行替换成如下
$printview = new CLink(S_PRINT,’192.168.1.5′.(empty($_GET)?’?’:’&’).’print=1′, ‘small_font’);

 
 

8、建立ZABBIX配置文件

SHELL> mkdir /etc/zabbix
SHELL> cp misc/conf/* /etc/zabbix/

说明:
ZABBIX只要有4个配置文件,zabbix_agent.conf、zabbix_agentd.conf、zabbix_server.conf 、zabbix_trapper.conf。
其它配置文件没特殊需要不去鸟它以下是4个文件的配置

zabbix_agentd.conf如下
Server=192.168.1.5
Hostname=ZABBIX Server
ListenPort=10050
ListenIP=192.168.1.5            注:这里千万注意写公网IP,不要127.0.0.1我绕了好大圈子总算查出这个问题
StartAgents=3
RefreshActiveChecks=120
DisableActive=1
DebugLevel=3
PidFile=/var/tmp/zabbix_agentd.pid
LogFile=/tmp/zabbix_agentd.log
Timeout=3
UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d”:”|cut -f1 -d”T”
UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d”:”|cut -f1 -d”Q”
UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d”:”|cut -f1 -d”S”
UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d”:”|cut -f1 -d”O”
UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d”:”
UserParameter=mysql.version,mysql -V

 

zabbix_agent.conf如下
Server=192.168.1.5
Timeout=3
UserParameter=mysql.ping,mysqladmin -uroot ping|grep alive|wc -l
UserParameter=mysql.uptime,mysqladmin -uroot status|cut -f2 -d”:”|cut -f1 -d”T”
UserParameter=mysql.threads,mysqladmin -uroot status|cut -f3 -d”:”|cut -f1 -d”Q”
UserParameter=mysql.questions,mysqladmin -uroot status|cut -f4 -d”:”|cut -f1 -d”S”
UserParameter=mysql.slowqueries,mysqladmin -uroot status|cut -f5 -d”:”|cut -f1 -d”O”
UserParameter=mysql.qps,mysqladmin -uroot status|cut -f9 -d”:”
UserParameter=mysql.version,mysql -V

 

zabbix_server.conf如下
NodeID=0
StartPollers=5
StartTrappers=5
ListenPort=10051
HousekeepingFrequency=1
SenderFrequency=30
DebugLevel=3
Timeout=5
UnavailableDelay=15
UnavailableDelay=60
PidFile=/var/tmp/zabbix_server.pid
LogFile=/tmp/zabbix_server.log
AlertScriptsPath=/home/zabbix/bin/
PingerFrequency=30
DBHost=localhost
DBName=zabbix
DBUser=root
DBPassword=
DBSocket=/tmp/mysql.sock

 
 

zabbix_trapper.conf如下
DebugLevel=3
imeout=3
LogFile=/tmp/zabbix_trapper.log
DBHost=localhost
DBName=zabbix
DBUser=root
DBPassword=
DBSocket=/tmp/mysql.sock

9、设置ZABBIX启动脚本

SEHLL> cp misc/init.d/redhat/zabbix_* /usr/local/zabbix/sbin/
编辑zabbix_agentd_ctl 和 zabbix_server_ctl
BASEDIR=/usr/local/zabbix 为指定的zabbix安装目录.
zabbix_server_ctl文件中的
ZABBIX_SUCKERD=$BASEDIR/sbin/zabbix_server
6.启动服务:
服务器端
SEHLL> /usr/local/zabbix/bin/zabbix_server_ctl start
客户端
SEHLL> /usr/local/zabbix/bin/zabbix_agentd_ctl start

 
 
10\、开机自动启动

SHELL> echo “/usr/local/zabbix/sbin/zabbix_agentd_ctl start” >> /etc/rc.local
SHELL> echo “/usr/local/zabbix/sbin/zabbix_server_ctl start” >>  /etc/rc.loca
SHELL> echo “/usr/local/nginx/sbin/nginx ” >> /etc/rc.local
SHELL> echo “/shell/php-cgi start” >> /etc/rc.local
SHELL> echo “/etc/rc.d/mysqld start” >> /etc/rc.local

 
原创zabbix安装

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

滚动到顶部