Virtualhost syntax error and Certbot failure

Status
Not open for further replies.

oguruma

Patron
Joined
Jan 2, 2016
Messages
226
1. Trying to get Nextcloud set up based on this guide. From within my LAN, the jail IP takes me to It Works! and MYURL.COM takes me to Secure Connection Failed



2. I am getting the following syntax error.



Code:
root@nextcloud:~ # service apache24 restart
Performing sanity check on apache24 configuration:
AH00526: Syntax error on line 46 of /usr/local/etc/apache24/Includes/MYURL.COM.conf:
SSLCertificateFile takes one argument, SSL Server Certificate file ('/path/to/file' - PEM or DER encoded)



3. Certbot fails with the message below. Port 443 and 80 are open and my URL resolves to my IP.

Code:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for MYURL.com
Using the webroot path /usr/local/www/apache24/data/nextcloud for all unmatched domains.
Waiting for verification...
Cleaning up challenges
Failed authorization procedure. cloud.rangelmedianetwork.com (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching https://MYURL.com/.well-known/acme-challenge/9tOdxzuS2mMETnSD4J--rYXaZAx6zOXzX3y2jpflmVo: Error getting validation data

IMPORTANT NOTES:
 - The following errors were reported by the server:

   Domain: MYURL.COM
   Type:   connection
   Detail: Fetching
   https://MYURL.com/.well-known/acme-challenge/9tOdxzuS2mMETnSD4J--rYXaZAx6zOXzX3y2jpflmVo:
   Error getting validation data

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A/AAAA record(s) for that domain
   contain(s) the right IP address. Additionally, please check that
   your computer has a publicly routable IP address and that no
   firewalls are preventing the server from communicating with the
   client. If you're using the webroot plugin, you should also verify
   that you are serving files from the webroot path you provided.



My Virtualhost file

Code:
<VirtualHost *:80>
DocumentRoot "/usr/local/www/apache24/data/nextcloud"
ServerName MYURL.COM
RewriteEngine on
RewriteCond %{SERVER_NAME} =MYURL.COM
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
#ErrorLog ${APACHE_LOG_DIR}/error.log
#CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /usr/local/www/apache24/data/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /usr/local/www/apache24/data/nextcloud
SetEnv HTTP_HOME /usr/local/www/apache24/data/nextcloud
Satisfy Any
</Directory>
</VirtualHost>

<VirtualHost *:443>
  ServerAdmin Me@MYURL.COM
  ServerName MYURL.COM
  DirectoryIndex index.php
  DocumentRoot /usr/local/www/apache24/data/nextcloud
  SSLCertificateFile /usr/local/etc/letsencrypt/live/MYURL.COM/fullchain.pem
  SSLCertificateKeyFile /usr/local/etc/letsencrypt/live/MYURL.COM/privkey.pem
  SSLEngine on
  # Intermediate configuration, tweak to your needs
  SSLProtocol  all -SSLv2 -SSLv3
  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
  SSLHonorCipherOrder  on
  SSLCompression  off
  SSLOptions +StrictRequire
  <Directory /usr/local/www/apache24/data/nextcloud>
  AllowOverride all
  </Directory>
  <IfModule mod_headers.c>
  Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
  </IfModule>
 

gt2416

Patron
Joined
Feb 4, 2018
Messages
262
You are redirecting http to https. From your logs:
"Failed authorization procedure. cloud.rangelmedianetwork.com (http-01)"
Certbot will use http to do its test NOT HTTPS. So basically remove your https config till you get your cert or remove the redirect to https till you get the cert.
Problem 2 says that your cert file in your config is missing. (Obviously cause you have not got the certs yet), so remove the lines in your config that point to the cert file. Or just remove https part entirely till you get the cert.
 
Status
Not open for further replies.
Top