root@ubuntu:~# ntpdate pool.ntp.br
22 Oct 07:40:47 ntpdate[4312]: adjust time server 200.160.7.186 offset 0.059302 sec
O comando Ntpdate foi usado para definir a data e a hora corretas usando o servidor: pool.ntp.br
Vamos instalar o serviço NTP.
# apt-get install ntp
NTP é o serviço que manterá nosso servidor atualizado.
Use a data do comando para verificar a data e a hora configuradas no seu Ubuntu Linux.
root@ubuntu:~# date
Thu 22 Oct 2020 07:46:02 AM -03
Se o sistema mostrasse a data e a hora corretas, isso significa que você seguiu todas as etapas corretamente.
Instalando o Apache no Linux
Em seguida, precisamos instalar o servidor web Apache e todo o software necessário.
No console do Linux, use os seguintes comandos para instalar os pacotes necessários.
# apt-get install libgd-dev unzip wget build-essential
# apt-get install apache2 php libapache2-mod-php php-gd
Pare o serviço Apache, ative os módulos necessários e inicie o serviço Apache.
root@ubuntu:~# service apache2 stop
root@ubuntu:~# a2enmod rewrite
Enabling module rewrite.
To activate the new configuration, you need to run:
systemctl restart apache2
root@ubuntu:~# systemctl restart apache2
root@ubuntu:~# a2enmod cgi
Enabling module cgi.
To activate the new configuration, you need to run:
systemctl restart apache2
root@ubuntu:~# systemctl restart apache2
root@ubuntu:~# service apache2 start
root@ubuntu:~# service apache2 status
● apache2.service - The Apache HTTP Server
Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2020-10-22 07:54:46 -03; 20s ago
Docs: https://httpd.apache.org/docs/2.4/
Process: 22593 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 22612 (apache2)
Tasks: 6 (limit: 2285)
Memory: 10.7M
CGroup: /system.slice/apache2.service
├─22612 /usr/sbin/apache2 -k start
├─22613 /usr/sbin/apache2 -k start
├─22614 /usr/sbin/apache2 -k start
├─22615 /usr/sbin/apache2 -k start
├─22616 /usr/sbin/apache2 -k start
└─22617 /usr/sbin/apache2 -k start
Oct 22 07:54:46 ubuntu systemd[1]: Starting The Apache HTTP Server...
Oct 22 07:54:46 ubuntu apachectl[22602]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName'>
Oct 22 07:54:46 ubuntu systemd[1]: Started The Apache HTTP Server.
Instalação Nagios no Ubuntu
No console do Linux, use os seguintes comandos para criar as contas necessárias.
# useradd nagios
# groupadd nagcmd
# usermod -a -G nagcmd nagios
Use os seguintes comandos para baixar os pacotes do Nagios.
# mkdir /downloads
# cd /downloads
# wget https://ufpr.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.4.2/nagios-4.4.2.tar.gz
Extraia, compile e instale o pacote Nagios.
# tar -zxvf nagios-4.4.2.tar.gz
# cd nagios-4.4.2/
# ./configure --with-nagios-group=nagios --with-command-group=nagcmd
# make all
# make install
# make install-init
# make install-config
# make install-commandmode
# make install-webconf
Vamos criar a senha para a conta de administrador do Nagios.
# htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
New password: *****
Re-type new password: *****
Adding password for user nagiosadmin
Você também deve reiniciar o apache manualmente e verificar o status do serviço.
# service apache2 restart
Nenhum comentário:
Postar um comentário