Last active
May 24, 2025 16:24
-
-
Save nukhes/9bee57acba6335b7bb2180ea817f5943 to your computer and use it in GitHub Desktop.
Script para instalar a stack LAMP num Ubuntu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| echo "ESTE SCRIPT IRÁ INSTALAR O LAMP STACK NESTA MÁQUINA." | |
| echo "Atualizando pacotes..." | |
| sudo apt update -y && sudo apt upgrade -y | |
| echo "Instalando Apache, MySQL, PHP e dependências..." | |
| sudo apt install -y apache2 mysql-server php libapache2-mod-php php-mysql ufw | |
| echo "Configurando firewall (UFW)..." | |
| sudo ufw disable | |
| echo "Habilitando e iniciando serviços Apache e MySQL..." | |
| sudo systemctl enable apache2 | |
| sudo systemctl start apache2 | |
| sudo systemctl enable mysql | |
| sudo systemctl start mysql | |
| echo "Iniciando configuração segura do MySQL..." | |
| sudo mysql_secure_installation | |
| echo "Instalação do LAMP concluída com sucesso!" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Para rodar o script em uma instalação existente de Ubuntu ou derivados cole em seu terminal: