Let’s get started with Let’s Encrypt

Let’s Encrypt

Finally it’s here: the chance for people to encrypt their websites free of charge. This can be done with Let’s Encrypt.

Clone the Let’s Encrypt tools

git clone https://github.com/letsencrypt/letsencrypt

Go in the directory

cd letsencrypt/

First time certificate generation

./letsencrypt-auto  certonly –server https://acme-v01.api.letsencrypt.org/directory -a webroot –webroot-path=/var/www/www.sysstem.at –agree-dev-preview -d www.sysstem.at

/var/www/www.sysstem.at is my webroot and -www.sysstem.at is my domain.

Make sure your Webserver ist running on port 80, because Let’s Encrypt places a verification file in your webroot and tries to download it.

Set up your Apache VirtualHost like this

#010-www.sysstem.at.conf
<VirtualHost *:443>
 ServerAdmin admin@sysstem.at
 ServerName www.sysstem.at
 DocumentRoot /var/www/www.sysstem.at


 ErrorLog ${APACHE_LOG_DIR}/www.sysstem.at_error.log
 CustomLog ${APACHE_LOG_DIR}/www.sysstem.at_access.log combined

 SSLEngine on

 SSLCertificateFile /etc/letsencrypt/live/www.sysstem.at/fullchain.pem
 SSLCertificateKeyFile /etc/letsencrypt/live/www.sysstem.at/privkey.pem
 SSLProtocol all -SSLv2 -SSLv3
 SSLHonorCipherOrder on
 SSLCipherSuite "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA"

 BrowserMatch "MSIE [2-6]" \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0
 BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

</VirtualHost>

enable the site with

a2ensite 010-www.sysstem.at.conf

You may wonder where I got this huge load of cypher suites in the Apache config. Depending on which kind of site you are hosting you can decide for weaker or stronger suites. I chose the Intermediate from the Mozilla Site.

And make sure, that you forward all http traffic to https. This is important, because the Let’s Encrypt client tries to get the verification file from http. With the redirect the client will be able to get the file with https enabled.

#000-catchall.conf 
<VirtualHost *:80>
 ServerAdmin admin@sysstem.at
 ServerName catchall
 ErrorLog ${APACHE_LOG_DIR}/catchall.log
 LogLevel warn
 CustomLog ${APACHE_LOG_DIR}/catchall_access.log combined
 RewriteEngine On
 # This will enable the Rewrite capabilities
 RewriteCond %{HTTPS} !=on
 # This checks to make sure the connection is not already HTTPS
 RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
</VirtualHost>

enable the site with

a2ensite 000-catchall.conf

We need to make sure to load every Apache module so that everything in our configuration will work.

Enable the SSL Module and the Rewrite Module with

a2enmod ssl
a2enmod rewrite

Restart the Apache Server

service apache2 restart

Let’s do a SSL-test on our site. SSL-Labs is my tool of choice for this job.

My site has a great score for now:

SSL Test for www.sysstem.at

Now we have a certificate which is not valid for a very long time. This is by intention by Let’s encrypt. The goal is that certificate renewals should be automated. For this I wrote a little script.

Place this script in /opt/letsencrypt as letsencrypt-renew.sh

This script makes sure that you get a new certificate for your website. It also has a check enabled for people with a dynamic IP. In case this script runs and your provider switches the IP before your dynamic DNS service (like dynDNS and noip) gets the information about it, it will end.

#!/bin/bash
export DOMAIN=www.sysstem.at
export DIR=/var/www/www.sysstem.at
export LETSENCRYPT=/opt/letsencrypt

#if Cert older than 30 days and if IP in DNS is current IP
find -L /etc/letsencrypt/live/$DOMAIN/fullchain.pem -mtime +30 | egrep '.*' \
&& if [ `dig +short $DOMAIN | head -1` == `curl canihazip.com/s` ];then
#then renew cert
 mkdir -p $DIR && cd $LETSENCRYPT && ./letsencrypt-auto --renew-by-default certonly --server https://acme-v01.api.letsencrypt.org/directory -a webroot --webroot-path=$DIR -d $DOMAIN
#reload apache with new Cert
 service apache2 reload
fi

Make changes to comply with your website and make the file executable with

chmod +x letsencrypt-renew.sh

Now we check every day if our certificate is up to date. For this open crontab with

crontab -e

and append the following line

0 1 * * * /opt/letsencrypt/letsencrypt-renew.sh

Now you are ready to host your own websites with HTTPS enabled, a valid certificate and good security.

5 thoughts on “Let’s get started with Let’s Encrypt”

  1. Все мы знаем, что казино – это отличный способ развлечься и испытать удачу. Однако, многие люди отказываются от посещения казино из-за необходимости внесения депозита. Но, с появлением бездепозитных бонусов в казино, эта проблема стала прошлым!
    Бездепозитные бонусы казино – это бесплатные деньги, которые вы получаете сразу после регистрации на сайте казино. Эти бонусы могут использоваться для игры в различные игры казино, такие как слоты, рулетка, блэкджек и другие. Они позволяют вам испытать удачу и получить вознаграждение без необходимости рисковать своими собственными деньгами.
    Казино всегда стремятся привлечь новых игроков, поэтому каждый год они предлагают новые бездепозитные бонусы. В 2023 году ожидается, что казино предложат еще более щедрые и интересные бонусы, чтобы привлечь еще больше игроков.
    Новые бездепозитные бонусы казино могут включать такие предложения, как бесплатные вращения на слотах, бесплатные фишки для игры в покер или блэкджек, а также дополнительные деньги на счет после регистрации. Такие бонусы позволят вам опробовать разные игры и выбрать ту, которая вам больше всего нравится, прежде чем вносить депозит.
    Однако, важно помнить, что бездепозитные бонусы обычно имеют определенные условия отыгрыша. Это значит, что вы должны будете сделать определенное количество ставок, прежде чем сможете вывести выигрыш. Поэтому перед выбором казино и бонуса внимательно ознакомьтесь с условиями и требованиями.
    В целом, бездепозитные бонусы казино 2023 года представляют отличную возможность испытать свою удачу без риска потерять собственные деньги. С такими бонусами вы можете наслаждаться азартными играми и получать удовольствие, не задумываясь о финансовых рисках. Не упустите шанс попробовать новые бездепозитные бонусы в казино 2023 года!

  2. The YouTube MP3 Converter is a user-friendly, quick, and
    confidential tool that allows you to transform
    and download YouTube videos as MP3 audio files without the
    demand for software application downloads. Our solution supports significant tools such as Android, iPhone, Windows, and also
    Mac, enabling you to download videos in the
    highest possible offered top quality. Simply paste the
    YouTube video URL right into the search box as well as click the “Convert” button.
    Within seconds, your MP3 documents will certainly await download.
    Create playlists of high-grade MP3 data and appreciate the
    songs from your favorite YouTube videos. Maintain audio high quality while removing 4K video clips.
    Our solution provides a secure and also practical
    choice for converting as well as downloading MP3s from YouTube as
    well as various other streaming platforms. Select numerous
    videos or video clips of differing lengths and also quickly download
    them to your desktop computer or mobile device
    without constraints or the requirement for enrollment.
    PLEASE NOTE: There is a limitation on downloading MP3
    data longer than 10 mins at once.

  3. Прогон сайта с помощью Хрумера может помочь улучшить позиции сайта в поисковых системах, повысить его трафик и увеличить количество потенциальных клиентов. Однако, не следует забывать, что использование Хрумера может повлечь за собой риск нарушения правил поисковых систем, таких как Google, что может привести к наказанию и снижению рейтинга сайта.
    поисковая система seo

  4. Hey to all our water relaxation addicts!

    There’s nothing quite like sinking into a warm hot tub after a long day. For anyone in search of the absolute tranquility experience, a hot tub is really unmatched.

    Assortment is indeed the essence of lives, and we wholeheartedly pride ourselves on offering a broad assortment of jacuzzis to suit every taste.

    Craftsmanship, to us, is beyond a simple word. It’s our hallmark. Every of our products go through rigorous testing to ensure they consistently provide the top leisure experience for several years to come.

    Our expert staff are always on hand to guide you in selecting the perfect jacuzzi for your needs and living space.

    Have you ever considered having your private enjoyment haven? Everything are your desires when it pertains to choosing the best jacuzzi? Let’s converse concerning it!

    Continue to be lively and comfy! That brings to mind, I set up my very own brand-new service url recently, one can check out here: Visiting the top-rated hot tub showrooms Fountain Hills AZ

Leave a Reply

Your email address will not be published. Required fields are marked *