@waynel and @ahaw021, I’ve just installed a fresh RHEL 7.3 to test this issue:
I’ve apache (httpd) from the DVD (I’ve no subscription to RH repos).
yum install httpd
I’ve enabled httpd and started it.
systemctl enable httpd
systemctl start httpd
I’ve created a conf file inside /etc/httpd/conf.d/
cat /etc/httpd/conf.d/test.conf
<VirtualHost *:80>
ServerAdmin webmaster@27a.net
DocumentRoot /tmp
ServerName test.example.com
ErrorLog /tmp/test.example.com.error.log
CustomLog /tmp/test.example.com.access.log combined
<Directory "/tmp">
Options Indexes Includes FollowSymLinks ExecCGI
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Reload httpd.
systemctl reload httpd
Just in case this is useful to you, this is my apache version:
apachectl -V
Server version: Apache/2.4.6 (Red Hat Enterprise Linux)
Server built: Aug 3 2016 08:33:27
Server's Module Magic Number: 20120211:24
Server loaded: APR 1.4.8, APR-UTIL 1.5.2
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/httpd"
-D SUEXEC_BIN="/usr/sbin/suexec"
-D DEFAULT_PIDLOG="/run/httpd/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
I don’t know where you get the certbot package but I like the certbot-auto so I installed it.
mkdir /root/certbot
cd /root/certbot
wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
./certbot-auto --apache
[Here it will install several packages and their dependencies]
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Which names would you like to activate HTTPS for?
-------------------------------------------------------------------------------
1: test.example.com
-------------------------------------------------------------------------------
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel):
So, I don’t need to use any other option to specify the apache root server… if your virtualhost conf is in /etc/httpd/conf
instead of /etc/httpd/conf.d
you need to provide the option --apache-vhost-root /etc/httpd/conf
.
Just in case there is some issue with sudo, I tested it too giving the right perms to /root/certbot dir and /root/certbot/certbot-auto executable and launched the command with another user and sudo.
sudo /root/certbot/certbot-auto --apache
and it worked without issues.
My advice, try the last certbot-auto version.
Cheers,
sahsanu