Tips : Activar SSL en Apache2
Este tip es para crear un certificado de seguridad en nuestro Apache y hacer pruebas de conexiones SSL, en este caso en Ubuntu 10.10.
Previamente tenemos que tener instalado el servidor Apache, de no tenerlo, entonces instalarlo con :
sudo aptitude install apache2
# Habilitamos el módulo SSL
sudo a2enmod ssl
# Habilitamos la configuración SSL por default
sudo a2ensite default-ssl
# Reiniciamos el servidor
sudo /etc/init.d/apache2 restart
Ya con esto queda habilitado, puedes probarlo entrando al localhost con https://127.0.0.1   ó  https://localhost
Ahora para crear nuestro certificado, debemos seguir los siguientes pasos
# Creamos las llaves
cd /etc/apache2
sudo openssl genrsa -des3 -out server.key 1024
# Creamos el certificado con la llave
sudo openssl req -new -key server.key -out server.csr
# Creamos nuestro certificado, contestando las preguntas que nos indique recordando la contraseña
sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
#Cambiamos de carpeta la llave y certificado
sudo cp server.crt /etc/ssl/certs/
sudo cp server.key /etc/ssl/private/
# Abrimos el archivo de configuracion default-ssl
cd /etc/apache2/sites-available
sudo nano default-ssl
# copiamos  y habilitamos la siguientes lineas despues de la linea donde dice  # SSLCertificateFile directive is needed.
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
# habilitamos el archivo
sudo a2ensite default-ssl
# Reiniciamos apache y listo!!
sudo /etc/init.d/apache2 restart
Espero que te haya sido de utilidad.
- Posts Relacionados





Tweets that mention Tips : Activar SSL en Apache2 | Cmt Blog -- Topsy.com says:
febrero 3rd, 2011 at 4:51
[...] This post was mentioned on Twitter by Planeta Linux and T, MARTIN CALDERON. MARTIN CALDERON said: RT @planetalinux: Christian Medina Torres: Tips : Activar SSL en Apache2 http://bit.ly/gSdYNg | Perú [...]
Emmly says:
mayo 2nd, 2011 at 7:07
Tahkns for sharing. Always good to find a real expert.
iwnfko says:
mayo 4th, 2011 at 0:53
V3h6KS bxgygwjkzmkf
edgar says:
junio 16th, 2011 at 10:42
sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
despues de agregar esta linea me manda un error
server.csr: No such file or directory
espero me puedas ayudar...Â
gracias