apache https://keopx.net/ es Instalar certificados SSL en Debian 9 con certbot (Let's Encrypt - Free SSL/TLS Certificates) https://keopx.net/blog/instalar-certificados-ssl-en-debian-9-con-certbot-lets-encrypt-free-ssltls-certificates <span>Instalar certificados SSL en Debian 9 con certbot (Let&#039;s Encrypt - Free SSL/TLS Certificates)</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Hace tiempo escribit un articulo sobre <a href="https://www.keopx.net/blog/instalar-certificados-de-lets-encrypt-free-ssltls-certificates-en-debian-ubuntu">Instalar certificados de Let's Encrypt - Free SSL/TLS Certificates en Debian / Ubuntu</a></p> <p>Este post es una revisión de que escribí.</p> <h1>Instalación</h1> <pre> <code class="language-bash"># apt-get install certbot</code></pre><h2>Configurar Apache</h2> <pre> <code class="language-bash"># nano /etc/apache2/sites-available/www.keopx.net-ssl.conf</code></pre><p>Y añadimos el <strong>-ssl</strong> por la existencia de un <strong><a href="https://github.com/certbot/certbot/issues/1042">bug</a></strong> en el <strong>certbot</strong>, que solo es capaz de distinguir un <strong>virtualhost</strong> por fichero <strong>*.conf</strong></p> <pre> <code class="language-bash">&lt;VirtualHost *:443&gt; ServerAdmin keopx@keopx.net ServerName www.keopx.net DocumentRoot /var/www/keopx.net/web &lt;Directory /var/www/keopx.net/web/&gt; Options FollowSymLinks AllowOverride All Require all granted &lt;/Directory&gt; 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 SSLCertificateFile /etc/letsencrypt/live/www.keopx.net/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.keopx.net/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf &lt;/VirtualHost&gt; </code></pre><h2>Creamos el SSL</h2> <pre> <code class="language-bash">certbot --apache -d www.keopx.net</code></pre><h2>Actualizamos los certificados</h2> <pre> <code class="language-bash">certbot renew --dry-run</code></pre><p>Referencias</p> <ul><li><a href="https://certbot.eff.org/docs/using.html#apache">https://certbot.eff.org/docs/using.html#apache</a></li> <li><a href="https://certbot.eff.org/docs/using.html?highlight=renew#renewing-certificates">https://certbot.eff.org/docs/using.html?highlight=renew#renewing-certif…</a></li> <li>Bug: <a href="https://github.com/certbot/certbot/issues/1042">https://github.com/certbot/certbot/issues/1042</a></li> </ul></div> <span><span>keopx</span></span> <span><time datetime="2017-09-02T12:34:20+02:00" title="Sábado, Septiembre 2, 2017 - 12:34">Sáb, 02/09/2017 - 12:34</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/letsencrypt" hreflang="es">letsencrypt</a></div> <div class="field__item"><a href="/categoria/seguridad" hreflang="es">Seguridad</a></div> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/debian-9" hreflang="es">Debian 9</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/debian-9" hreflang="es">Debian 9</a></div> <div class="field__item"><a href="/tag/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/tag/certbot" hreflang="es">certbot</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=292&amp;2=field_comments&amp;3=comment" token="e2q1tlu9gNjnsY9-OEPJORmF6R9X08tqdM22YQUr6Hk"></drupal-render-placeholder> </div> </div> </section> Sat, 02 Sep 2017 10:34:20 +0000 keopx 292 at https://keopx.net https://keopx.net/blog/instalar-certificados-ssl-en-debian-9-con-certbot-lets-encrypt-free-ssltls-certificates#comments Instalar certificados de Let's Encrypt - Free SSL/TLS Certificates en Debian / Ubuntu https://keopx.net/blog/instalar-certificados-de-lets-encrypt-free-ssltls-certificates-en-debian-ubuntu <span>Instalar certificados de Let&#039;s Encrypt - Free SSL/TLS Certificates en Debian / Ubuntu</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Activamos ssl para apache:</p> <pre> <code class="language-bash">a2enmod ssl</code></pre><p>Añadimos a nuestro site la configuración correcta:</p> <pre> <code class="language-apache">... &lt;VirtualHost *:443&gt; ServerAdmin keopx@keopx.net ServerName www.keopx.net DocumentRoot /var/www/keopx.net/docroot &lt;Directory /var/www/keopx.net/docroot/&gt; # Options FollowSymLinks Options SymLinksIfOwnerMatch AllowOverride All Require all granted &lt;/Directory&gt; 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 SSLCertificateFile /etc/letsencrypt/live/www.keopx.net/fullchain.pem SSLCertificateKeyFile /etc/letsencrypt/live/www.keopx.net/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf &lt;/VirtualHost&gt; &lt;VirtualHost *:80&gt; ServerName keopx.net Redirect 301 / http://www.keopx.net/ &lt;/VirtualHost&gt; ....</code></pre><p>Procedemos a instalar <strong>letsencrypt:</strong></p> <pre> <code class="language-bash">cd /opt git clone https://github.com/certbot/certbot.git letsencrypt</code></pre><p>Configuramos <strong>letsencrypt</strong>:</p> <pre> <code class="language-bash">nano /etc/letsencrypt/keopx.ini</code></pre><pre> <code class="language-ini">authenticator = webroot webroot-path = /var/www/keopx.net/docroot renew-by-default agree-dev-preview agree-tos email = keopx@keopx.net</code></pre><p>Procedemos a crear el certificado (duran 3 meses):</p> <pre> <code class="language-bash">/opt/letsencrypt/certbot-auto --config /etc/letsencrypt/keopx.ini --user-agent letsencrypt-ubuntu-webroo -d www.keopx.net certonly</code></pre><p>Ahora es necesario reiniciar apache:</p> <pre> <code class="language-bash">service apache2 reload</code></pre><h2>Automatizar renovaciones automáticas:</h2> <p>crontab -e</p> <pre> <code class="language-bash">6 0 1 * * /opt/letsencrypt/certbot-auto --config /etc/letsencrypt/phpmyadmin.isarea.ini --user-agent letsencrypt-ubuntu-webroot -d phpmyadmin.isarea.com certonly &amp;&amp; service apache2 reload</code></pre><p> </p> </div> <span><span>keopx</span></span> <span><time datetime="2016-12-09T19:41:34+01:00" title="Viernes, Diciembre 9, 2016 - 19:41">Vie, 09/12/2016 - 19:41</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/letsencrypt" hreflang="es">letsencrypt</a></div> <div class="field__item"><a href="/categoria/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/ssl" hreflang="es">SSL</a></div> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios<span class="comments__count">1</span></h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=268&amp;2=field_comments&amp;3=comment" token="ViRdZ4E193bGeokwU7Vx3JhRTMv5dcCOesVVnXH3wco"></drupal-render-placeholder> </div> </div> <article data-comment-user-id="0" id="comment-2406" class="comment js-comment comment--level-1 by-anonymous" role="article" data-drupal-selector="comment"> <span class="hidden" data-comment-timestamp="1481529425"></span> <div class="comment__picture-wrapper"> <div class="comment__picture"> <div> </div> </div> </div> <div class="comment__text-wrapper"> <footer class="comment__meta"> <p class="comment__author"><a rel="nofollow" href="http://example.com">Anonymous (no verificado)</a></p> <p class="comment__time">hace 7 años 10 meses</p> </footer> <div class="comment__content"> <h3><a href="/comment/2406#comment-2406" class="permalink" rel="bookmark" hreflang="es">Muy bueno</a></h3> <div class="text-content field field--name-comment-body field--type-text-long field--label-hidden field__item comment__text-content"><p>Gracias tenía agendado hacer esto en mi web y todavía no lo había buscado. A los favoritos!</p> </div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=2406&amp;1=default&amp;2=es&amp;3=" token="XKZRmaQE02eOBhDwVf2FSfXRCPk_vEfNYu7q-LsQSy4"></drupal-render-placeholder> </div> </div> </article> </section> Fri, 09 Dec 2016 18:41:34 +0000 keopx 268 at https://keopx.net Instalar extensión PECL uploadprogress https://keopx.net/blog/instalar-extension-pecl-uploadprogress <span>Instalar extensión PECL uploadprogress</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="clearfix text-formatted field field--name-body field--type-text-with-summary field--label-hidden field__item quickedit-field" data-quickedit-field-id="node/169/body/es/full"> <p>Para ver la barra de progreso de subida de ficheros es necesario instalar una extensión para PHP.</p> <p>Descargar <a href="http://pecl.php.net/package/uploadprogress">PECL uploadprogress extensión</a></p> <p>Extraer el fichero <em>uploadprogress-1.x.x.tgz</em>:</p> <pre> <code class="language-bash">$ tar xvzf uploadprogress-1.x.x.tgz</code></pre><p>Instalamos php5-dev para poder utilziar <em>phpize</em></p> <pre> <code class="language-bash">sudo aptitude install php5-dev</code></pre><p>Y ejecutamos:</p> <pre> <code class="language-bash">$ phpize $ ./configure $ make $ sudo make install</code></pre><p>Comprobamos que el directorio de la extensión es correcta. La ultima linea de la salida del comando <em>$ make install</em> es:</p> <pre> <code class="language-bash">Installing shared extensions: /usr/lib/php/extensions/no-debug-non-zts-20060613/</code></pre><p>Abrir el fichero <em>php.ini</em> y añadir la extensión.</p> <p>Reemplazar la ruta <em>extension_dir</em> con el path anterior.</p> <p>Añadir la extension</p> <pre> <code class="language-bash">extension=uploadprogress.so</code></pre><p>Reiniciar apache.</p> <p><em>You should now have the PECL uploadprogress extension installed.</em></p> </div> </div> <span><span>keopx</span></span> <span><time datetime="2010-03-09T11:06:39+01:00" title="Martes, Marzo 9, 2010 - 11:06">Mar, 09/03/2010 - 11:06</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/php" hreflang="es">PHP</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/php" hreflang="es">php</a></div> <div class="field__item"><a href="/tag/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=169&amp;2=field_comments&amp;3=comment" token="fHjsYCZcA_Hk_oJYjM4jijoC_DVyijV2W1hODOnaVUo"></drupal-render-placeholder> </div> </div> </section> Tue, 09 Mar 2010 10:06:39 +0000 keopx 169 at https://keopx.net https://keopx.net/blog/instalar-extension-pecl-uploadprogress#comments Redireccionar a otra url o de http a https https://keopx.net/blog/redireccionar-otra-url-o-de-http-https <span>Redireccionar a otra url o de http a https</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>En mi caso ha sido necesario redireccionar una web desde http (80) a https (443). Se puede utilizar también para redireccionar de una url a otra. Deberemos configurar esta linea en nuestro VirtualHost:</p> <pre> <code class="language-apache">#Redireccionar a otra url RedirectMatch (.*) https://www.site.com$1</code></pre><p> </p> </div> <span><span>keopx</span></span> <span><time datetime="2009-11-08T13:43:18+01:00" title="Domingo, Noviembre 8, 2009 - 13:43">Dom, 08/11/2009 - 13:43</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/categoria/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/categoria/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> <div class="field__item"><a href="/tag/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=140&amp;2=field_comments&amp;3=comment" token="RoQGFXBScHOog5-H5TQnwnIXKvs7qUokd5b6a_JmdG8"></drupal-render-placeholder> </div> </div> </section> Sun, 08 Nov 2009 12:43:18 +0000 keopx 140 at https://keopx.net https://keopx.net/blog/redireccionar-otra-url-o-de-http-https#comments Redireccionar url sin www a www.mysite.com https://keopx.net/blog/redireccionar-url-sin-www-wwwmysitecom <span>Redireccionar url sin www a www.mysite.com</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Mas de una vez por motivos de desarrollo hemos necesitado que nuestra web tenga las www delante de la dirección. En nuestro VirtualHost deberemos configurar lo siguiente, eso si teniendo en cuenta que es necesario tener instalado mod_rewrite</p> <pre lang="bash" line="1" xml:lang="bash"> RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.mysite\.com$ [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]</pre></div> <span><span>keopx</span></span> <span><time datetime="2009-11-07T13:43:09+01:00" title="Sábado, Noviembre 7, 2009 - 13:43">Sáb, 07/11/2009 - 13:43</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/sistemas" hreflang="es">Sistemas</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/sistemas" hreflang="es">Sistemas</a></div> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/virtualhost" hreflang="es">virtualhost</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=138&amp;2=field_comments&amp;3=comment" token="IzVhDKeV2StimdfYSXyqTUum4vGlMa1Ven9EuYWaqwI"></drupal-render-placeholder> </div> </div> </section> Sat, 07 Nov 2009 12:43:09 +0000 keopx 138 at https://keopx.net https://keopx.net/blog/redireccionar-url-sin-www-wwwmysitecom#comments Generar nuestro propio certificado SSL https://keopx.net/blog/generar-nuestro-propio-certificado-ssl <span>Generar nuestro propio certificado SSL</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Para generar un certificado valido (ejemplo web):</p> <pre line="1" lang="bash" xml:lang="bash">openssl req -nodes -new -keyout web.key -out web.csr</pre><!--break--><pre line="1" lang="bash" xml:lang="bash">keopx@prueba:/etc/apache2$ openssl req -nodes -new -keyout web.key -out web.csr Generating a 1024 bit RSA private key ...............................................++++++ ........................................................++++++ writing new private key to 'web.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:ES State or Province Name (full name) [Some-State]:Provincia Locality Name (eg, city) []:Localidad Organization Name (eg, company) [Internet Widgits Pty Ltd]:nombre_empresa Organizational Unit Name (eg, section) []:Sistemas Common Name (eg, YOUR name) []:www.web.com Email Address []:tu_usuario@web.com ----- Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: </pre><p><em>** Recordar que password y company name se han dejar en blanco.</em></p> <h3>Clave Privada</h3> <pre line="1" lang="bash" xml:lang="bash">cat web.key</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN RSA PRIVATE KEY----- MIICWwIBAAKBgQDa3jXaOMmjiNchcTNPIB56R8N2V+5HUosWcDh8xxHYP5K6XQ52 k+MvtIVg4K89/OhziyhaipgCkenEMmIrtoTT9fTGiQv0X93KjJwH/lvVUKdzBlVB hDWr405CCReeCEmA8vrUy7MTn718E7lKbqtyyJaW+YbimP0HogbK87gVAQIDAQAB AoGAU46aCKG9eU14tC+/YunkONLE8J1JPrlomDxnlFt7mI9MuRFlwCddiIzmjsG4 pXW0WMg7s7VNq02BbYG+sOmRc5VoBzj8G38yB8SpDj6QZgItkkYJMc9zKtMBf6IO nhY+FgRSUGvBWhLxn2oS3CC/oX9DwvdWvg8cHcD1G575oQECQQD5r4uWJqbR8UDw sQY4pyda6/qmLyWvMglok4vqcnXkjWOdngTL0woRstRHO5guY2eg7TSEX6wPtlQv BSkPsEcpAkEA4GcnDDyOEBkTtgVqjMozj5+DJLpZTFkbw/xfZj6saF45jHJ/EK2Y oi5R5UUHywb8uApHC6qIx/RYs9jH88ZSGQJAMZDpsusFXtP3wlBCHekA5QnHfkoJ vxe9ymbP9cC3KqHuzpFZ/mRssUrA3Us1ULAnGEk+jbC4ZX4ahCMQHa8u0QJAU9I0 I7360siLNFKRmkVtPRi4Q9/Xu00NsgdzGx4OCG4p0OxzyicN/IaQ0LMYVh4mCBjO sOzias460/MFvWk3AQJAfHsGbeltCyEhXkDxCKVQFmRVtsEZJARb+97u7rlqiIhS QVNUNqy7T6LXByoTOwbcG595k+6aqGjAq8oeyj96Yw== -----END RSA PRIVATE KEY-----</pre><h3>Certificado de envío</h3> <p>En caso de tener que enviar a una entidad certificadora (ej.: Verisign) les mandaremos este fichero:</p> <pre line="1" lang="bash" xml:lang="bash">cat web.csr</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN CERTIFICATE REQUEST----- MIIB3jCCAUcCAQAwgZ0xCzAJBgNVBAYTAkVTMRAwDgYDVQQIEwdCaXprYWlhMQ8w DQYDVQQHEwZCaWxiYW8xGTAXBgNVBAoTEEJpbGJvbWF0aWNhIFMuQS4xETAPBgNV BAsTCFNpc3RlbWFzMRQwEgYDVQQDEwt3d3cubWluZC5lczEnMCUGCSqGSIb3DQEJ ARYYcmVnaWd1cmVuQGJpbGJvbWF0aWNhLmVzMIGfMA0GCSqGSIb3DQEBAQUAA4GN ADCBiQKBgQDa3jXaOMmjiNchcTNPIB56R8N2V+5HUosWcDh8xxHYP5K6XQ52k+Mv tIVg4K89/OhziyhaipgCkenEMmIrtoTT9fTGiQv0X93KjJwH/lvVUKdzBlVBhDWr 405CCReeCEmA8vrUy7MTn718E7lKbqtyyJaW+YbimP0HogbK87gVAQIDAQABoAAw DQYJKoZIhvcNAQEFBQADgYEAOQTnrUZ9VMyrHC+Tf2DC0pn6z1YSOpMjn5y7anvE CAdzL7C6CqLr21LNDmiSEov4Pq4oeyqPOYsbMsevp0x7JmvWwiQXkQnfJqR8zr5H E+pBSHHp1+Ydwx9T8/MAr3LtQhub7EkKpgEkpfmou43AwkMtshstB/c7JzZ0CQL/ Lu4= -----END CERTIFICATE REQUEST-----</pre><h3>Entidad certificadora</h3> <p>En caso de tener una central certificadora como puede ser Verisign, a la central certificadora le enviamos el web.csr para que no devuelva en fichero en texto plano web.crt (certificado).</p> <pre line="1" lang="bash" xml:lang="bash">cat web.crt</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN CERTIFICATE----- MIIE9jCCBF+gAwIBAgIQPQS2i9mi7QtNotD8uahBDTANBgkqhkiG9w0BAQUFADCB ujEfMB0GA1UEChMWVmVyaVNpZ24gVHJ1c3QgTmV0d29yazEXMBUGA1UECxMOVmVy aVNpZ24sIEluYy4xMzAxBgNVBAsTKlZlcmlTaWduIEludGVybmF0aW9uYWwgU2Vy dmVyIENBIC0gQ2xhc3MgMzFJMEcGA1UECxNAd3d3LnZlcmlzaWduLmNvbS9DUFMg SW5jb3JwLmJ5IFJlZi4gTElBQklMSVRZIExURC4oYyk5NyBWZXJpU2lnbjAeFw0w NzA2MDQwMDAwMDBaFw0wODA2MDQyMzU5NTlaMIIBBjELMAkGA1UEBhMCRVMxDzAN BgNVBAgTBk1hZHJpZDEPMA0GA1UEBxQGTWFkcmlkMSUwIwYDVQQKFBxIaWdoIFRl Y2ggSG90ZWxzIEFORCBSZXNvcnRzMREwDwYDVQQLFAhTaXN0ZW1hczEyMDAGA1UE CxMpVGVybXMgb2YgdXNlIGF0IHd3dy52ZXJpc2lnbi5lcy9ycGEgKGMpMDUxIjAg BgNVBAsTGUF1dGhlbnRpY2F0ZWQgYnkgVmVyaVNpZ24xJzAlBgNVBAsTHk1lbWJl ciwgVmVyaVNpZ24gVHJ1c3QgTmV0d29yazEaMBgGA1UEAxQRd3d3Lmh0aG90ZWxl cy5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAL6R3vYaeb2r70/m3ffP YZnyBmRoEfZXWQtICQRd6EqIGbtIu9Ftflcw5e+5KKgHqTp7d5VX07mTN9aV2rEs bgBaSKEH9NpeaMaUGxLdI/A9oO7RWPs+gC4YIozfo6Zp4R7H7A8YohtDdzDVigCj 1xgu7NqpvXk2rIRPoB1f69gvAgMBAAGjggGsMIIBqDAJBgNVHRMEAjAAMAsGA1Ud DwQEAwIFoDBDBgNVHSAEPDA6MDgGC2CGSAGG+EUBBxcDMCkwJwYIKwYBBQUHAgEW G2h0dHBzOi8vd3d3LnZlcmlzaWduLmVzL3JwYTA8BgNVHR8ENTAzMDGgL6Athito dHRwOi8vU1ZSSW50bC1jcmwudmVyaXNpZ24uY29tL1NWUkludGwuY3JsMCgGA1Ud JQQhMB8GCCsGAQUFBwMBBggrBgEFBQcDAgYJYIZIAYb4QgQBMHEGCCsGAQUFBwEB BGUwYzAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AudmVyaXNpZ24uY29tMDsGCCsG AQUFBzAChi9odHRwOi8vU1ZSSW50bC1haWEudmVyaXNpZ24uY29tL1NWUkludGwt YWlhLmNlcjBuBggrBgEFBQcBDARiMGChXqBcMFowWDBWFglpbWFnZS9naWYwITAf MAcGBSsOAwIaBBRLa7kolgYMu9BSOJsprEsHiyEFGDAmFiRodHRwOi8vbG9nby52 ZXJpc2lnbi5jb20vdnNsb2dvMS5naWYwDQYJKoZIhvcNAQEFBQADgYEAB3n9wQMS erbvDAUyFyPqqGOVeSATrXcNU2IMcmZobWhi284wwT96eS5K2H0r3eGGGUOsfgyh gsJIw2Hj90l1eQwnNg0L0XZQU2tLy/x6+ZYuIX4yJq9De2p9SK9BOZuXHcjFYOA/ CaQ3KkqTjeX7ozOn9BLqvFxtuwzxt8qNOPA= -----END CERTIFICATE-----</pre><h3>Auto certificarse</h3> <p>En este caso no tener una entidad certificadora (la mayoría de casos), nos auto certificaremos.</p> <pre line="1" lang="bash" xml:lang="bash">openssl x509 -in web.csr -out web.crt -req -signkey web.key -days 365</pre><pre line="1" lang="bash" xml:lang="bash">keopx@prueba:/etc/apache2$ openssl x509 -in web.csr -out web.crt -req -signkey web.key -days 365 Signature ok subject=/C=ES/ST=Provincia/L=Localidad/O=nombre_empresa./OU=Sistemas/CN=www.web.com/emailAddress=tu_usuario@web.com Getting Private key </pre><pre line="1" lang="bash" xml:lang="bash">cat web.crt</pre><pre line="1" lang="bash" xml:lang="bash">-----BEGIN CERTIFICATE----- MIICszCCAhwCCQCGFBuLiz/tCjANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMC RVMxEDAOBgNVBAgTB0JpemthaWExDzANBgNVBAcTBkJpbGJhbzEZMBcGA1UEChMQ QmlsYm9tYXRpY2EgUy5BLjERMA8GA1UECxMIU2lzdGVtYXMxFDASBgNVBAMTC3d3 dy5taW5kLmVzMScwJQYJKoZIhvcNAQkBFhhyZWdpZ3VyZW5AYmlsYm9tYXRpY2Eu ZXMwHhcNMDkwOTE2MDk1NjU4WhcNMTAwOTE2MDk1NjU4WjCBnTELMAkGA1UEBhMC RVMxEDAOBgNVBAgTB0JpemthaWExDzANBgNVBAcTBkJpbGJhbzEZMBcGA1UEChMQ QmlsYm9tYXRpY2EgUy5BLjERMA8GA1UECxMIU2lzdGVtYXMxFDASBgNVBAMTC3d3 dy5taW5kLmVzMScwJQYJKoZIhvcNAQkBFhhyZWdpZ3VyZW5AYmlsYm9tYXRpY2Eu ZXMwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANreNdo4yaOI1yFxM08gHnpH w3ZX7kdSixZwOHzHEdg/krpdDnaT4y+0hWDgrz386HOLKFqKmAKR6cQyYiu2hNP1 9MaJC/Rf3cqMnAf+W9VQp3MGVUGENavjTkIJF54ISYDy+tTLsxOfvXwTuUpuq3LI lpb5huKY/QeiBsrzuBUBAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEAHgPnvRvflNon f+ZxPi+G/foTrrhFgsKZbxza7if1lZgNzBarC+p4wISjxqMfjz5xbuMV6c4dKWv1 KvqsXTbUtqVV4ATsNWHCYCxS9j+rBI0n9ADJTLF4Y2B7cUwdEL1xLDjgbSh5nlNG ylI6XAuDZGQyqRJZlEPFyGBb0Cq6bdg= -----END CERTIFICATE-----</pre><h3>Instalar certificado en el servidor</h3> <p>Copias los ficheros web.crt y web.key a la ruta correspondiente:</p> <pre line="1" lang="bash" xml:lang="bash">sudo mv web.crt /etc/ssl/certs/web.crt sudo mv web.key /etc/ssl/private/web.key</pre><p>Esto dependerá del tipo servidor, una vez instalado procedemos a reiniciar. Se reinicia el servidor y están operativas. <em>** Las rutas y forma de instalar dependerán del tipo del server. </em></p> <h3>Otras opciones</h3> <p>Vamos a ver otras posibilidades Ver datos de un certificado:</p> <pre line="1" lang="bash" xml:lang="bash">openssl req -in web.csr -noout -text</pre><p>Certificado con RSA de 2048 bits</p> <pre line="1" lang="bash" xml:lang="bash">openssl req -nodes -new -keyout web.key -out web.csr -newkey rsa:2048</pre></div> <span><span>keopx</span></span> <span><time datetime="2009-10-23T18:58:31+02:00" title="Viernes, Octubre 23, 2009 - 18:58">Vie, 23/10/2009 - 18:58</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/consola" hreflang="es">consola</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/seguridad" hreflang="es">seguridad</a></div> <div class="field__item"><a href="/tag/terminal" hreflang="es">Terminal</a></div> <div class="field__item"><a href="/tag/ubuntu" hreflang="es">Ubuntu</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=137&amp;2=field_comments&amp;3=comment" token="uVXLDbljN_nJV8oqK3Zyx-W6WnpdvnuqRgDxTXyHI-E"></drupal-render-placeholder> </div> </div> </section> Fri, 23 Oct 2009 16:58:31 +0000 keopx 137 at https://keopx.net Redireccionar de http a https en Apache https://keopx.net/blog/redireccionar-de-http-https-en-apache <span>Redireccionar de http a https en Apache</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Añadiendo esta simple linea en nuestro virtual host nos enviara de una petición http a https convierten así la conexión en segura.</p> <pre> <code class="language-apache"> RedirectMatch (.*) https://www.nuestra-direccion.com$1 </code></pre><p> </p> </div> <span><span>keopx</span></span> <span><time datetime="2009-09-27T18:11:47+02:00" title="Domingo, Septiembre 27, 2009 - 18:11">Dom, 27/09/2009 - 18:11</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/server" hreflang="es">server</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=134&amp;2=field_comments&amp;3=comment" token="b_4UnoJMpnoqlJqn_69o3DMFSok3XznLRyVn7imp_Og"></drupal-render-placeholder> </div> </div> </section> Sun, 27 Sep 2009 16:11:47 +0000 keopx 134 at https://keopx.net https://keopx.net/blog/redireccionar-de-http-https-en-apache#comments [warn] NameVirtualHost *:80 has no VirtualHosts en Apache https://keopx.net/blog/warn-namevirtualhost-80-has-no-virtualhosts-en-apache <span>[warn] NameVirtualHost *:80 has no VirtualHosts en Apache</span> <div class="text-content clearfix field field--name-body field--type-text-with-summary field--label-hidden field__item"><p>Bueno tenemos varias opciones para solucionar este problema.</p> <p>El primero consiste en comentar en <em>/etc/apache2/ports.conf</em> la siguiente linea <em>#NameVirtualHost *:80</em> y definir en nuestro <em>/etc/apache2/sites-available/default</em> la parte de <em>NameVirtualHost *:80</em>.</p> <p>Yo he optado por otra opcion que considero mas aceptable. No tocar el fichero<em>/etc/apache2/ports.conf</em> y no definir en el fichero <em>/etc/apache2/sites-available/default</em> la parte <em>#NameVirtualHost *:80</em></p> <p>Sin tocar nada solo editar <em>/etc/apache2/sites-available/default</em> así:</p> <pre> <code class="language-apache">ServerName 127.0.0.1 &lt;VirtualHost *:80&gt; ServerAdmin webmaster@localhost DocumentRoot /var/www/ &lt;Directory /&gt; Options FollowSymLinks AllowOverride None &lt;/Directory&gt; &lt;Directory /var/www/vacio/&gt; Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all &lt;/Directory&gt; ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ &lt;Directory "/usr/lib/cgi-bin"&gt; AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all &lt;/Directory&gt; 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 Alias /doc/ "/usr/share/doc/" &lt;Directory "/usr/share/doc/"&gt; Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 &lt;/Directory&gt; &lt;/VirtualHost&gt;</code></pre></div> <span><span>keopx</span></span> <span><time datetime="2009-07-05T10:06:45+02:00" title="Domingo, Julio 5, 2009 - 10:06">Dom, 05/07/2009 - 10:06</time> </span> <div class="field field--name-field-tax-cat field--type-entity-reference field--label-above"> <div class="field__label">Categoria</div> <div class="field__items"> <div class="field__item"><a href="/categoria/apache2" hreflang="es">Apache2</a></div> <div class="field__item"><a href="/categoria/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/categoria/debian" hreflang="es">Debian</a></div> </div> </div> <div class="field field--name-field-tax-tag field--type-entity-reference field--label-above"> <div class="field__label">Tag</div> <div class="field__items"> <div class="field__item"><a href="/tag/debian" hreflang="es">Debian</a></div> <div class="field__item"><a href="/tag/debian-8" hreflang="es">Debian 8</a></div> <div class="field__item"><a href="/tag/gnu-linux" hreflang="es">GNU Linux</a></div> <div class="field__item"><a href="/tag/apache" hreflang="es">apache</a></div> </div> </div> <section data-drupal-selector="comments" class="comments"> <h2 class="comments__title">Comentarios</h2> <div class="add-comment"> <div class="add-comment__form"> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=107&amp;2=field_comments&amp;3=comment" token="9Kb5vqNNhaW-OJDS-Id3PFdZa7m9nTStT_lRCLNS5Sk"></drupal-render-placeholder> </div> </div> </section> Sun, 05 Jul 2009 08:06:45 +0000 keopx 107 at https://keopx.net https://keopx.net/blog/warn-namevirtualhost-80-has-no-virtualhosts-en-apache#comments