LAMP

De Wiki Projeto Root
Revisão de 14h24min de 1 de outubro de 2020 por Diegocosta (discussão | contribs) (→‎Sobre)
(dif) ← Edição anterior | Revisão atual (dif) | Versão posterior → (dif)
Ir para navegação Ir para pesquisar

Sobre

Olá! Visitante, reunimos aqui, informações sobre a Instalação de um servidor LAMP (Linux Apache Mysql PHP,Perl), este servidor por natureza precisa ter alguns requisitos básicos de conjuntos de softwares instalados, como servidor web Apache, ou seja,um software capaz de armazenar páginas estáticas ou dinâmicas, assim como módulos para suportar as linguagens de programação HTML, PHP, PERL entre outras e naturalmente um banco de dados para armazenar informações de acesso, cadastro de usuários, produtos e etc no site que será armazenado neste servidor, caso o servidor não tenha nele o banco de dados, ainda é possivel utilizar este mesmo para se conectar em um host que tenha o serviço de banco de dados (denominado: end point, através da chamada de sistema mysql connector ou semelhante em caso de outro SGBD.

Sites Oficiais:

https://www.kernel.org/

https://httpd.apache.org/

https://mariadb.org/

https://www.php.net/

https://www.perl.org/

https://www.postgresql.org/

Vídeo

https://youtu.be/Lv_bDnjdJ3Q

Preparação dos Sistemas

  • Ubuntu/Debian
 apt-get update && apt-get upgrade && apt-get dist-upgrade && apt-get autoremove && apt-get autoclean && apt-get clean
  • CentOS/RHEL
 yum update && yum clean all

Ubuntu 20.04 - Server

      • Server WEB(APACHE) Light
 apt-get install apache2 php7.4 libapache2-mod-php7.4
 
 systemctl enable apache2.service
 systemctl start apache2.service
      • Server WEB(APACHE) Full
  apt-get install ca-certificates apache2 bzip2 curl php7.4-json php7.4-bz2 libapache2-mod-php7.4 libmariadbd-dev php-soap php-cas php7.4 php-apcu php7.4-cli php7.4-common php7.4-curl php7.4-gd php7.4-imap php7.4-ldap php7.4-mysql php7.4-snmp php7.4-xmlrpc php7.4-xml php7.4-mbstring php7.4-bcmath php7.4-zip php7.4-intl php7.4-bz2 php-pear php-imagick php-memcache php7.4-pspell php7.4-tidy php7.4-xsl
 
 systemctl enabled apache2.service
 systemctl start apache2.service

Install mysql-server (MariaDB)

 apt-get install mysql-server

Install Postgresql

 apt-get install postgresql postgresql-contrib

Verificação dos Serviços:

 root@ubuntu-server:~# netstat -pultan 
 Active Internet connections (servers and established)
 Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
 tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      619/systemd-resolve 
 tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      777/sshd: /usr/sbin 
 tcp        0      0 127.0.0.1:5432          0.0.0.0:*               LISTEN      25441/postgres      
 tcp        0      0 192.168.201.157:22      192.168.201.156:47116   ESTABLISHED 853/sshd: diegocost 
 tcp        0      0 192.168.201.157:54284   200.236.31.4:80         TIME_WAIT   -                   
 tcp6       0      0 :::80                   :::*                    LISTEN      17660/apache2       
 tcp6       0      0 :::22                   :::*                    LISTEN      777/sshd: /usr/sbin 
 tcp6       0      0 :::33060                :::*                    LISTEN      23304/mysqld        
 tcp6       0      0 :::3306                 :::*                    LISTEN      23304/mysqld        
 udp        0      0 127.0.0.53:53           0.0.0.0:*                           619/systemd-resolve 
 udp        0      0 192.168.201.157:68      0.0.0.0:*                           617/systemd-network 
 udp        0      0 127.0.0.1:56767         127.0.0.1:56767         ESTABLISHED 25441/postgres      
 root@ubuntu-server:~# 


Debian 10 - Server

      • Server WEB(APACHE) Light
 apt-get install apache2 php7.3 libapache2-mod-php7.3
      • Server WEB(APACHE) Full
  apt-get install ca-certificates apache2 bsdtar bzip2 curl php7.3-json php7.3-bz2 libapache2-mod-php7.3 libmariadbd-dev php-soap php-cas php7.3 php-apcu php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-imap php7.3-ldap php7.3-mysql php7.3-snmp php7.3-xmlrpc php7.3-xml php7.3-mbstring php7.3-bcmath php7.3-zip php7.3-intl php7.3-bz2 php-pear php-imagick php-memcache php7.3-pspell php7.3-recode php7.3-tidy php7.3-xsl php-gettext 


Install mysql-server (MariaDB)

 apt-get install mariadb-server

Install Postgresql

 apt-get install postgresql postgresql-contrib


Verificação dos Serviços:

 root@debian:/home/diegocosta# netstat -pultan
 Conexões Internet Ativas (servidores e estabelecidas)
 Proto Recv-Q Send-Q Endereço Local          Endereço Remoto         Estado      PID/Program name    
 tcp        0      0 0.0.0.0:22              0.0.0.0:*               OUÇA       413/sshd            
 tcp        0      0 127.0.0.1:5432          0.0.0.0:*               OUÇA       12385/postgres      
 tcp        0      0 127.0.0.1:3306          0.0.0.0:*               OUÇA       16134/mysqld        
 tcp        0     36 192.168.201.132:22      192.168.201.156:51610   ESTABELECIDA 575/sshd: diegocost 
 tcp6       0      0 :::22                   :::*                    OUÇA       413/sshd            
 tcp6       0      0 ::1:5432                :::*                    OUÇA       12385/postgres      
 tcp6       0      0 :::80                   :::*                    OUÇA       18927/apache2       
 udp        0      0 0.0.0.0:68              0.0.0.0:*                           368/dhclient        
 udp6       0      0 ::1:18862               ::1:18862               ESTABELECIDA 12385/postgres      


CentOS

 yum install -y wget php-ldap php php-gd php-pear php-pecl-zendopcache php-mbstring php-mysqli php-cli php-json php-mbstring php-pdo php-pecl-zip php-curl php-xmlrpc php-apcu php-pecl-zendopcache httpd httpd-devel gcc 

Ajustes no sistema

  • Permitir no firewall o acesso as portas 80 e 443
 firewall-cmd --permanent --add-service=http
 firewall-cmd --permanent --add-service=https
 firewall-cmd --reload
 
  • Caso queira desativar o Firewall
 systemctl stop firewall-cmd
  • Habilitar no sistema e iniciar o serviço
 systemctl enable httpd
 systemctl start httpd


Install mysql-server (MariaDB)

 yum install mysql-server
  • Habilitando e inicializando o serviço
 systemctl enable mysqld
 systemctl start mysqld

Install Postgresql

 yum install postgresql-server
  • Criando um banco de dados inicial (Vazio)
 postgresql-setup initdb
  • Habilitando e inicializando o serviço
 systemctl enable postgresql
 systemctl start postgresql

Verificação dos Serviços:

 [root@centos diegocosta]# netstat -pultan
 Conexões Internet Ativas (servidores e estabelecidas)
 Proto Recv-Q Send-Q Endereço Local          Endereço Remoto         Estado      PID/Program name     
 tcp        0      0 127.0.0.1:5432          0.0.0.0:*               OUÇA       30167/postmaster    
 tcp        0      0 0.0.0.0:5355            0.0.0.0:*               OUÇA       1124/systemd-resolv 
 tcp        0      0 0.0.0.0:22              0.0.0.0:*               OUÇA       905/sshd            
 tcp        0      0 192.168.201.230:22      192.168.201.156:39622   ESTABELECIDA 1477/sshd: diegocos 
 tcp6       0      0 ::1:5432                :::*                    OUÇA       30167/postmaster    
 tcp6       0      0 :::33060                :::*                    OUÇA       30711/mysqld        
 tcp6       0      0 :::3306                 :::*                    OUÇA       30711/mysqld        
 tcp6       0      0 :::5355                 :::*                    OUÇA       1124/systemd-resolv 
 tcp6       0      0 :::80                   :::*                    OUÇA       30224/httpd         
 tcp6       0      0 :::22                   :::*                    OUÇA       905/sshd            
 udp        0      0 127.0.0.53:53           0.0.0.0:*                           1124/systemd-resolv 
 udp        0      0 192.168.201.230:68      192.168.201.1:67        ESTABELECIDA 889/NetworkManager  
 udp        0      0 0.0.0.0:5355            0.0.0.0:*                           1124/systemd-resolv 
 udp6       0      0 ::1:42562               ::1:42562               ESTABELECIDA 30167/postmaster    
 udp6       0      0 :::5355                 :::*                                1124/systemd-resolv


phpMyAdmin

Para instalação do software phpMyAdmin, veja este link, onde documentamos o processo de instalação nas três distribuições listadas nesta documentação (Ubuntu Server 20.04, Debian 10 e CentOS 8).

https://wiki.projetoroot.com.br/index.php?title=PhpMyAdmin