sudo ./letsencrypt-auto --apache -d gxo.jp

archive_dir = /etc/letsencrypt/archive/gxo.jp
cert = /etc/letsencrypt/live/gxo.jp/cert.pem
privkey = /etc/letsencrypt/live/gxo.jp/privkey.pem
chain = /etc/letsencrypt/live/gxo.jp/chain.pem
fullchain = /etc/letsencrypt/live/gxo.jp/fullchain.pem

0 1 1 */2 * cd /usr/local/letsencrypt && ./letsencrypt-auto certonly --apache --renew-by-default --apache -d gxo.jp >> /var/log/gxo.jp-renew.log 2>&1

vi /etc/letsencrypt/live/gxo.jp/fullchain.pem
vi /etc/letsencrypt/live/gxo.jp/privkey.pem
vi /etc/letsencrypt/options-ssl-apache.conf

https://www.tecmint.com/install-free-lets-encrypt-ssl-certificate-for-apache-on-debian-and-ubuntu/

---- start ----

sudo apt-get install apache2
sudo a2enmod ssl
sudo a2ensite default-ssl.conf
sudo service apache2 restart
or
sudo systemctl restart apache2.service

cd /usr/local
sudo git clone https://github.com/letsencrypt/letsencrypt

cd /usr/local/letsencrypt
sudo ./letsencrypt-auto --apache -d gxo.jp
or
sudo ./letsencrypt-auto --apache -d gxo.jp  -d www. gxo.jp 

sudo ls /etc/letsencrypt/live

Test: https://www.ssllabs.com/ssltest/analyze.html?d=gxo.jp&latest

Auto renew
sudo ./letsencrypt-auto --apache -d gxo.jp

or multiple subdomains:

sudo ./letsencrypt-auto --apache -d gxo.jp  -d www. gxo.jp

or auto with cron tab

sudo crontab -e
0 1 1 */2 * cd /usr/local/letsencrypt && ./letsencrypt-auto certonly --apache --renew-by-default --apache -d gxo.jp >> /var/log/gxo.jp-renew.log 2>&1

cat /etc/letsencrypt/renewal/gxo.jp.conf

ls /etc/apache2/sites-enabled/
sudo cat /etc/apache2/sites-enabled/000-default-le-ssl.conf


Content: 000-default-le-ssl.conf

<IfModule mod_ssl.c>
    <VirtualHost *:443>
        Servername gxo.jp
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/html/ootd/public

        <Directory /var/www/html/ootd/public>
            DirectoryIndex index.php
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        </Directory>
		
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        SSLEngine on
        SSLCertificateFile /etc/letsencrypt/live/gxo.jp/fullchain.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/gxo.jp/privkey.pem
        SSLCertificateKeyFile /etc/letsencrypt/live/gxo.jp/privkey.pem
        Include /etc/letsencrypt/options-ssl-apache.conf
    </VirtualHost>
</IfModule>


Content: gxo.jp.conf
<VirtualHost *:80>
    ServerName gxo.jp
    ServerAdmin admin@hunters.co.jp
    DocumentRoot /var/www/html/ootd/public

    <Directory /var/www/html/ootd/public>
        DirectoryIndex index.php
        Options Indexes FollowSymLinks MultiViews
        # changed from None to All
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
	
	RewriteEngine on
	RewriteCond %{SERVER_NAME} =gxo.jp
	RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
