sudo vim /etc/selinux/config
(colocamos en SELINUX=disabled)
sudo vim /etc/hostname (agregamos web1)
sudo vim /etc/hosts (agregamos IP_Servidor www.digital.local)
sudo systemctl stop systemd-hostnamed
sudo systemctl start systemd-hostnamed
sudo systemctl status systemd-hostnamed
(Se recomienda usar un cliente con una conexión SSH previamente configurada para la administración)
rpm -qa | grep httpd
sudo yum install -y httpd
rpm -qa httpd
sudo yum install httpd php wget unzip gcc glibc glibc-common gd gd-devel perl policycoreutils-python
cd opt
sudo wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.4.5.tar.gz
sudo tar xvzf nagioscore.tar.gz
sudo ./configure
sudo make all
sudo make install-groups-users
usermod -aG nagios apache
sudo make install
sudo make install-init
sudo make install-daemoninit
sudo systemctl enable httpd.service
sudo make install-commandmode
sudo make install-config
sudo make install-webconf
–En el caso de no haberlo hecho antes–
sudo systemctl start firewalld
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --zone=public --add-port=80/tcp
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --reload
sudo firewall-cmd --list-all
sudo htpasswd -c usr/local/nagios/etc/htpasswd.users nagiosadmin
(colocamos un password)
sudo systemctl start httpd.service
sudo systemctl status httpd.service
<mark><mark>Pruebas en navegador</mark></mark>
firefox - localhost
http://localhost
firefox - IP del servidor
http://xxx.xxx.xxx.xxx
sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm yum-utils
sudo yum-config-manager --enable remi-php73
sudo yum -y install php php-commons php-mysql php-gd php-xml php-mbstring php-mcrypt
sudo vim /etc/yum.repos.d/MariaDB.10x.repo
(agregamos lo siguiente)
/*
[mariadb]
name=MariaDB
baseurl=http://yum.mariadb.org/10.3/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
*/
sudo yum -y install MariaDB-server MariaDB-client
sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo systemctl status mariadb
mysql_secure_installation
(realizamos los sigueintes pasos)
1 ENTER
2 ENTER
3 agregar password a MariaDB
4 ENTER
5 ENTER
6 ENTER
7 ENTER
mysql -uroot -p
create database wordpressdb;
----crear usuario para wordpressdb y darle privilegios—
grant all privileges on wordpressdb.* to wordpressuser@localhost identified by ‘wordpresspwd’;
flush privileges;
exit
cd /var/www/html/
sudo wget http://wordpress.org/latest.tar.gz
sudo tar vzxf latest.tar.gz
sudo rm -fr lastest.tar.gz
sudo chown -R apache:apache wordpress
sudo vim /etc/httpd/conf/httpd.conf
(agregamos los sigueinte)
/*
Listen 80
ServerAdmin [email protected]
ServerName www.dominio.local:80
<ifmodule dir_module="">DirectoryIndex index.html index.php (para evitar error 403 en los permisos de Nagios)</ifmodule>
<virtualhost *:80="">ServerAdmin [email protected]
ServerName www.dominio.local
DocumentRoot /var/www/html/wordpress
#ErrorLog /var/log/httpd/digital_local_error.log
#CustomLog /var/log/httpd/digital_local_requests.log combined</virtualhost>
*/
sudo systemctl start httpd
sudo systemctl status httpd
sudo apachectl enable
sudo apachectl start
sudo apachectl status
sudo yum install make gettext automake autoconf openssl-devel net-snmp net-snmp-utils epel-release
cd opt
sudo wget --no-check-certificate -O nagios-plugins.tar.gz https://github.com/nagios-plugins/nagios-plugins/archive/release-2.2.1.tar.gz
sudo tar xvzf nagios-plugins.tar.gz
sudo ./tools/setup
sudo ./configure
sudo make
sudo make install
sudo /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
(verificamos que no existan errores)
sudo systemctl enable nagios
sudo systemctl start nagios
sudo systemctl status nagios
sudo httpd -t
firefox - nombre de dominio
http://www.dominio.local
firefox - IP del servidor
http://xxx.xxx.xxx.xxx
wordpressdb
wordpressuser
wordpresspwd
—Creamos Usuario y Password—
Accedermos al Dashborar
firefox - nombre de dominio
http://www.dominio.local/nagios
firefox - IP del servidor
http://xxx.xxx.xxx.xxx/nagios
—authenticacion—
user: nagiosadmin
password: (el que colocamos)