Detail: Could not connect to www.jeffhost.idv.tw.well-known. (www.jeffhost.idv.tw is my website.)


#1

Please fill out the fields below so we can help you better.

My domain is:===============>>>
www.jeffhost.idv.tw
P.S. host: www domain: jeffhost.idv.tw website: www.jeffhost.idv.tw
I ran this command:===============>>>
sudo certbot-auto certonly --webroot -w /usr/share/drupal7/ -d www.jeffhost.idv.tw
P.S. I have put this script, certbot-auto which is from https://dl.eff.org/certbot-auto and into /usr/local/sbin/ with chmod a+x. Hence, I am able to directly execute this command.

It produced this output:==================>>>
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for www.jeffhost.idv.tw
Using the webroot path /usr/share/drupal7 for all unmatched domains.
Waiting for verification…
Cleaning up challenges
Failed authorization procedure. www.jeffhost.idv.tw (http-01): urn:acme:error:connection :: The server could not connect to the client to verify the domain :: Could not connect to www.jeffhost.idv.tw.well-known

IMPORTANT NOTES:

  • The following errors were reported by the server:

    Domain: www.jeffhost.idv.tw
    Type: connection
    Detail: Could not connect to www.jeffhost.idv.tw.well-known

    To fix these errors, please make sure that your domain name was
    entered correctly and the DNS A 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 operating system is (include version):===============>>>
Rasbian 4.4.38-v7+

My web server is (include version):===============>>>
apache 2.4.10-10+deb8u7

My hosting provider, if applicable, is:=============>>>
Myself.

I can login to a root shell on my machine (yes or no, or I don’t know):================>>>
Yes.

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):==========>>>
No.

My apache configuration:================>>>

           <VirtualHost *:80>   
           ServerName www.jeffhost.idv.tw:80
           ServerAlias jeffhost.idv.tw
           Redirect "/" "https://www.jeffhost.idv.tw"
           </VirtualHost>

           <IfModule mod_ssl.c>
           <VirtualHost *:443>
            ServerName www.jeffhost.idv.tw
            ServerAlias jeffhost.idv.tw
            DocumentRoot /usr/share/drupal7/
            ErrorDocument 501 /usr/share/drupal7/security-error.php

            <Directory /usr/share/drupal7/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
            </Directory>
            # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
            # error, crit, alert, emerg.
            # It is also possible to configure the loglevel for particular
            # modules, e.g.
            #LogLevel info ssl:warn

            ErrorLog ${APACHE_LOG_DIR}/jeffhost/error.log
            LogLevel warn
            CustomLog ${APACHE_LOG_DIR}/jeffhost/access.log combined

            # For most configuration files from conf-available/, which are
            # enabled or disabled at a global level, it is possible to
            # include a line for only one particular virtual host. For example the
            # following line enables the CGI configuration for this host only
            # after it has been globally disabled with "a2disconf".
            #Include conf-available/serve-cgi-bin.conf

            #   SSL Engine Switch:
            #   Enable/Disable SSL for this virtual host.
            SSLEngine on

            #   A self-signed (snakeoil) certificate can be created by installing
            #   the ssl-cert package. See
            #   /usr/share/doc/apache2/README.Debian.gz for more info.
            #   If both key and certificate are stored in the same file, only the
            #   SSLCertificateFile directive is needed.
            SSLCertificateFile      /etc/ssl/certs/jeffhostcacert.crt
            SSLCertificateKeyFile /etc/ssl/private/jeffhostcacert.key

            #   Server Certificate Chain:
            #   Point SSLCertificateChainFile at a file containing the
            #   concatenation of PEM encoded CA certificates which form the
            #   certificate chain for the server certificate. Alternatively
            #   the referenced file can be the same as SSLCertificateFile
            #   when the CA certificates are directly appended to the server
            #   certificate for convinience.
            #SSLCertificateChainFile /etc/apache2/ssl.crt/server-ca.crt

            #   Certificate Authority (CA):
            #   Set the CA certificate verification path where to find CA
            #   certificates for client authentication or alternatively one
            #   huge file containing all of them (file must be PEM encoded)
            #   Note: Inside SSLCACertificatePath you need hash symlinks
            #                to point to the certificate files. Use the provided
            #                Makefile to update the hash symlinks after changes.
            #SSLCACertificatePath /etc/ssl/certs/
            #SSLCACertificateFile /etc/apache2/ssl.crt/ca-bundle.crt

            #   Certificate Revocation Lists (CRL):
            #   Set the CA revocation path where to find CA CRLs for client
            #   authentication or alternatively one huge file containing all
            #   of them (file must be PEM encoded)
            #   Note: Inside SSLCARevocationPath you need hash symlinks
            #                to point to the certificate files. Use the provided
            #                Makefile to update the hash symlinks after changes.
            #SSLCARevocationPath /etc/apache2/ssl.crl/
            #SSLCARevocationFile /etc/apache2/ssl.crl/ca-bundle.crl

            #   Client Authentication (Type):
            #   Client certificate verification type and depth.  Types are
            #   none, optional, require and optional_no_ca.  Depth is a
            #   number which specifies how deeply to verify the certificate
            #   issuer chain before deciding the certificate is not valid.
            #SSLVerifyClient require
            #SSLVerifyDepth  10

            #   SSL Engine Options:
            #   Set various options for the SSL engine.
            #   o FakeBasicAuth:
            #        Translate the client X.509 into a Basic Authorisation.  This means that
            #        the standard Auth/DBMAuth methods can be used for access control.  The
            #        user name is the `one line' version of the client's X.509 certificate.
            #        Note that no password is obtained from the user. Every entry in the user
            #        file needs this password: `xxj31ZMTZzkVA'.
            #   o ExportCertData:
            #        This exports two additional environment variables: SSL_CLIENT_CERT and
            #        SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
            #        server (always existing) and the client (only existing when client
            #        authentication is used). This can be used to import the certificates
            #        into CGI scripts.
            #   o StdEnvVars:
            #        This exports the standard SSL/TLS related `SSL_*' environment variables.
            #        Per default this exportation is switched off for performance reasons,
            #        because the extraction step is an expensive operation and is usually
            #        useless for serving static content. So one usually enables the
            #        exportation for CGI and SSI requests only.
            #   o OptRenegotiate:
            #        This enables optimized SSL connection renegotiation handling when SSL
            #        directives are used in per-directory context.
            #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
            <FilesMatch "\.(cgi|shtml|phtml|php)$">
                            SSLOptions +StdEnvVars
            </FilesMatch>
            <Directory /usr/lib/cgi-bin>
                            SSLOptions +StdEnvVars
            </Directory>

            #   SSL Protocol Adjustments:
            #   The safe and default but still SSL/TLS standard compliant shutdown
            #   approach is that mod_ssl sends the close notify alert but doesn't wait for
            #   the close notify alert from client. When you need a different shutdown
            #   approach you can use one of the following variables:
            #   o ssl-unclean-shutdown:
            #        This forces an unclean shutdown when the connection is closed, i.e. no
            #        SSL close notify alert is send or allowed to received.  This violates
            #        the SSL/TLS standard but is needed for some brain-dead browsers. Use
            #        this when you receive I/O errors because of the standard approach where
            #        mod_ssl sends the close notify alert.
            #   o ssl-accurate-shutdown:
            #        This forces an accurate shutdown when the connection is closed, i.e. a
            #        SSL close notify alert is send and mod_ssl waits for the close notify
            #        alert of the client. This is 100% SSL/TLS standard compliant, but in
            #        practice often causes hanging connections with brain-dead browsers. Use
            #        this only for browsers where you know that their SSL implementation
            #        works correctly.
            #   Notice: Most problems of broken clients are also related to the HTTP
            #   keep-alive facility, so you usually additionally want to disable
            #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
            #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
            #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
            #   "force-response-1.0" for this.
            BrowserMatch "MSIE [2-6]" \
                            nokeepalive ssl-unclean-shutdown \
                            downgrade-1.0 force-response-1.0
            # MSIE 7 and newer should be able to use keepalive
            BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

            </VirtualHost>
            </IfModule>

#2

Is that the exact command as you ran it ? or have you retyped it here ( and possibly got a mistake in it).

For some reason it’s trying to go to www.jeffhost.idv.tw.well-known rather than www.jeffhost.idv.tw/.well-known (with the “/” in there after your domain name.

In your command;

sudo certbot-auto ceronly --webroot -w /usr/share/drupal7/ -d www.jeffhost.idv.tw

you have “ceronly” which should be “certonly” although that in itself won’t cause the problem you are seeing - I’m just wondering of there were other mistakes in that line.


#3

Right, the slash is missing from this line:

Redirect "/" "https://www.jeffhost.idv.tw"

should be:

Redirect "/" "https://www.jeffhost.idv.tw/"

Also note that Drupal 7 currently requires a patch to make it compatible with webroot authentication, see https://www.drupal.org/node/2408321#comment-11614247 (this should hopefully be fixed in the next update).


#4

https://www.drupal.org/node/2408321#comment-11614247

Transliteration here:

Thanks. the comment is clear on this link. I put the patch under my directory, /etc/drupal/7/. But, the git tool I am not fairly good at git. I understand the code modification which there are 7 lines from starting on line 3 and 7 lines from starting on line 89. May I copy and past directly instead of git this tool? Because of that I got some error issues when I used "git apply ", hence I intend to paste code instantly. Will this method affect the future update? What I have done is to backup htaccess to be htaccess.bak. Then, I open it with vi and check where the code exist on which location exactly. Actually, code is on line 6 and line 85. So, I mark with # on line 6 and 84. And I add new code on line 7 and line 86. The next step I reload and restart apache before executing “sudo certbot-auto certonly --webroot -w /usr/share/drupal7/ -d www.jeffhost.idv.tw”. It isn’t ok initially and give some query time out information which I refer goole to get known about the reason. (i.e. It is a mater not on my site. Just try and run again.) Finally, I implement “sudo certbot-auto certonly --webroot -w /usr/share/drupal7/ -d www.jeffhost.idv.tw -d jeffhost.idv.tw.” (I add -d jeffhost.idv.tw.) and got worked.

diff --git a/.htaccess b/.htaccess index 54de42d..d290809 100644 --- a/.htaccess +++ b/.htaccess @@ -3,7 +3,7 @@ #

Protect files and directories from prying eyes.

-<FilesMatch ".(engine|inc|info|install|make|module|profile|test|po|sh|.sql|theme|tpl(.php)?|xtmpl)(~|.sw[op]|.bak|.orig|.save)?$|^(…|Entries.*$
+<FilesMatch ".(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(.php)?|xtmpl)(~|.sw[op]|.bak|.orig|.save)?$|^(.(?!well-know$
Order allow,deny

@@ -89,7 +89,7 @@ DirectoryIndex index.php index.html index.htm

If you do not have mod_rewrite installed, you should remove these

directories from your webroot or otherwise protect them from being

downloaded.

  • RewriteRule “(^|/).” - [F]
  • RewriteRule “(^|/).(?!well-known)” - [F]

    If your site can be accessed both with and without the ‘www.’ prefix, you

    can use one of the following settings to redirect users to your preferred


#5

So… you got it working? Great!

Next time you update Drupal core, you should check the .htaccess file to see if those lines are still changed, and if not, change them again manually as you have done here.

Alternatively you could try using the patch utility which works in some situations where git apply does not. https://www.drupal.org/patch/apply has more information.


#6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.