ZABBIX 3.x PHP7環境への導入
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
目次~
#contents
*CentOS7にZabbix3系をPHP7系と一緒に入れる [#f267ed1c]
**CentOS7 [#wcd6617f]
最小インストールで構築
**MariaDBをインストール [#q2bc17a4]
-/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
-YUMで MariaDB 10.1をインストール
yum install mariadb-server mariadb mariadb-devel mariadb...
-MariaDBを起動し、自動起動を有効にする
systemctl start mariadb
systemctl enable mariadb
-初期設定スクリプトを使い、rootユーザのパスワードを設定
mysql_secure_installation
~
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FO...
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP ...
In order to log into MariaDB to secure it, we'll need th...
password for the root user. If you've just installed Ma...
you haven't set the root password yet, the password will...
so you should just press enter here.
Enter current password for root (enter for none): ←Enter
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log in...
root user without the proper authorisation.
Set root password? [Y/n] ←Enter
New password: ←パスワード入力
Re-enter new password: ←パスワード再入力
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user...
to log into MariaDB without having to have a user accoun...
them. This is intended only for testing, and to make th...
go a bit smoother. You should remove them before moving...
production environment.
Remove anonymous users? [Y/n] ←Enter
... Success!
Normally, root should only be allowed to connect from 'l...
ensures that someone cannot guess at the root password f...
Disallow root login remotely? [Y/n] ←Enter
... Success!
By default, MariaDB comes with a database named 'test' t...
access. This is also intended only for testing, and sho...
before moving into a production environment.
Remove test database and access to it? [Y/n] ←Enter
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all chan...
will take effect immediately.
Reload privilege tables now? [Y/n] ←Enter
... Success!
Cleaning up...
All done! If you've completed all of the above steps, y...
installation should now be secure.
Thanks for using MariaDB!
**Apache,PHPをインストール [#r8646a20]
-YUMでApacheをインストール
yum install httpd
-Apacheを起動し、自動起動を有効にする
systemctl start httpd
systemctl enable httpd
-PHP 7系をインストールするために必要なYUMのリポジトリ(EPE...
yum install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-r...
-Remiリポジトリを指定し、PHP 7と必要なパッケージをインス...
yum install --enablerepo=remi-php70 php php-mysqlnd php-...
-php.iniにタイムゾーンを設定
sed -i 's/\;date\.timezone\ \=/date\.timezone\ \=\ Asia\...
-Apacheを再起動
systemctl restart httpd
**Zabbix serverをインストール [#sc51668a]
-Zabbix Serverのインストールに必要なYUMのリポジトリを追加
rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64...
-Zabbix Serverと必要なパッケージをインストール
yum install --enablerepo=remi-php70 zabbix-server zabbix...
-MariaDBにZabbix Server用のデータベースとユーザを作成。ユ...
# mysql -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or ...
Your MariaDB connection id is 10
Server version: 10.1.11-MariaDB MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab...
Type 'help;' or '\h' for help. Type '\c' to clear the cu...
MariaDB [(none)]> create database zabbix character set u...
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to za...
'zabbix';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> \q
Bye
-Zabbix Server用のデータをMariaDBにインポート
cd /usr/share/doc/zabbix-server-mysql-3.2.6/
gzip -d create.sql.gz
mysql -u zabbix -pzabbix zabbix < create.sql
cd
-Zabbix Serverの設定ファイルをバックアップ
mv -v /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_...
-/etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBSocket=/var/lib/mysql/mysql.sock
SNMPTrapperFile=/var/log/snmptt/snmptt.log
AlertScriptsPath=/etc/zabbix/alertscripts
ExternalScripts=/etc/zabbix/externalscripts
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
-PHP7対応で書き換える
sed -i "s/PHP\_VERSION\,\ '5\.6'/PHP\_VERSION\,\ '7\.1'/...
-Zabbix起動 apache再起動
systemctl enable zabbix-server
systemctl start zabbix-server
systemctl restart httpd
-web画面の確認
WebUIにアクセスするには「http://サーバIPアドレス/zabbix...
-表示されない場合
--firewallにhttpの許可を追加
firewall-cmd --permanent --add-service=http
-zabbixサーバが起動しない場合
--SELinuxに許可を追加
setsebool -P httpd_can_connect_zabbix on
setsebool -P zabbix_can_network on
yum install policycoreutils-python
grep zabbix_server /var/log/audit/audit.log | audit2all...
semodule -i zabbix-limit.pp
終了行:
目次~
#contents
*CentOS7にZabbix3系をPHP7系と一緒に入れる [#f267ed1c]
**CentOS7 [#wcd6617f]
最小インストールで構築
**MariaDBをインストール [#q2bc17a4]
-/etc/yum.repos.d/MariaDB.repo
# MariaDB 10.1 CentOS repository list
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
-YUMで MariaDB 10.1をインストール
yum install mariadb-server mariadb mariadb-devel mariadb...
-MariaDBを起動し、自動起動を有効にする
systemctl start mariadb
systemctl enable mariadb
-初期設定スクリプトを使い、rootユーザのパスワードを設定
mysql_secure_installation
~
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FO...
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP ...
In order to log into MariaDB to secure it, we'll need th...
password for the root user. If you've just installed Ma...
you haven't set the root password yet, the password will...
so you should just press enter here.
Enter current password for root (enter for none): ←Enter
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log in...
root user without the proper authorisation.
Set root password? [Y/n] ←Enter
New password: ←パスワード入力
Re-enter new password: ←パスワード再入力
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MariaDB installation has an anonymous user...
to log into MariaDB without having to have a user accoun...
them. This is intended only for testing, and to make th...
go a bit smoother. You should remove them before moving...
production environment.
Remove anonymous users? [Y/n] ←Enter
... Success!
Normally, root should only be allowed to connect from 'l...
ensures that someone cannot guess at the root password f...
Disallow root login remotely? [Y/n] ←Enter
... Success!
By default, MariaDB comes with a database named 'test' t...
access. This is also intended only for testing, and sho...
before moving into a production environment.
Remove test database and access to it? [Y/n] ←Enter
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all chan...
will take effect immediately.
Reload privilege tables now? [Y/n] ←Enter
... Success!
Cleaning up...
All done! If you've completed all of the above steps, y...
installation should now be secure.
Thanks for using MariaDB!
**Apache,PHPをインストール [#r8646a20]
-YUMでApacheをインストール
yum install httpd
-Apacheを起動し、自動起動を有効にする
systemctl start httpd
systemctl enable httpd
-PHP 7系をインストールするために必要なYUMのリポジトリ(EPE...
yum install epel-release
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-r...
-Remiリポジトリを指定し、PHP 7と必要なパッケージをインス...
yum install --enablerepo=remi-php70 php php-mysqlnd php-...
-php.iniにタイムゾーンを設定
sed -i 's/\;date\.timezone\ \=/date\.timezone\ \=\ Asia\...
-Apacheを再起動
systemctl restart httpd
**Zabbix serverをインストール [#sc51668a]
-Zabbix Serverのインストールに必要なYUMのリポジトリを追加
rpm -Uvh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64...
-Zabbix Serverと必要なパッケージをインストール
yum install --enablerepo=remi-php70 zabbix-server zabbix...
-MariaDBにZabbix Server用のデータベースとユーザを作成。ユ...
# mysql -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or ...
Your MariaDB connection id is 10
Server version: 10.1.11-MariaDB MariaDB Server
Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab...
Type 'help;' or '\h' for help. Type '\c' to clear the cu...
MariaDB [(none)]> create database zabbix character set u...
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to za...
'zabbix';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> \q
Bye
-Zabbix Server用のデータをMariaDBにインポート
cd /usr/share/doc/zabbix-server-mysql-3.2.6/
gzip -d create.sql.gz
mysql -u zabbix -pzabbix zabbix < create.sql
cd
-Zabbix Serverの設定ファイルをバックアップ
mv -v /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_...
-/etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
DBSocket=/var/lib/mysql/mysql.sock
SNMPTrapperFile=/var/log/snmptt/snmptt.log
AlertScriptsPath=/etc/zabbix/alertscripts
ExternalScripts=/etc/zabbix/externalscripts
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
-PHP7対応で書き換える
sed -i "s/PHP\_VERSION\,\ '5\.6'/PHP\_VERSION\,\ '7\.1'/...
-Zabbix起動 apache再起動
systemctl enable zabbix-server
systemctl start zabbix-server
systemctl restart httpd
-web画面の確認
WebUIにアクセスするには「http://サーバIPアドレス/zabbix...
-表示されない場合
--firewallにhttpの許可を追加
firewall-cmd --permanent --add-service=http
-zabbixサーバが起動しない場合
--SELinuxに許可を追加
setsebool -P httpd_can_connect_zabbix on
setsebool -P zabbix_can_network on
yum install policycoreutils-python
grep zabbix_server /var/log/audit/audit.log | audit2all...
semodule -i zabbix-limit.pp
ページ名: