Ok! Now we’re getting… closer? I hope.
I re-ran sudo certbot --apache and got further this time:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
Which names would you like to activate HTTPS for?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: mini.luo.ma
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 1
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mini.luo.ma
Error while running apachectl configtest.
AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Cleaning up challenges
Error while running apachectl configtest.
AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
sigh
Here’s the log again:
% sudo cat /var/log/letsencrypt/letsencrypt.log
2018-10-25 19:10:41,776:DEBUG:certbot.main:certbot version: 0.27.1
2018-10-25 19:10:41,777:DEBUG:certbot.main:Arguments: ['--apache']
2018-10-25 19:10:41,778:DEBUG:certbot.main:Discovered plugins: PluginsRegistry(PluginEntryPoint#apache,PluginEntryPoint#manual,PluginEntryPoint#nginx,PluginEntryPoint#null,PluginEntryPoint#standalone,PluginEntryPoint#webroot)
2018-10-25 19:10:41,852:DEBUG:certbot.log:Root logging level set at 20
2018-10-25 19:10:41,853:INFO:certbot.log:Saving debug log to /var/log/letsencrypt/letsencrypt.log
2018-10-25 19:10:41,855:DEBUG:certbot.plugins.selection:Requested authenticator apache and installer apache
2018-10-25 19:10:42,267:DEBUG:certbot_apache.configurator:Apache version is 2.4.33
2018-10-25 19:10:42,742:DEBUG:certbot.plugins.selection:Single candidate plugin: * apache
Description: Apache Web Server plugin - Beta
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = certbot_apache.entrypoint:ENTRYPOINT
Initialized: <certbot_apache.override_darwin.DarwinConfigurator object at 0x10c236f28>
Prep: True
2018-10-25 19:10:42,744:DEBUG:certbot.plugins.selection:Selected authenticator <certbot_apache.override_darwin.DarwinConfigurator object at 0x10c236f28> and installer <certbot_apache.override_darwin.DarwinConfigurator object at 0x10c236f28>
2018-10-25 19:10:42,744:INFO:certbot.plugins.selection:Plugins selected: Authenticator apache, Installer apache
2018-10-25 19:10:42,754:DEBUG:certbot.main:Picked account: <Account(RegistrationResource(body=Registration(key=None, contact=(), agreement=None, status=None, terms_of_service_agreed=None, only_return_existing=None), uri='https://acme-v02.api.letsencrypt.org/acme/acct/44513276', new_authzr_uri=None, terms_of_service=None), f2832ae8a8a7757befecf1d75fec7bf6, Meta(creation_dt=datetime.datetime(2018, 10, 25, 21, 45, 27, tzinfo=<UTC>), creation_host='tj.luo.ma'))>
2018-10-25 19:10:42,773:DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/directory.
2018-10-25 19:10:42,840:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org:443
2018-10-25 19:10:42,946:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "GET /directory HTTP/1.1" 200 658
2018-10-25 19:10:42,948:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Content-Type: application/json
Content-Length: 658
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
Expires: Thu, 25 Oct 2018 23:10:42 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Thu, 25 Oct 2018 23:10:42 GMT
Connection: keep-alive
{
"79YXntg7iZM": "https://community.letsencrypt.org/t/adding-random-entries-to-the-directory/33417",
"keyChange": "https://acme-v02.api.letsencrypt.org/acme/key-change",
"meta": {
"caaIdentities": [
"letsencrypt.org"
],
"termsOfService": "https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf",
"website": "https://letsencrypt.org"
},
"newAccount": "https://acme-v02.api.letsencrypt.org/acme/new-acct",
"newNonce": "https://acme-v02.api.letsencrypt.org/acme/new-nonce",
"newOrder": "https://acme-v02.api.letsencrypt.org/acme/new-order",
"revokeCert": "https://acme-v02.api.letsencrypt.org/acme/revoke-cert"
}
2018-10-25 19:10:51,973:INFO:certbot.main:Obtaining a new certificate
2018-10-25 19:10:52,129:DEBUG:certbot.crypto_util:Generating key (2048 bits): /etc/letsencrypt/keys/0002_key-certbot.pem
2018-10-25 19:10:52,135:DEBUG:certbot.crypto_util:Creating CSR: /etc/letsencrypt/csr/0002_csr-certbot.pem
2018-10-25 19:10:52,137:DEBUG:acme.client:Requesting fresh nonce
2018-10-25 19:10:52,137:DEBUG:acme.client:Sending HEAD request to https://acme-v02.api.letsencrypt.org/acme/new-order.
2018-10-25 19:10:52,177:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "HEAD /acme/new-order HTTP/1.1" 405 0
2018-10-25 19:10:52,178:DEBUG:acme.client:Received response:
HTTP 405
Server: nginx
Content-Type: application/problem+json
Content-Length: 103
Allow: POST
Replay-Nonce: x9pcS95ckCtOM_r4n5y7EEX-XQD8sxCJ10qwraZHH8Y
Expires: Thu, 25 Oct 2018 23:10:52 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Thu, 25 Oct 2018 23:10:52 GMT
Connection: keep-alive
2018-10-25 19:10:52,178:DEBUG:acme.client:Storing nonce: x9pcS95ckCtOM_r4n5y7EEX-XQD8sxCJ10qwraZHH8Y
2018-10-25 19:10:52,179:DEBUG:acme.client:JWS payload:
b'{\n "identifiers": [\n {\n "type": "dns",\n "value": "mini.luo.ma"\n }\n ],\n "status": "pending",\n "resource": "new-order"\n}'
2018-10-25 19:10:52,183:DEBUG:acme.client:Sending POST request to https://acme-v02.api.letsencrypt.org/acme/new-order:
{
"protected": "eyJhbGciOiAiUlMyNTYiLCAia2lkIjogImh0dHBzOi8vYWNtZS12MDIuYXBpLmxldHNlbmNyeXB0Lm9yZy9hY21lL2FjY3QvNDQ1MTMyNzYiLCAibm9uY2UiOiAieDlwY1M5NWNrQ3RPTV9yNG41eTdFRVgtWFFEOHN4Q0oxMHF3cmFaSEg4WSIsICJ1cmwiOiAiaHR0cHM6Ly9hY21lLXYwMi5hcGkubGV0c2VuY3J5cHQub3JnL2FjbWUvbmV3LW9yZGVyIn0",
"signature": "h0gq1mWd3zSnPPdGfMf8kqK8Oyh24rcBF6VpgDRVvkTXZZof5JxcNvwvsO-P1AWH4QkNYQCP0t8oWkGIyH5pez1j-gC7dTkrcSWBjRL54zPYdjjQvUZ5W6KAftQetSO-xqffaqZGrXzBgTd-d87Uln8Z04rHT_FQbynANKzZQt363Z4kg8tMBgTbwuCM4zEsS6nTWvLV3bjA8o9cmNTb0GqFZZVZ76TCT01TI0pW9lzbZ82vg6WK7Tz8A5CNRCEtzyOca7UEnZ79f_RB8WViO1MGbSJMmkqmMo41HTFAtCUyQI_FpBSGEAsef4l7CpeCkZIvZJ-3AwEm_RYx1aN2Kg",
"payload": "ewogICJpZGVudGlmaWVycyI6IFsKICAgIHsKICAgICAgInR5cGUiOiAiZG5zIiwKICAgICAgInZhbHVlIjogIm1pbmkubHVvLm1hIgogICAgfQogIF0sCiAgInN0YXR1cyI6ICJwZW5kaW5nIiwKICAicmVzb3VyY2UiOiAibmV3LW9yZGVyIgp9"
}
2018-10-25 19:10:52,236:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "POST /acme/new-order HTTP/1.1" 201 360
2018-10-25 19:10:52,237:DEBUG:acme.client:Received response:
HTTP 201
Server: nginx
Content-Type: application/json
Content-Length: 360
Boulder-Requester: 44513276
Location: https://acme-v02.api.letsencrypt.org/acme/order/44513276/137329649
Replay-Nonce: S3Z6toGHlM3uK7vm4CC0dgD5kVvV6R-4J11zsHNb-A4
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
Expires: Thu, 25 Oct 2018 23:10:52 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Thu, 25 Oct 2018 23:10:52 GMT
Connection: keep-alive
{
"status": "pending",
"expires": "2018-11-01T21:45:50Z",
"identifiers": [
{
"type": "dns",
"value": "mini.luo.ma"
}
],
"authorizations": [
"https://acme-v02.api.letsencrypt.org/acme/authz/pkJq9I05sdRjohYVAUb7XDdPw7m99v1hCs52AD83pBw"
],
"finalize": "https://acme-v02.api.letsencrypt.org/acme/finalize/44513276/137329649"
}
2018-10-25 19:10:52,237:DEBUG:acme.client:Storing nonce: S3Z6toGHlM3uK7vm4CC0dgD5kVvV6R-4J11zsHNb-A4
2018-10-25 19:10:52,237:DEBUG:acme.client:Sending GET request to https://acme-v02.api.letsencrypt.org/acme/authz/pkJq9I05sdRjohYVAUb7XDdPw7m99v1hCs52AD83pBw.
2018-10-25 19:10:52,285:DEBUG:urllib3.connectionpool:https://acme-v02.api.letsencrypt.org:443 "GET /acme/authz/pkJq9I05sdRjohYVAUb7XDdPw7m99v1hCs52AD83pBw HTTP/1.1" 200 903
2018-10-25 19:10:52,286:DEBUG:acme.client:Received response:
HTTP 200
Server: nginx
Content-Type: application/json
Content-Length: 903
X-Frame-Options: DENY
Strict-Transport-Security: max-age=604800
Expires: Thu, 25 Oct 2018 23:10:52 GMT
Cache-Control: max-age=0, no-cache, no-store
Pragma: no-cache
Date: Thu, 25 Oct 2018 23:10:52 GMT
Connection: keep-alive
{
"identifier": {
"type": "dns",
"value": "mini.luo.ma"
},
"status": "pending",
"expires": "2018-11-01T21:45:50Z",
"challenges": [
{
"type": "tls-alpn-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/challenge/pkJq9I05sdRjohYVAUb7XDdPw7m99v1hCs52AD83pBw/8634067764",
"token": "Yfhw07G1KbI8bWgJ_7SzRBDCXryFJSw9mF9qCkRmwko"
},
{
"type": "dns-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/challenge/pkJq9I05sdRjohYVAUb7XDdPw7m99v1hCs52AD83pBw/8634067765",
"token": "Hj-cD-rmLI8knTngpaHbUhfRNukYqxO1mxxRZdj6wmY"
},
{
"type": "http-01",
"status": "pending",
"url": "https://acme-v02.api.letsencrypt.org/acme/challenge/pkJq9I05sdRjohYVAUb7XDdPw7m99v1hCs52AD83pBw/8634067766",
"token": "Wte06TW8fGHMecM0odfCTFWDcUpSSud8K6O2iU7METY"
}
]
}
2018-10-25 19:10:52,286:INFO:certbot.auth_handler:Performing the following challenges:
2018-10-25 19:10:52,287:INFO:certbot.auth_handler:http-01 challenge for mini.luo.ma
2018-10-25 19:10:52,296:DEBUG:certbot_apache.http_01:Adding a temporary challenge validation Include for name: mini.luo.ma in: /private/etc/apache2/httpd.conf
2018-10-25 19:10:52,297:DEBUG:certbot_apache.http_01:writing a pre config file with text:
RewriteEngine on
RewriteRule ^/\.well-known/acme-challenge/([A-Za-z0-9-_=]+)$ /var/lib/letsencrypt/http_challenges/$1 [END]
2018-10-25 19:10:52,297:DEBUG:certbot_apache.http_01:writing a post config file with text:
<Directory /var/lib/letsencrypt/http_challenges>
Require all granted
</Directory>
<Location /.well-known/acme-challenge>
Require all granted
</Location>
2018-10-25 19:10:52,383:DEBUG:certbot.reverter:Creating backup of /private/etc/apache2/httpd.conf
2018-10-25 19:10:52,629:ERROR:certbot.util:Error while running apachectl configtest.
AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
2018-10-25 19:10:52,634:DEBUG:certbot.error_handler:Encountered exception:
Traceback (most recent call last):
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2211, in config_test
util.run_script(self.option("conftest_cmd"))
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/util.py", line 86, in run_script
raise errors.SubprocessError(msg)
certbot.errors.SubprocessError: Error while running apachectl configtest.
AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/auth_handler.py", line 75, in handle_authorizations
resp = self._solve_challenges(aauthzrs)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/auth_handler.py", line 126, in _solve_challenges
resp = self.auth.perform(all_achalls)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2286, in perform
self.restart()
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2173, in restart
self.config_test()
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2213, in config_test
raise errors.MisconfigurationError(str(err))
certbot.errors.MisconfigurationError: Error while running apachectl configtest.
AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
2018-10-25 19:10:52,635:DEBUG:certbot.error_handler:Calling registered functions
2018-10-25 19:10:52,635:INFO:certbot.auth_handler:Cleaning up challenges
2018-10-25 19:10:52,969:DEBUG:certbot.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2211, in config_test
util.run_script(self.option("conftest_cmd"))
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/util.py", line 86, in run_script
raise errors.SubprocessError(msg)
certbot.errors.SubprocessError: Error while running apachectl configtest.
AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/certbot", line 11, in <module>
load_entry_point('certbot==0.27.1', 'console_scripts', 'certbot')()
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/main.py", line 1364, in main
return config.func(config, plugins)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/main.py", line 1124, in run
certname, lineage)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/main.py", line 120, in _get_and_save_cert
lineage = le_client.obtain_and_enroll_certificate(domains, certname)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/client.py", line 391, in obtain_and_enroll_certificate
cert, chain, key, _ = self.obtain_certificate(domains)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/client.py", line 334, in obtain_certificate
orderr = self._get_order_and_authorizations(csr.data, self.config.allow_subset_of_names)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/client.py", line 370, in _get_order_and_authorizations
authzr = self.auth_handler.handle_authorizations(orderr, best_effort)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/auth_handler.py", line 75, in handle_authorizations
resp = self._solve_challenges(aauthzrs)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot/auth_handler.py", line 126, in _solve_challenges
resp = self.auth.perform(all_achalls)
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2286, in perform
self.restart()
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2173, in restart
self.config_test()
File "/usr/local/Cellar/certbot/0.27.1/libexec/lib/python3.7/site-packages/certbot_apache/configurator.py", line 2213, in config_test
raise errors.MisconfigurationError(str(err))
certbot.errors.MisconfigurationError: Error while running apachectl configtest.
AH00526: Syntax error on line 1 of /etc/apache2/other/le_http_01_challenge_pre.conf:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration