Last active
September 29, 2025 15:22
-
-
Save roxsross/349c4d6e80ac3f6b63cebff757e9113e to your computer and use it in GitHub Desktop.
userdata amazon linux
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 | |
| # User Data para Amazon Linux 2023 | |
| sudo yum update -y | |
| # Instalar nginx y herramientas | |
| sudo yum install nginx unzip wget -y | |
| # Iniciar nginx | |
| sudo systemctl start nginx | |
| sudo systemctl enable nginx | |
| # Limpiar directorio web y preparar | |
| sudo rm -f /usr/share/nginx/html/index.html | |
| sudo rm -f /var/www/html/index.html | |
| cd /usr/share/nginx/html | |
| # Descargar template | |
| sudo wget https://github.com/startbootstrap/startbootstrap-freelancer/archive/gh-pages.zip | |
| # Extraer archivos | |
| sudo unzip gh-pages.zip | |
| # Mover contenido | |
| sudo cp -r startbootstrap-freelancer-gh-pages/* . | |
| # Limpiar | |
| sudo rm gh-pages.zip | |
| sudo rm -rf startbootstrap-freelancer-gh-pages | |
| # Reemplazar el título y cambia el nombre | |
| sudo sed -i 's/Start Bootstrap/MINOMBRE/g' /usr/share/nginx/html/index.html | |
| # Permisos | |
| sudo chown -R nginx:nginx /usr/share/nginx/html | |
| sudo chmod -R 755 /usr/share/nginx/html | |
| # Reiniciar nginx | |
| sudo systemctl restart nginx |
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 | |
| # User Data para Amazon Linux 2023 | |
| sudo yum update -y | |
| # Instalar nginx y herramientas | |
| sudo yum install nginx wget -y | |
| # Iniciar nginx | |
| sudo systemctl start nginx | |
| sudo systemctl enable nginx | |
| # Limpiar directorio web | |
| sudo rm -f /usr/share/nginx/html/index.html | |
| sudo rm -f /var/www/html/index.html | |
| # Descargar directamente tu index.html desde GitHub | |
| sudo wget -O /usr/share/nginx/html/index.html https://raw.githubusercontent.com/roxsross/challenge-cloud-practioner-web/master/porfolio/index.html | |
| # Permisos | |
| sudo chown -R nginx:nginx /usr/share/nginx/html | |
| sudo chmod -R 755 /usr/share/nginx/html | |
| # Reiniciar nginx | |
| sudo systemctl restart nginx |
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 | |
| # User Data para Amazon Linux 2023 | |
| sudo yum update -y | |
| # Instalar nginx y herramientas | |
| sudo yum install nginx unzip wget -y | |
| # Iniciar nginx | |
| sudo systemctl start nginx | |
| sudo systemctl enable nginx | |
| # Limpiar directorio web y preparar | |
| sudo rm -f /usr/share/nginx/html/index.html | |
| sudo rm -f /var/www/html/index.html | |
| cd /usr/share/nginx/html | |
| # Descargar template | |
| sudo wget https://github.com/startbootstrap/startbootstrap-stylish-portfolio/archive/gh-pages.zip | |
| # Extraer archivos | |
| sudo unzip gh-pages.zip | |
| # Mover contenido | |
| sudo cp -r startbootstrap-stylish-portfolio-gh-pages/* . | |
| # Limpiar | |
| sudo rm gh-pages.zip | |
| sudo rm -rf startbootstrap-stylish-portfolio-gh-pages | |
| # Reemplazar el título y agrega tu nombre | |
| sudo sed -i 's/Stylish Portfolio/MINOMBRE Portfolio/g' /usr/share/nginx/html/index.html | |
| # Permisos | |
| sudo chown -R nginx:nginx /usr/share/nginx/html | |
| sudo chmod -R 755 /usr/share/nginx/html | |
| # Reiniciar nginx | |
| sudo systemctl restart nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment