1) Установка EPEL:
**Проверка в браузере ссылки на доступность и правильность версии пакета**
http://dl.fedoraproject.org/pub/epel/7/x86_64/e
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
# rpm -ivh epel-release-7-2.noarch.rpm
1.1) Проверка установки EPEL:
**По умолчанию EPEL включается автоматически и его конфиг хранится в директории /etc/yum.repos.d/ в файле epel.repo.**
# yum repolist | grep "^epel\|repo id"
1.2) Проверка и удаление предыдущей версии MonIT:
# yum remove monit
1.3) Перезагрузка сервера:
# reboot
2) Установка MonIT:
# yum install monit
Результатом установки будет собственно демон (monit) и файл конфигурации, который живет тут:
/etc/monitrc
3) Запуск сервера monit
# monit
4) Проверяем статус сервера (демона)
# monit status
5) Доступ к веб-интерфейсу локально:
http://localhost:2812
(по умолчанию admin/monit)
Организуем доступ с удаленного ПК:
6) Установка webmin:
cd ~
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.710-1.noarch.rpm
rpm -U webmin-1.710-1.noarch.rpm
7) Отключаем firewalld в пользу iptables:
Источник: RHEL 7 / CentOS 7 : Disable Firewalld and use iptables @ All Linux User's Blog http://www.tejasbarot.com/2014/08/02/rhel-7-centos-7-disable-firewalld-and-use-iptables/#ixzz3JPORknJQ
As we all know that, CentOS / RHEL 7 both are completely systemd based, So We will have to use few systemd related commands to disable firewalld and enable iptables service.
7.1) Disable Firewalld Service:
# systemctl mask firewalld
7.2) Stop Firewalld Service:
# systemctl stop firewalld
7.3) Install iptables service related packages:
# yum -y install iptables-services
7.4) Make sure service starts at boot:
# systemctl enable iptables
** If you do not want ip6tables, You can skip following command.
# systemctl enable ip6tables
7.5) Now, Finally Let’s start the iptables services:
# systemctl start iptables
** If you do not want ip6tables, You can skip following command.
# systemctl start ip6tables
Firewalld Service is now disabled and stop, You can use iptables.
Now, You will be able to use iptables as your firewall, You can add / remove rules as you were doing in previous releases of Red Hat / CentOS 5 and 6, You can configure firewall with iptables in same manner as previous.
8) Разрешаем входящие порты tcp10000 tcp2812:
**Для доступа к webmin может понадобится временно отключить iptables
# systemctl stop iptables
**Затем вновь включить и проверить работоспособность:
# systemctl start iptables
9) Настраиваем конфиг MonIT ( /etc/monitrc):
Зададим адрес сервера:
set httpd port 2812
use address 192.168.1.130 # only accept connection from localhost
allow 192.168.1.0/24 # allow client to connect to the server
allow localhost # allow localhost to connect to the server and
allow admin:monit # require user 'admin' with password 'monit'
Перезагрузим службу:
# monit reload
10) Поставить службу в автозагрузку:
# systemctl enable monit.service
0 Комментарии