Trouble Creating First Certificate

My domain is:
iangrainger.co.uk

I ran this command:
sudo certbot --apache

It produced this output:
The apache plugin is not working; there may be problems with your existing configuration.
The error was: PluginError('There has been an error in parsing the file /etc/apache2/mods-enabled/php7.4.conf on line 2: Syntax error')

My web server is (include version):
Apache/2.4.41 (Ubuntu)

The operating system my web server runs on is (include version):
Ubuntu 20.04.3 LTS

My hosting provider, if applicable, is:
N/A

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

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):
certbot 1.18.0

What are the contents of the file at /etc/apache2/mods-enabled/php7.4.conf?

The file contains the following...


<FilesMatch "\.html$”>
    SetHandler application/x-httpd-php
</FilesMatch>

<FilesMatch ".+\.ph(ar|p|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>

Note that the first line is blank!

That second quote looks like it was copy-pasted from a blog or something which converted it to a Unicode quote. Try replacing it with a regular ASCII quote (") like the rest.

That's a great spot, thank you!

I've now got another problem unfortunately. Running the command:

sudo certbot --apache

Results in the following output...

Requesting a certificate for iangrainger.co.uk and www.iangrainger.co.uk

Certbot failed to authenticate some domains (authenticator: apache). The Certificate Authority reported these problems:
  Domain: iangrainger.co.uk
  Type:   dns
  Detail: During secondary validation: DNS problem: query timed out looking up A for iangrainger.co.uk

  Domain: www.iangrainger.co.uk
  Type:   dns
  Detail: During secondary validation: No valid IP addresses found for www.iangrainger.co.uk

Hint: The Certificate Authority failed to verify the temporary Apache configuration changes made by Certbot. Ensure that the listed domains point to this Apache server and that it is accessible from the internet.

Any ideas?

Will need to try resolving this tomorrow as it's after 2am here! :slight_smile:

1 Like

I'd just try again later (or now, whatever). It looks like a temporary issue.

Excellent! Certificate is up and running! Thank you so much for your help! :slight_smile:

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