HowTo: Instalar apache2 con SSL en Debian 5.0 Lenny

#apt-get install apache2 Instalar openssl ssl-cert #apt-get install openssl ssl-cert Generando un certificado. #openssl req $@ -newkey rsa:4096 -new -x509 -days 3650 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem Los siguientes comandos se ejecutan para cambiar los permisos del certificado. #chmod 600 /etc/apache2/apache.pem Hay q cambiar y/o añadir en el archivo /etc/apache2/ports.conf el puerto 443 Listen 443 [...]

#apt-get install apache2

Instalar openssl ssl-cert

#apt-get install openssl ssl-cert

Generando un certificado.

#openssl req $@ -newkey rsa:4096 -new -x509 -days 3650 -nodes -out /etc/apache2/apache.pem -keyout /etc/apache2/apache.pem

Los siguientes comandos se ejecutan para cambiar los permisos del certificado.

#chmod 600 /etc/apache2/apache.pem

Hay q cambiar y/o añadir en el archivo /etc/apache2/ports.conf el puerto 443

Listen 443

Habilitar el soporte SSL

#a2enmod ssl
Module ssl installed; run
#/etc/init.d/apache2 force-reload

Reiniciamos apache2 con el siguiente comando.

#/etc/init.d/apache2 restart

Configuramos el Certificado ssl para los Virtual host en apache2

primero se necesitan cambiar las siguientes lineas en /etc/apache2/sites-available/default

NameVirtualHost *:443
 
        ServerAdmin admin@midominio.com
        DocumentRoot /var/www/
        ServerName midominio.com
        SSLEngine on
                  SSLCertificateKeyFile SSLCertificateFile /etc/apache2/apache.pem
                  SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
 
                Options FollowSymLinks
                AllowOverride None
 
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # RedirectMatch ^/$ /mail/
 
       ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 
                AllowOverride None
                Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
 
        ErrorLog /var/log/apache2/error.log
 
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
 
        CustomLog /var/log/apache2/access.log combined
        ServerSignature On
 
    Alias /doc/ "/usr/share/doc/"
 
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
 
NameVirtualHost *:80
 
        ServerAdmin admin@midominio.com
        DocumentRoot /var/www/
        RewriteEngine On
        RewriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]
 
            Options FollowSymLinks
            AllowOverride None
 
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
            # This directive allows us to have apache2's default start page
            # in /apache2-default/, but still have / go to the right place
            RedirectMatch ^/$ https://localhost/
 
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 
            AllowOverride None
            Options ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
 
        ErrorLog /var/log/apache2/error.log
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
        ServerSignature On
        Alias /doc/ "/usr/share/doc/"
 
             Options Indexes MultiViews FollowSymLinks
             AllowOverride None
             Order deny,allow
             Deny from all
             Allow from 127.0.0.0/255.0.0.0 ::1/128

Una vez cambiadas las lineas se procede a recargar el archivo de configuración de apache con el siguiente comando.

# /etc/init.d/apache2 reload

Entradas Relacionadas

Related posts:

  1. HowTo: Instalar Openfire 3.6.3 & Spark 2.5.8 & SparkWeb 0.9.0 en Debian 5.0 Lenny Para poder aplicar este tutorial se necesita tener instalado Debian...
  2. Instalar Openfire 3.6.3 & Spark 2.5.8 & SparkWeb 0.9.0 en Debian 5.0 Lenny Para poder aplicar este tutorial se necesita tener instalado Debian...
  3. HowTo: VirtualBox con soporte para USB en Ubuntu 9.04 Jaunty Antes de empezar debemos de tener instalado VirtualBox en Ubuntu...
  4. HowTo: Entidad certificadora personal con OpenSSL Si necesitan crear una entidad certificadora personal pueden consultar marblestation....
  5. HowTo: Crear un live-usb de Ubuntu desde Ubuntu Actualmente tengo instalado Ubuntu 8.10 Intrepid Ibex pero voy a...

Related posts brought to you by Yet Another Related Posts Plugin.

Related Posts