Skip to main content

Configurar Apache + SSL + certificados autofirmados (en Linux/Ubuntu)



Hola mundo,

0. Recordemos que al crear un certificado necesitaremos rellenar estos datos:
Country Name (2 letter code) [AU]:  
State or Province Name (full name) [Some-State]:  
Locality Name (eg, city) []:  
Organization Name (eg, company) [Internet Widgits Pty Ltd]:  
Organizational Unit Name (eg, section) []:  
Common Name (eg, YOUR name) []:  
Email Address []:  
Please enter the following 'extra' attributes  to be sent with your certificate request  

A challenge password []:  
An optional company name []:  

1. Lo primero sera crear una Autoridad Certificadora autofirmada:
openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 7300 -key ca.key -out ca.crt

2. Seguir pasos para instalar SSL y Apache:
http://betatwits.wordpress.com/2010/07/21/activar-ssl-en-apache2-ubuntu-10-04/

3. Seguir pasos para instalar SSH:
http://www.cyberciti.biz/faq/ubuntu-linux-openssh-server-installation-and-configuration/

4. Generar un CSR:
http://www.mrvoip.com.au/blog/automatically-generate-ssl-certificate-parameters

5. Generar CRT:
http://cryptophp.wikidot.com/ejemplo-openssl-csr-sign

6. Habilitar paginas .php (instalar php) en UbuntuServer:
$ sudo /etc/init.d/apache2 stop
$ sudo apt-get install libapache2-mod-php5
$ sudo /etc/init.d/apache2 start

Extra: Administracion general de un servidor Linux core:
http://www.forat.info/2008/08/12/servidor-en-linux-ubuntu-server-manual-completo/

Comandos de todos los dias:

Ver certificado:
openssl x509- noout -text -in ca.crt | less

Editar certificados en apache2:
sudo nano /etc/apache2/sites-available/default-ssl

Mandar carpeta desde host al host virtual
scp -r <carpeta origen> autocert@<ip>:<carpeta destino>

Configurar default-ssl para que se necesite un certificado para un carpeta:
http://www.modssl.org/docs/2.8/ssl_howto.html

Si se quiere descargar o subir archivos, probablemente se necesite instalar en el servidor:
apt-get install php5-mcrypt

Comments

Popular posts from this blog

Configurar pantalla de inicio de sesión Ubuntu

Configurar pantalla de inicio de sesión Si quieres personalizar el inicio de sesión (pantalla de logeo), puedes instalar un programa llamado Ubuntu Tweak muy intuitivo y que te permite modificar el fondo de la pantalla de logeo entre otras cosas, primero vamos a instalar Ubuntu Tweak: sudo add-apt-repository ppa:tualatrix/ppa  sudo apt-get update  sudo apt-get install ubuntu-tweak  Una vez instalado, al entrar en System Settings deberia aparecerte el icono de Ubuntu Tweak: Luego de darle click a Ubuntu Tweak, dale click a la pestaña de "Tweaks" y a Login Settings: Para modificar la pantalla de Login se requiere permisos de superuser, dale a la opcion de "Unlock" para que puedas realizar cambios: Le das click a la imagen para cambiar el background y al Gtk theme, por ejemplo; mi resultado fue: Espero haber sido de ayuda. Fue hecho en: Ubuntu 12.04

Crear un .doc desde página php en 5 minutos gratis

Primero descargar esta libreria gratuita: http://phpword.codeplex.com/ Mi ejemplo al final de la página ya la contiene. Descomprimirla donde quieran, lo importante es saber donde quedó el archivo PHPWord.php para después incluirlo en nuestro código con: require_once 'PHPWord.php'; Iniciando el código es:     // Para declarar un nuevo documento     $PHPWord = new PHPWord();     // Para crear seccion para escribir en ella     $section = $PHPWord->createSection(); Luego podemos crear formatos para los textos que introduciremos: // Formatos para los textos       $PHPWord->addFontStyle('rStyle', array('bold'=>true, 'italic'=>false, 'size'=>16));     $PHPWord->addParagraphStyle('pStyle', array('align'=>'both', 'spaceAfter'=>100));     $PHPWord->addFontStyle('estiloTexto', array('bold'=>false, 'italic'=>false, 'size'=>12));  ...

Solving Groovy compiler in GGTS (Groovy: compiler mismatch)

Hello world, So I was trying to run a Grails 2.3.5 project in my recently installed GGTS 3.4, and I was getting the next error: Description    Resource    Path    Location    Type Groovy: compiler mismatch Project level is: 2.1 Workspace level is 2.0 Groovy compiler level expected by the project does not match workspace compiler level. I couldn't find the Groovy Compiler 2.1 and didn't know how to install it. Here is how you do it: " ...To install the Groovy 2.1 compiler in GGTS, first click on the Dashboard tab. If it is not visible, goto Help -> Dashboard. at the bottom left of the window, click Extensions. Scroll down the list and check Groovy 2.1 Compiler for Groovy-Eclipse. Then click Install on the lower right of the window. Follow the defaults to install, and it will configure itself. I have found it cumbersome to get existing projects to fully correct themselves, so I usually just delete the project an...