Diferencia entre revisiones de «Edición de «Apache Proxy Pass Reverse HTTP HTTPS»»

De Base de conocimiento
Ir a la navegación Ir a la búsqueda
(Página creada con «Este articulo ejemplifica la configuración de Apache para hacer Proxy Pass Reverse HTTP HTTPS Habilitaremos el modulo ssl del apache sudo a2enmod ssl sudo service ap...»)
 
Línea 56: Línea 56:
     </VirtualHost>
     </VirtualHost>
  </IfModule>
  </IfModule>
Crear un crt y key desde un archivo.pfx
  openssl pkcs12 -in archivo.pfx -nokeys -out archivo.crt
  openssl pkcs12 -in archivo.pfx -nocerts -out archivo.pem -nodes

Revisión del 12:08 9 ago 2019

Este articulo ejemplifica la configuración de Apache para hacer Proxy Pass Reverse HTTP HTTPS

Habilitaremos el modulo ssl del apache

sudo a2enmod ssl
sudo service apache2 restart

Creamos loa certificados autofirmados

sudo mkdir /etc/apache2/ssl
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
  Country Name (2 letter code) [AU]:US
  State or Province Name (full name) [Some-State]:New York 
  Locality Name (eg, city) []:New York City
  Organization Name (eg, company) [Internet Widgits Pty Ltd]:Your Company
  Organizational Unit Name (eg, section) []:Department of Kittens
  Common Name (e.g. server FQDN or YOUR name) []:your_domain.com
  Email Address []:your_email@domain.com

Luego configuramos el apache para trabajar con ssl HTTPS a HTTPS

sudo nano /etc/apache2/sites-available/default-ssl.conf
<IfModule mod_ssl.c>
   <VirtualHost _default_:443>
       ServerAdmin pruebacne
       ProxyPreserveHost On # HTTP
       SSLProxyEngine on # HTTPS 
       ProxyPass               /       https://....../
       ProxyPassReverse        /       https://....../
       DocumentRoot /var/www
       <Directory />
               Options FollowSymLinks
               AllowOverride None
               Order Deny,Allow
               Deny from all
       </Directory>
       ErrorLog ${APACHE_LOG_DIR}/error.log
       CustomLog ${APACHE_LOG_DIR}/access.log combined
       SSLEngine on
       SSLCertificateFile /etc/apache2/ssl/pruebacne.crt
       SSLCertificateKeyFile /etc/apache2/ssl/pruebacne.key
       <FilesMatch "\.(cgi|shtml|phtml|php)$">
                       SSLOptions +StdEnvVars
       </FilesMatch>
       <Directory /usr/lib/cgi-bin>
                       SSLOptions +StdEnvVars
       </Directory>
       BrowserMatch "MSIE [2-6]" \
                       nokeepalive ssl-unclean-shutdown \
                       downgrade-1.0 force-response-1.0
       BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
   </VirtualHost>
</IfModule>

Crear un crt y key desde un archivo.pfx

  openssl pkcs12 -in archivo.pfx -nokeys -out archivo.crt
  openssl pkcs12 -in archivo.pfx -nocerts -out archivo.pem -nodes