Quantcast
Channel: Ezequiel M. Cardinali - Fedora
Viewing all articles
Browse latest Browse all 20

Let's Encrypt en un servidor compartido (Shared Hosting).

$
0
0

En el post anterior describí los pasos para tener un sitio configurado con certificados SSL gratuitos y de una forma sencilla con Let's encrypt para un sitio en donde tengamos acceso SSH directo al servidor donde se encuentra alojado nuestro sitio. Pero también es posible generar los certificados y utilizarlos en un servidor de hosting compartido. Para esto debemos instalar y ejecutar letsencript en nuestra PC, generar los certificados localmente y luego subirlos al servidor. Para realizar esto, ejecutamos letsencrypt con los siguientes parámetros:

# letsencrypt certonly --manual
El comando anterior nos advertirá que va a guardar nuestra ip en un log, debemos aceptar esto para poder continuar. Con la opción certonly le decimos que genere los certificados pero que no los configure. Debido a que no tenemos control sobre el servidor web compartido donde tenemos nuestro sitio, debemos especificar la opción --manual. Let's Encrypt necesita comprobar que tenemos control sobre el dominio donde queremos instalar el certificado, para esto, el comando anterior nos pedirá que creemos un archivo dentro de nuestro servidor web para poder comprobar que está bajo nuestro control:
Make sure your web server displays the following content at
http://dominio.com/.well-known/acme-challenge/9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw before continuing:

9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw.27-pmYYeQbUx9GznEFReUM5jjRWFlJkHXwr7B5AMSmQ

If you don't have HTTP server configured, you can run the following
command on the target server (as root):

mkdir -p /tmp/letsencrypt/public_html/.well-known/acme-challenge
cd /tmp/letsencrypt/public_html
printf "%s" 9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw.27-pmYYeQbUx9GznEFReUM5jjRWFlJkHXwr7B5AMSmQ > .well-known/acme-challenge/9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw
# run only once per server:
$(command -v python2 || command -v python2.7 || command -v python2.6) -c \
"import BaseHTTPServer, SimpleHTTPServer; \
s = BaseHTTPServer.HTTPServer(('', 80), SimpleHTTPServer.SimpleHTTPRequestHandler); \
s.serve_forever()" 
Press ENTER to continue
Este archivo podemos generarlo en nuestra PC y luego subirlo a nuestro servidor antes de darle ENTER al mensaje anterior. Para esto promero creamos el archivo:
$ echo "9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw.27-pmYYeQbUx9GznEFReUM5jjRWFlJkHXwr7B5AMSmQ > 9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw"
Y ahora lo subimos a nuestro espacio de hosting por FTP:
$ ftp dominio.com
Connected to dominio.com.
220 ProFTPD (ProFTPD Server) [1.2.3.4]
Name (dominio:ezq): USUARIO
331 Password required for b1000370
Password: CONTRASEÑA
230 User b1000370 logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>
Ponemos el nombre de usuario ftp de nuestro sitio y a continuación la contraseña. Creamos el directorio en donde hay que poner el archivo:
ftp> mkdir .well-known/
257 "/.well-known" - Directory successfully created
ftp> mkdir .well-known/acme-challenge
257 "/.well-known/acme-challenge" - Directory successfully created
Cambiamos de directorio al recién creado y subimos el archivo:
ftp> cd .well-known/acme-challenge
250 CWD command successful
ftp> put 9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw.27-pmYYeQbUx9GznEFReUM5jjRWFlJkHXwr7B5AMSmQ
local: 9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw.27-pmYYeQbUx9GznEFReUM5jjRWFlJkHXwr7B5AMSmQ remote: 9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw.27-pmYYeQbUx9GznEFReUM5jjRWFlJkHXwr7B5AMSmQ
227 Entering Passive Mode (1,2,3,4,195,102).
150 Opening BINARY mode data connection for 9fjf9LLOuEjSThn0Vi-3gPAp_dNLZU6afGn-uPfRlHw.27-pmYYeQbUx9GznEFReUM5jjRWFlJkHXwr7B5AMSmQ
226 Transfer complete
5 bytes sent in 4,6e-05 secs (108,70 Kbytes/sec)
Ahora podemos darle ENTER a letsencrypt para que continúe con la comprobación y genere el certificado. Si todo sale bien deberías ver algo como esto:
IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at
   /etc/letsencrypt/live/dominio.com/fullchain.pem. Your cert will
   expire on 2016-03-13. To obtain a new version of the certificate in
   the future, simply run Let's Encrypt again.
 - If like Let's Encrypt, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
Ahora sólo resta configurar el servidor web, esto dependerá del servicio de hosting que tengamos. Los certificados los podemos encontrar en /etc/letsencrypt/live/dominio.com/

Etiquetas: Fedora, letsencrypt, SSL, HTTPS, Hosting

Commentarios?  


Viewing all articles
Browse latest Browse all 20

Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.2 by Vimeo.com, Inc.

Vimeo 10.6.2 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.





Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.