Install additional front-end without back-end

# schema prepare
cd
curl -sL "https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/4.0.7/zabbix-4.0.7.tar.gz/download" > zabbix.tar.gz
tar -vzxf zabbix.tar.gz
cd zabbix-4.0.7/database/mysql
mysql <<< 'create database z40 character set utf8 collate utf8_bin;'
mysql <<< 'grant all privileges on z40.* to zabbix@localhost identified by "zabbix";'
time mysql z40 < schema.sql
time mysql z40 < images.sql
time mysql z40 < data.sql

# frontend setup
cd /etc/httpd/conf.d/
cp zabbix.conf z40.conf
sed -i "s|\/share\/zabbix|\/share\/z40|g" z40.conf
mkdir -p /usr/share/z40
cd /usr/share/z40
svn co svn://svn.zabbix.com/tags/4.0.7/frontends/php && mv php/* . && rm php -rf

cat <<'EOF'> /usr/share/z40/conf/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB;

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = 'localhost';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'z40';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'zabbix';

// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'localhost';
$ZBX_SERVER_PORT = '14051';
$ZBX_SERVER_NAME = 'z40';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
EOF

systemctl restart httpd
3.4:
cd
curl -sL "https://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/3.4.15/zabbix-3.4.15.tar.gz/download" > zabbix-3.4.15.tar.gz
tar -vzxf zabbix-3.4.15.tar.gz
cd zabbix-3.4.15/database/mysql
mysql <<< 'create database z34 character set utf8 collate utf8_bin;'
mysql <<< 'grant all privileges on z34.* to zabbix@localhost identified by "zabbix";'
time mysql z34 < schema.sql
time mysql z34 < images.sql
time mysql z34 < data.sql

# frontend setup
cd /etc/httpd/conf.d/
cp zabbix.conf z34.conf
sed -i "s|\/share\/zabbix|\/share\/z34|g" z34.conf
mkdir -p /usr/share/z34
cd /usr/share/z34
svn co svn://svn.zabbix.com/tags/3.4.15/frontends/php && mv php/* . && rm php -rf

cat <<'EOF'> /usr/share/z34/conf/zabbix.conf.php
<?php
// Zabbix GUI configuration file.
global $DB;

$DB['TYPE']     = 'MYSQL';
$DB['SERVER']   = 'localhost';
$DB['PORT']     = '0';
$DB['DATABASE'] = 'z34';
$DB['USER']     = 'zabbix';
$DB['PASSWORD'] = 'zabbix';

// Schema name. Used for IBM DB2 and PostgreSQL.
$DB['SCHEMA'] = '';

$ZBX_SERVER      = 'localhost';
$ZBX_SERVER_PORT = '13451';
$ZBX_SERVER_NAME = 'z34';

$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
EOF

systemctl restart httpd
Appendix:
cd /etc/httpd/conf.d

No comments: