Skip to content

Instantly share code, notes, and snippets.

@nukhes
Last active May 24, 2025 16:24
Show Gist options
  • Select an option

  • Save nukhes/9bee57acba6335b7bb2180ea817f5943 to your computer and use it in GitHub Desktop.

Select an option

Save nukhes/9bee57acba6335b7bb2180ea817f5943 to your computer and use it in GitHub Desktop.
Script para instalar a stack LAMP num Ubuntu
#!/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!"
@nukhes
Copy link
Author

nukhes commented May 24, 2025

Para rodar o script em uma instalação existente de Ubuntu ou derivados cole em seu terminal:

curl -s https://gist.githubusercontent.com/nukhes/9bee57acba6335b7bb2180ea817f5943/raw/2ac8aec9f8448748a04be3908565ba9d6b7a06d9/lamp.sh | sudo bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment