标签:adb log-error ted glibc iso ini max ror pdo
zabbix4.4.4 源码编译安装
mysql 8.0.17 二进制包安装
php72 yum源安装
nginx 1.16.1 yum源安装
zabbix_server 172.16.1.71
zabbix_agent 172.16.1.51
yum install bison-devel ncurses-devel libaio-devel
wget -c https://mirrors.tuna.tsinghua.edu.cn/mysql/downloads/MySQL-8.0/mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz
tar -xvf mysql-8.0.17-linux-glibc2.12-x86_64.tar.xz
mv mysql-8.0.17-linux-glibc2.12-x86_64 /usr/local/mysql
mkdir /usr/local/mysql/data
useradd -s /sbin/login -M mysql
chown mysql.mysql /usr/local/mysql -R
ln -s /usr/local/mysql/lib/* /usr/lib/
sudo ldconfig
echo '
[mysqld]
port=3306
datadir=/usr/local/mysql/data
log-error=/usr/local/mysql/mysql-err.log
user=mysql
default_authentication_plugin=mysql_native_password
socket=/usr/local/mysql/data/mysql.sock
[client]
socket=/usr/local/mysql/data/mysql.sock
[mysql]
socket=/usr/local/mysql/data/mysql.sock
' > /etc/my.cnf
mysqld --initialize-insecure --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
ln -s /usr/local/mysql/data /var/lib/mysql
echo '
export PATH=/usr/local/mysql/bin:$PATH
' > /etc/profile
source /etc/profile
echo '
[Unit]
Description=MySQL Server
Documentation=man:mysqld(8)
Documentation=http://dev.mysql.com/doc/refman/en/using-systemd.html
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
[Service]
User=mysql
Group=mysql
ExecStart=/usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf
LimitNOFILE = 5000
' > /usr/lib/systemd/system/mysqld.service
systemctl daemon-reload
systemctl start mysqld
systemctl enable mysqld
# MySQL8.0后版本,创建用户并授权命令和MySQL5.7之前的版本有所不同,需要先创建用户再授权;
create database zabbix character set=utf8;
create user 'zabbix'@'localhost' identified by '123456';
grant all privileges on zabbix.* to 'zabbix'@'localhost' with grant option;
flush privileges;
yum -y install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install php72w php72w-cli php72w-fpm php72w-common php72w-devel php72w-embedded php72w-gd php72w-mbstring php72w-opcache php72w-pdo php72w-xml php72w-mysqlnd php72w-pecl-memcached php72w-pecl-mongodb php72w-pecl-redis php72w-pecl-zip php72w-bcmath php72w-ladp php72w-mysqli
sed -i '/post_max_size/s/8/16/g' /etc/php.ini
sed -i '/max_execution_time/s/30/300/g' /etc/php.ini
sed -i '/max_input_time/s/60/300/g' /etc/php.ini
sed -i '/date.timezone/a date.timezone=PRC' /etc/php.ini
# 指定MySQL的sock文件,经过测试必须是系统默认库文件目录才可以;所以安装MySQL时做了软连接
sed -i '/mysqli.default_socket/cmysqli.default_socket = /var/lib/mysql/mysql.sock' /etc/php.ini
sed -i '/always_populate_raw_post_data/a always_populate_raw_post_data=-1' /etc/php.ini
systemctl start php-fpm
systemctl enable php-fpm
echo '
[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
' > /etc/yum.repos.d/nginx.repo
yum -y install nginx
# php的默认启动用户apache,经过测试nginx最好也使用apache用户,所以在此处修改
sed -i '/user nginx/cuser apache' /etc/nginx/nginx.conf
echo 'server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
location / {
index index.php setup.php;
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
} ' > /etc/nginx/conf.d/zabbix.conf
systemctl start nginx
systemctl enable nginx
yum -y install curl curl-devel net-snmp net-snmp-devel perl-DBI libven-devel
cd /root
wget -c https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.4.4/zabbix-4.4.4.tar.gz
tar -xzvf zabbix-4.4.4.tar.gz
cd zabbix-4.4.4
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql=/usr/local/mysql/bin/mysql_config --with-net-snmp --with-libcurl
make && make install
ln -s /usr/local/zabbix/sbin/* /usr/sbin/
cp /root/zabbix-4.4.4/misc/init.d/gentoo/zabbix-server /etc/sysconfig/
\cp -r /root/zabbix-4.4.4/frontends/php/* /usr/share/nginx/html/
chown apache.apache /usr/share/nginx/html -R
mysql -uzabbix -p123456 zabbix < /root/zabbix-4.4.4/database/mysql/schema.sql
mysql -uzabbix -p123456 zabbix < /root/zabbix-4.4.4/database/mysql/images.sql
mysql -uzabbix -p123456 zabbix < /root/zabbix-4.4.4/database/mysql/data.sql
echo '
LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
' > /usr/local/zabbix/etc/zabbix_server.conf
echo '
[Unit]
Description=Zabbix Server
After=syslog.target
After=network.target
After=mysql.service
After=mysqld.service
After=mariadb.service
After=postgresql.service
[Service]
Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_server.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-server
Type=forking
Restart=on-failure
PIDFile=/tmp/zabbix_server.pid
KillMode=control-group
ExecStart=/usr/sbin/zabbix_server -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
TimeoutSec=0
[Install]
WantedBy=multi-user.target
' > /usr/lib/systemd/system/zabbix.service
useradd -M -s /sbin/nologin zabbix
systemctl daemon-reload
systemctl start zabbix.service
systemctl enable zabbix.service
yum -y install epel-release pcre-devel
cd /root
wget -c https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.4.4/zabbix-4.4.4.tar.gz
tar -xzvf zabbix-4.4.4.tar.gz
cd zabbix-4.4.4
./configure --prefix=/usr/local/zabbix --enable-agent
make
make install
ln -s /usr/local/zabbix/sbin/zabbix_* /usr/sbin/
cp /root/zabbix-4.4.4/misc/init.d/debian/zabbix-agent /etc/sysconfig/
echo '
PidFile=/tmp/zabbix_agentd.pid
LogFile=/tmp/zabbix_agentd.log
LogFileSize=0
Server=172.16.1.71
ServerActive=172.16.1.71
Hostname=Zabbix server
Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/*.conf
' > /usr/local/zabbix/etc/zabbix_agentd.conf
echo '
[Unit]
Description=Zabbix Agent
After=syslog.target
After=network.target
[Service]
Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_agentd.conf"
EnvironmentFile=-/etc/sysconfig/zabbix-agent
Type=forking
Restart=on-failure
PIDFile=/tmp/zabbix_agentd.pid
KillMode=control-group
ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
User=zabbix
Group=zabbix
[Install]
WantedBy=multi-user.target
' > /usr/lib/systemd/system/zabbix_agnet.service
useradd -M -s /sbin/nologin zabbix
systemctl daemon-reload
systemctl start zabbix_agent.service
systemctl enable zabbix_agent.service
标签:adb log-error ted glibc iso ini max ror pdo
原文地址:https://www.cnblogs.com/IMSCZ/p/12153352.html