Try   HackMD

CREAR SERVIDOR APACHE EN UN SERVIDOR DE AWS

tags: Apache2,AWS

Primer añdim una nou lloc en la web cloudflare.com

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Introduim la URL del nostre domini

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Seguidament indiquem le seguents dades:

​​​​- A EL_NOSTRE_DOMINI IP_DEL_SERVIDOR
​​​​- CNAME www EL_NOSTRE_DOMINI

El CNAME actuará com un alias, en el meu cas la IP del servidor es una utilitzada anteriorment (després la canvio)

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

A continuació ens donará dos noms de domini que haurem de introduir en l'apartat Usar nameserver en el domini adquirit en la web freenom.com

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Introduim els noms proporcionats abans a freenom.com

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

A continuació tornem a clowdfare.com y li donem al aquest botó

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Acabem la configuració de Clowdfare

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

La seguent part de la practica és realitzará en una máquina virtual al núvol amb els serveis de AWS

Per continuar anirem a la página de AWS i crearem un nou Sandbox

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Iniciem un LAB per crear una instancia

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Seleccionem la opció EC2

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Llancem la instancia per configurar la màquina virtual

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Seguir els seguents passos correctament o no funcionará correctament

Creem una clau amb les seguents caracteristiques amb el nom que tu vulguis:

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Seleccionem el sistema operatiu que volem per al nostre servidor, en el nostre cas Ubuntu

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Permitim que es connecti per https y per http

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

A continuació llançem la màquina

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Aquí podem veure les nostres instancies, en el nostre cas la instancia creada server web 2

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Com podem veure la nostre IP és 3.95.37.226

A CONTINUACIÓ CANVIEM LA IP QUE HAVIEM ASIGNAT ABANS A clowdfare.com

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

El seguents passos és realitzen amb un certificat generat abans amb el nom de "yeray.pem"

Obrim una terminal, en el meu cas d'Ubuntu i entrem a la carpeta on tenim el nostre certificat i introduim les seguents comandes

Aquesta comanda treura permisos per tal de que estigui més segura

​​​​- sudo chmod 400 arxiu.pem

Comanda per asegurarse de que esta en la carpeta

​​​​- sudo ls |grep arxiu.pem

Comanda per connectarnos per ssh al servidor

​​​​ - ssh -i arxiu.pem ubuntu@IP_SERVIDOR

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

A continuació instalem el apache

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Una vegada instalar podrem veure ja la pantalla predeterminada de apache2

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

A continuació protegirem la nostre pàgina amb un certificat.

Per instalarlo farem el seguent

sudo snap install certbot classic

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

A continuació haurem de introduir la seguent commanda i indicar els parámtetres d'abaix per generar el certificats

sudo certbot run apache

  • adreça de correu
  • les dos opcions li indiquem y (yes)
  • després indiquem el nostre domini, en el meu cas yreyesjda2022.cf

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

I ja tindriem la nostre pàgina amb certificat !!

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →