centos 6.X
percona-server
zabbix
yum install -y curl-devel net-snmp net-snmp-devel net-snmp-utils ncurses-devel ncurses libaio-devel
yum install -y gcc gcc-c++ automake autoconf
yum install -y zlib zlib-devel openssl openssl-devel
cmake-3.1.0.tar.gz
./configure && make && make install
percona-server-5.6.21-70.1.tar.gz
useradd -M -s /sbin/nologin percona
mkdir -p /data/percona
cmake . -LH # 编译参数
cmake --help
cmake \
-DCMAKE_INSTALL_PREFIX=/usr/local/percona/ \
-DMYSQL_DATADIR=/data/percona/
make && make install
cp /usr/local/percona/support-files/mysql.server /etc/init.d/mysqld
chmod +x /etc/init.d/mysqld
cp /usr/local/percona/support-files/my-default.cnf /usr/local/percona/my.cnf
mv /etc/my.cnf /etc/my.cnf-bak
chown percona. /data/percona/ -R
chown percona. /usr/local/percona/ -R
/usr/local/percona/scripts/mysql_install_db --basedir=/usr/local/percona/ --datadir=/data/percona/ --user=percona
vi /usr/local/percona/my.cnf
[mysqld]
basedir=/usr/local/mysql
datadir=/data/mysql
log-error=/usr/local/mysql/error.log
pid-file=/usr/local/mysql/mysql.pid
explicit_defaults_for_timestamp
/etc/init.d/mysqld start 或者 /usr/local/mysql/bin/mysqld_safe
libmcrypt-2.5.7.tar.gz
ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/libmcrypt/
tar xf libmcrypt-2.5.7.tar.gz
cd libmcrypt-2.5.7
./configure && make && make install
libiconv(加强系统对支持字符编码转换的功能)
libiconv-1.14
tar zxvf libiconv-1.14.tar.gz
cd libiconv-1.14
./configure && make && make install
=============
-- EORROR: "make: *** [ext/phar/phar.php] 错误 127“
ln -s /www/wdlinux/mysql/lib/libmysqlclient.so.18 /usr/lib64/ # x86_64
ln -s /www/wdlinux/mysql/lib/libmysqlclient.so.18 /usr/lib/ #i386
-- EORROR: 出现 cp: cannot stat `ext/phar/phar.phar': No such file or directory
cd ext/phar/ && ls -l
结果发现没有phar.phar 这个文件!!
cp /root/php-5.6.1/ext/phar/phar.php /root/php-5.6.1/ext/phar/phar.phar && make ZEND_EXTRA_LIBS='-liconv' && make install
=============
php-5.6.1.tar.gz
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc/ --with-mysql=/usr/local/percona --with-mysqli=/usr/local/percona/bin/mysql_config --with-pdo-mysql=/usr/local/percona --enable-mysqlnd --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --with-gettext --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-soap --enable-ftp --enable-opcache=no && make ZEND_EXTRA_LIBS='-liconv' && make install
cp /root/php-5.6.1/php.ini-production /usr/local/php/etc/php.ini
cd /usr/local/php/etc/
cp php-fpm.conf.default php-fpm.conf
vi /usr/local/php/etc/php.ini
In php.ini:
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_execution_time = 300
max_input_time = 300
session.auto_start = 0
date.timezone = Asia/Shanghai
always_populate_raw_post_data = -1
/usr/local/php/sbin/php-fpm
nginx
nginx-1.6.2.tar.gz
./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/pcre/ --with-http_stub_status_module --with-http_ssl_module && make && make install
/usr/local/nginx/sbin/nginx
[root@localhost nginx-1.4.6]# vi /usr/local/nginx/conf/nginx.conf
worker_processes 8;
error_log logs/error.log;
pid logs/nginx.pid;
server {
listen 80;
server_name 192.168.32.130;
server_name 192.168.3.53;
location / {
root /usr/local/nginx/html;
index index.php index.html index.htm;
}
location /nginx-status {
stub_status on;
#access_lod off;
allow 127.0.0.1;
allow 192.168.32.0/24;
}
location ~ \.php$ { ###\.php 注意没有空格,不能有空格
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
zabbix-2.4.3
wget %20Latest%20Stable/2.4.3/zabbix-2.4.3.tar.gz/download
/usr/local/mysql/bin/mysql
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@'%' identified by 'zabbix';
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
/usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < /root/jiankong/zabbix-2.4.3/database/mysql/schema.sql
/usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < /root/jiankong/zabbix-2.4.3/database/mysql/images.sql
/usr/local/mysql/bin/mysql -uzabbix -pzabbix zabbix < /root/jiankong/zabbix-2.4.3/database/mysql/data.sql
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-libxml2 --with-net-snmp --with-libcurl && make && make install
cp -a /root/zabbix-2.4.3/frontends/php/ /usr/local/nginx/html/
cd /usr/local/nginx/html/
chown root. php/ -R
chmod 755 php/ -R
chown zabbix. /usr/local/zabbix/ -R
cp /usr/local/zabbix/sbin/zabbix_* /etc/init.d/
==========i386 zabbix-server 启动报错
/etc/init.d/zabbix_server: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
ln -vs /usr/local/lib/libiconv.so.2 /usr/lib/
====================
启动
/etc/init.d/zabbix_server
/etc/init.d/zabbix_agentd
vi /usr/local/zabbix/etc/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=192.168.56.101 //监控端
ServerActive=127.0.0.1
Hostname=192.168.56.102 //被监控端
#下载以后,放在/usr/local/nginx/html/php/conf/下
/usr/local/nginx/html/php/conf/zabbix.conf.php
zabbix支持中文
/usr/local/nginx/html/php/include/locales.inc.php
'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => false),
改成
'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => true),
##install zabbix-agent
./configure --prefix=/usr/local/zabbix-agent --enable-agent && make && make install
useradd zabbix -M -s /sbin/nologin
chown zabbix. /usr/local/zabbix
cp /usr/local/zabbix/sbin/zabbix_agentd /etc/init.d/
chmod 775 /etc/init.d/zabbix-agentd
chown zabbix. /etc/init.d/zabbix-agentd
vi /usr/local/zabbix-agent
LogFile=/usr/local/zabbix-agent/zabbix_agentd.log
Server=192.168.164.136
ServerActive=127.0.0.1
Hostname=192.168.164.134
/etc/init.d/zabbix-agentd
阅读(7753) | 评论(0) | 转发(0) |