LINUX周测10

linux系统配置
1、临时关闭seLinux。

setenforce 0

2、永久关闭selinux 需编辑配置文件/etc/selinux/config,设置SELINUX=disabled,重启系统后生效。

vi /etc/selinux/configfirewall-cmd --zone=public --add-port=80/tcp --permanent  
firewall-cmd --reload 
firewall-cmd --query-port=80/tcp 

yum安装zabbix-server
1、从zabbix官方的源码库https://repo.zabbix.com下载、安装部署包文件。

wget -c -t 0 https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
rpm -ivh zabbix-release-4.4-1.el7.noarch.rpm

2、安装zabbix-server-mysql,启动服务并设置为开机启动。

yum install -y  zabbix-server-mysql   
systemctl start zabbix-server
systemctl enable zabbix-server

3、安装zabbix-web-mysql。

yum install -y  zabbix-web-mysql

4、安装客户端zabbix-agent,启动服务并设置为开机启动。

yum install -y zabbix-agent
systemctl start zabbix-agent
systemctl enable zabbix-agent

5、安装数据库mysql,启动服务并设置为开机启动,设置数据库账户root密码。

yum install -y  mariadb-server
systemctl  start    mariadb.service 
systemctl  enable    mariadb.service 
mysqladmin -uroot  password  'server7'

6、登录mysql,创建zabbix数据库,授权用户zabbix使用密码zabbix访问本地zabbix数据库时拥有所有权限。

mysql -uroot -p

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
quit;

7、向数据库zabbix中导入初始架构和数据。

find / -name "zabbix-server-mysql*"
cd  /usr/share/doc/zabbix-server-mysql-4.4.5
zcat  create.sql.gz  | mysql -uroot  -pserver7  zabbix

8、在配置文件zabbix_server.conf中编辑数据库配置。

vi /etc/zabbix/zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

9、安装zabbix-web 。

yum install -y  zabbix-web 

10、安装apache服务,启动服务并设置为开机启动。

yum install -y httpd
systemctl start httpd
systemctl enable httpd

11、安装php。

yum install -y php

12、安装时间同步ntp服务,修改系统时间为亚洲上海时区。

 yum install -y  ntpdate 
 ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 
 ntpdate us.pool.ntp.org
 date

13、修改配置文件/etc/httpd/conf.d/zabbix.conf,时区改成 Asia/Shanghai。

vi  /etc/httpd/conf.d/zabbix.conf

#
# Zabbix monitoring system php web frontend
#

Alias /zabbix /usr/share/zabbix

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Require all granted

    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        # php_value date.timezone Europe/Riga
        php_value date.timezone Asia/ShangHai  (添加位置)
    </IfModule>
</Directory>

<Directory "/usr/share/zabbix/conf">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/app">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/include">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/local">
    Require all denied
</Directory>

14、重启apache,zabbix-server服务。

systemctl   restart   httpd 
systemctl   restart   zabbix-server

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值