~]# yum install httpd
修改http配置文件以支持php服務php
# cd /etc/httpd/conf 編輯 httpd.conf 文件時要注意: 1): AddType application/x-compress .Z AddType application/x-gzip .gz .tgz 在後面添加: AddType application/x-httpd-php .php(使Apcche支持PHP) AddType application/x-httpd-php-source .php5 2) 找到: <IfModule dir_module> DirectoryIndex index.html </IfModule> 添加: <IfModule dir_module> DirectoryIndex index.html index.php </IfModule> 3) 找到: #ServerName www.example.com:80 修改成: ServerName 127.0.0.1:80或者ServerName localhost:80
利用webstatic的官方yum源進行php的安裝html
# 安裝yum源 yum install epel-release rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm # 安裝php56版本 yum install php56w php56w-opcache
# 下載MySQL安裝包,解壓後刪除minimal相關的rpm包後yum安裝 wget https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.23-1.el7.x86_64.rpm-bundle.tar yum install mysql-community-*
systemctl start mysqld
mysql5.7啓動後,第一次產生隨機密碼保存在/var/log/mysqld.log中mysql
grep "temp" /var/log/mysqld.log
修改密碼爲「1qaz@WSX」,自行設定web
mysql> alter user root@localhost identified by '1qaz@WSX';
能夠直接參考:https://www.zabbix.com/download 官網進行安裝sql
# rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm # yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent # 配置好webstatic的yum源,會自動解決zabbix依賴的相關php模塊
# mysql -uroot -p password mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; mysql> quit; # 導入zabbix數據庫 # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
# cd /etc/zabbix/ # vim zabbix_server.conf # grep -Ev "^#|^$" zabbix_server.conf LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_server.pid SocketDir=/var/run/zabbix DBName=zabbix DBUser=zabbix DBPassword=1qaz@WSX SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 AlertScriptsPath=/usr/lib/zabbix/alertscripts ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000
# cd /etc/httpd/conf.d/ # vim zabbix.conf
# cd /var/www/html/ # vim index.php <?php phpinfo(); ?> # 啓動httpd服務 # systemctl start httpd # 訪問ip顯示以下
IP:http://ip/zabbix/setup.phpshell
官方默認用戶名:Admin,密碼:zabbix數據庫