You are on page 1of 4

AULA 01 – INSTALAÇÃO SAMBA4 COMO CONTROLADOR DE DOMÍNIO, GLPI, ZABBIX E

GRAFANA

<!-- INSTALAÇÃO SAMBA 4 -->

apt-get update
apt-get upgrade -y
nano /etc/netplan/00-installer
    network:
        ethernets;
             ens33:
            dhcp: no
            address: [192.168.18.10]
            gateway4: 192.168.18.1
            nameservers:
                address: [8.8.8.8, 8.8.4.4]
    version: 2

nano /etc/hostname
    srvdc02.berlanda.local

nano /etc/hosts
    127.0.0.1 localhost
    192.168.18.10 srvdc02.berlanda.local srvdc02

Sudo reboot

sudo apt-get install samba krb5-user krb5-config winbind smbclient

    Default Kerberos version 5 realm:


        BERLANDA.LOCAL
   
    Kerberos servers for your realm:
        srvdc02.berlanda.local

    ADMINISTRATIVE SERVER FOR YOUR KERBEROS REALM:


        srvdc02.berlanda.local

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.original

sudo samba-tool domain provision

Realm [BERLANDA.LOCAL]:
Domain [BERLANDA]:
Server Role (dc, member, standalone) [dc]:
DNS backend (SAMBA_INTERNAL, BIND9_FLATFILE, BIND9_DLZ, NONE)
[SAMBA_INTERNAL]:
DNS forwarder IP address (write 'none' to disable forwarding)
[127.0.0.53]: 8.8.8.8,8.8.4.4,192.168.18.10,192.168.18.1
Administrator password: Retype password:

sudo mv /etc/krb5.conf /etc/krb5.conf.initial


sudo ln -s /var/lib/samba/private/krb5.conf /etc/
sudo systemctl disable --now smbd nmbd winbind systemd-resolved
sudo systemctl unmask samba-ad-dc
sudo systemctl enable --now samba-ad-dc
sudo rm -f /etc/resolv.conf && sudo vim /etc/resolv.conf
    nameserver 192.168.18.10
domain berlanda.local
chattr +i /etc/resolv.conf
nano /etc/samba/smb.conf
ldap server require strong auth = no
reboot
kinit Administrator@BERLANDA.LOCAL
sudo samba-tool user create diogo.berlanda

<!-- INSTALAÇÃO GLPI 10.0.2 -->

sudo apt install -y apache2 libapache2-mod-php php-soap php-cas php php-


{apcu,cli,common,curl,gd,imap,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,
zip,bz2}
sudo apt-get install -y xz-utils bzip2 unzip curl
sudo systemctl enable apache2

<!-- REMOVER PACOTES NTP -->

apt purge ntp


 

<!-- INSTALAR OpenNTPD -->

apt install -y openntpd


service openntpd stop
dpkg-reconfigure tzdata
 
 
<!-- ADICIONANDO O SERVIDOR -->
echo "servers pool.ntp.br" > /etc/openntpd/ntpd.conf
systemctl enable openntpd
systemctl start openntpd

<!-- BAIXAR GLPI -->


wget -O-
https://github.com/glpi-project/glpi/releases/download/10.0.2/glpi-
10.0.2.tgz | tar -zxv -C /var/www/html/

<!-- CONFIGURANDO PERMISSÕES DO GLPI -->


chown www-data. /var/www/html/glpi -Rf
find /var/www/html/glpi -type d -exec chmod 755 {} \;
find /var/www/html/glpi -type f -exec chmod 644 {} \;

<!-- INSTALANDO O BANCO DE DADOS MYSQL -->


apt install -y mariadb-server

mysql_secure_installation

<!-- CRIAÇÃO DO BANCO E DO USUÁRIO -->

    mysql -u root -p
        create database glpidb character set utf8";
        create user 'glpi'@'localhost' identified by 'glpi2022';
        grant all privileges on glpidb.* to 'glpi'@'localhost' with grant
option;
        flush privileges;
        exit;
       
<!-- CRIAR AGENDADOS DE TAREFAS -->

echo -e "* *\t* * *\troot\tphp /var/www/html/glpi/front/cron.php" >>


/etc/crontab
service cron restart

systemctl restart apache2

<!—ÚLTIMO DO COMANDO DO GLPI 


rm -Rf /var/www/html/glpi/install/install.php

<! -- INSTALAÇÃO GRAFANA -- >

wget https://dl.grafana.com/oss/release/grafana_9.0.4_amd64.deb
dpkg -i grafana_9.0.4_amd64.deb
apt-get update
systemctl enable grafana-server
systemctl start grafana-server
http://192.168.18.10:3000

user:admin
password:admin

You might also like