How to force Apache 2.4 (httpd) to read fullchain.pem? certbot seems to work but I have an https:// issue X86_64 GNU/Linux (Linux 2 AMI)

Thx griffin for your welcome!

content of httpd.conf:

ServerRoot "/etc/httpd"

<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule .* https://%{HTTP_Host}%{REQUEST_URI} [L,R=permanent]
<Directory "var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>
</VirtualHost>

Include conf.modules.d/*.conf

User apache
Group apache

ServerAdmin root@localhost

<Directory />
    AllowOverride none
    Require all denied
</Directory>

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

<Directory "/var/www/html">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

<Files ".ht*">
    Require all denied
</Files>

ErrorLog "logs/error_log"

LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common

<IfModule logio_module>
 # You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" co$
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>

<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>

<IfModule mime_module>
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>

AddDefaultCharset UTF-8

<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>

EnableSendfile on

<IfModule mod_http2.c>
Protocols h2 h2c http/1.1
</IfModule>

IncludeOptional conf.d/*.conf

Include /etc/httpd/conf/httpd-le-ssl.conf

Content of httpd-le-ssl.conf:

<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAlias *
DocumentRoot "var/www/html"
RewriteEngine On
<Directory "var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/onearth.studio/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/onearth.studio/privkey.pem
</VirtualHost>
</IfModule>

I ran this command:
sudo apachectl -S

It produced this output:

AH00112: Warning: DocumentRoot [/etc/httpd/var/www/html] does not exist
VirtualHost configuration:
*:80                   ip-17.-..-..-..3.us-east-2.compute.internal (/etc/httpd/conf/http
d.conf:59)
*:443                  is a NameVirtualHost
         default server ip-17.-..-..-..3.us-east-2.compute.internal (/etc/httpd/conf.d/s
sl.conf:56)
         port 443 namevhost ip-17.-..-..-..3.us-east-2.compute.internal (/etc/httpd/conf
.d/ssl.conf:56)
         port 443 namevhost ip-17.-..-..-..3.us-east-2.compute.internal (/etc/httpd/conf
/httpd-le-ssl.conf:2)
                 wild alias *
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/etc/httpd/htdocs"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex mpm-accept: using_defaults
Mutex cache-socache: using_defaults
Mutex authdigest-opaque: using_defaults
Mutex watchdog-callback: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex authdigest-client: using_defaults
Mutex lua-ivm-shm: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default 
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache" id=48
Group: name="apache" id=48

I ran this command:
sudo ls -lRa /etc/httpd/conf

I produced this output:

/etc/httpd/conf:
total 76

drwxr-xr-x 2 root root   135 May  1 14:02 .
drwxr-xr-x 5 root root   105 May  1 14:02 ..
-rwxr-xr-x 1 root root 13218 May  1 17:39 httpd.conf
-rwxr-xr-x 1 root root 12059 Apr  5 15:04 httpd.conf.save
-rwxr-xr-x 1 root root 12231 Apr  9 09:32 httpd.conf.save.1
-rwxr-xr-x 1 root root 12357 Apr  9 11:16 httpd.conf.save.2
-rw-r--r-- 1 root root   786 Apr 30 21:01 httpd-le-ssl.conf
-rw-r--r-- 1 root root 13064 Aug 24  2020 magic

I ran this command:
sudo ls -lRa /etc/letsencrypt

It produced this output:

/etc/letsencrypt:
total 20
drwxr-xr-x  9 root root  190 May  1 17:14 .
drwxr-xr-x 87 root root 8192 Apr 25 17:26 ..
drwx------  4 root root   86 Apr 25 19:31 accounts
drwx------  3 root root   28 Apr 25 19:28 archive
drwxr-xr-x  2 root root  286 Apr 25 19:28 csr
drwx------  2 root root  286 Apr 25 19:28 keys
drwx------  3 root root   42 Apr 25 19:28 live
-rw-r--r--  1 root root  924 Apr 25 17:26 options-ssl-apache.conf
drwxr-xr-x  2 root root   33 Apr 25 19:28 renewal
drwxr-xr-x  5 root root   43 Apr 25 17:26 renewal-hooks
-rw-r--r--  1 root root   64 Apr 25 17:26 .updated-options-ssl-apache-conf-digest.txt

/etc/letsencrypt/accounts:
total 0
drwx------ 4 root root  86 Apr 25 19:31 .
drwxr-xr-x 9 root root 190 May  1 17:14 ..
drwx------ 3 root root  23 Apr 25 19:31 acme-staging-v02.api.letsencrypt.org
drwx------ 3 root root  23 Apr 25 17:26 acme-v02.api.letsencrypt.org

/etc/letsencrypt/accounts/acme-staging-v02.api.letsencrypt.org:
total 0
drwx------ 3 root root 23 Apr 25 19:31 .
drwx------ 4 root root 86 Apr 25 19:31 ..
drwx------ 3 root root 46 Apr 25 19:31 directory

/etc/letsencrypt/accounts/acme-staging-v02.api.letsencrypt.org/directory:
total 0
drwx------ 3 root root 46 Apr 25 19:31 .
drwx------ 3 root root 23 Apr 25 19:31 ..
drwx------ 2 root root 64 Apr 25 19:31 3d104ec8b6970a7532a098ae0583a631

/etc/letsencrypt/accounts/acme-staging-v02.api.letsencrypt.org/directory/3d104ec8b6970a7
532a098ae0583a631:
total 12
drwx------ 2 root root   64 Apr 25 19:31 .
drwx------ 3 root root   46 Apr 25 19:31 ..
-rw-r--r-- 1 root root  103 Apr 25 19:31 meta.json
-r-------- 1 root root 1632 Apr 25 19:31 private_key.json
-rw-r--r-- 1 root root   86 Apr 25 19:31 regr.json

/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org:
total 0
drwx------ 3 root root 23 Apr 25 17:26 .
drwx------ 4 root root 86 Apr 25 19:31 ..
drwx------ 3 root root 46 Apr 25 17:26 directory

/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory:
total 0
drwx------ 3 root root 46 Apr 25 17:26 .
drwx------ 3 root root 23 Apr 25 17:26 ..
drwx------ 2 root root 64 Apr 25 17:26 66b7d472dc4d75d3b8ec7111b38fa804

/etc/letsencrypt/accounts/acme-v02.api.letsencrypt.org/directory/66b7d472dc4d75d3b8ec711
1b38fa804:
total 12
drwx------ 2 root root   64 Apr 25 17:26 .
drwx------ 3 root root   46 Apr 25 17:26 ..
-rw-r--r-- 1 root root  103 Apr 25 19:28 meta.json
-r-------- 1 root root 1632 Apr 25 17:26 private_key.json
-rw-r--r-- 1 root root   79 Apr 25 17:26 regr.json

/etc/letsencrypt/archive:
total 0
drwx------ 3 root root  28 Apr 25 19:28 .
drwxr-xr-x 9 root root 190 May  1 17:14 ..
drwxr-xr-x 2 root root  83 Apr 25 19:28 onearth.studio

/etc/letsencrypt/archive/onearth.studio:
total 16
drwxr-xr-x 2 root root   83 Apr 25 19:28 .
drwx------ 3 root root   28 Apr 25 19:28 ..
-rw-r--r-- 1 root root 1866 Apr 25 19:28 cert1.pem
-rw-r--r-- 1 root root 1586 Apr 25 19:28 chain1.pem
-rw-r--r-- 1 root root 3452 Apr 25 19:28 fullchain1.pem
-rw------- 1 root root 1704 Apr 25 19:28 privkey1.pem

/etc/letsencrypt/csr:
total 40
drwxr-xr-x 2 root root 286 Apr 25 19:28 .
drwxr-xr-x 9 root root 190 May  1 17:14 ..
-rw-r--r-- 1 root root 952 Apr 25 17:29 0000_csr-certbot.pem
-rw-r--r-- 1 root root 924 Apr 25 18:03 0001_csr-certbot.pem
-rw-r--r-- 1 root root 928 Apr 25 19:14 0002_csr-certbot.pem
-rw-r--r-- 1 root root 932 Apr 25 19:14 0003_csr-certbot.pem
-rw-r--r-- 1 root root 932 Apr 25 19:15 0004_csr-certbot.pem
-rw-r--r-- 1 root root 928 Apr 25 19:15 0005_csr-certbot.pem
-rw-r--r-- 1 root root 924 Apr 25 19:16 0006_csr-certbot.pem
-rw-r--r-- 1 root root 936 Apr 25 19:26 0007_csr-certbot.pem
-rw-r--r-- 1 root root 952 Apr 25 19:27 0008_csr-certbot.pem
-rw-r--r-- 1 root root 952 Apr 25 19:28 0009_csr-certbot.pem

/etc/letsencrypt/keys:
total 40
drwx------ 2 root root  286 Apr 25 19:28 .
drwxr-xr-x 9 root root  190 May  1 17:14 ..
-rw------- 1 root root 1704 Apr 25 17:29 0000_key-certbot.pem
-rw------- 1 root root 1708 Apr 25 18:03 0001_key-certbot.pem
-rw------- 1 root root 1704 Apr 25 19:14 0002_key-certbot.pem
-rw------- 1 root root 1708 Apr 25 19:14 0003_key-certbot.pem
-rw------- 1 root root 1708 Apr 25 19:15 0004_key-certbot.pem
-rw------- 1 root root 1704 Apr 25 19:15 0005_key-certbot.pem
-rw------- 1 root root 1704 Apr 25 19:16 0006_key-certbot.pem
-rw------- 1 root root 1704 Apr 25 19:26 0007_key-certbot.pem
-rw------- 1 root root 1704 Apr 25 19:27 0008_key-certbot.pem
-rw------- 1 root root 1704 Apr 25 19:28 0009_key-certbot.pem

/etc/letsencrypt/live:
total 4
drwx------ 3 root root  42 Apr 25 19:28 .
drwxr-xr-x 9 root root 190 May  1 17:14 ..
drwxr-xr-x 2 root root  93 Apr 25 19:28 onearth.studio
-rw-r--r-- 1 root root 740 Apr 25 19:28 README

/etc/letsencrypt/live/onearth.studio:
total 4
drwxr-xr-x 2 root root  93 Apr 25 19:28 .
drwx------ 3 root root  42 Apr 25 19:28 ..
lrwxrwxrwx 1 root root  38 Apr 25 19:28 cert.pem -> ../../archive/onearth.studio/cert1.p
em
lrwxrwxrwx 1 root root  39 Apr 25 19:28 chain.pem -> ../../archive/onearth.studio/chain1
.pem
lrwxrwxrwx 1 root root  43 Apr 25 19:28 fullchain.pem -> ../../archive/onearth.studio/fu
llchain1.pem
lrwxrwxrwx 1 root root  41 Apr 25 19:28 privkey.pem -> ../../archive/onearth.studio/priv
key1.pem
-rw-r--r-- 1 root root 692 Apr 25 19:28 README

/etc/letsencrypt/renewal:
total 4
drwxr-xr-x 2 root root  33 Apr 25 19:28 .
drwxr-xr-x 9 root root 190 May  1 17:14 ..
-rw-r--r-- 1 root root 529 Apr 25 19:28 onearth.studio.conf

/etc/letsencrypt/renewal-hooks:
total 0
drwxr-xr-x 5 root root  43 Apr 25 17:26 .
drwxr-xr-x 9 root root 190 May  1 17:14 ..
drwxr-xr-x 2 root root   6 Apr 25 17:26 deploy
drwxr-xr-x 2 root root   6 Apr 25 17:26 post
drwxr-xr-x 2 root root   6 Apr 25 17:26 pre


/etc/letsencrypt/renewal-hooks/deploy:
total 0
drwxr-xr-x 2 root root  6 Apr 25 17:26 .
drwxr-xr-x 5 root root 43 Apr 25 17:26 ..

/etc/letsencrypt/renewal-hooks/post:
total 0
drwxr-xr-x 2 root root  6 Apr 25 17:26 .
drwxr-xr-x 5 root root 43 Apr 25 17:26 ..

/etc/letsencrypt/renewal-hooks/pre:
total 0
drwxr-xr-x 2 root root  6 Apr 25 17:26 .
drwxr-xr-x 5 root root 43 Apr 25 17:26 ..

Thx!
Jan

1 Like