Certbot failing to install on apache / django sites

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: rentcorp.exodustec.com / aww.exodustec.com

I ran this command: certbot --apache

It produced this output: Successfully deployed certificate for aww.exodustec.com to /etc/apache2/sites-available/aww-le-ssl.conf
Successfully deployed certificate for rentcorp.exodustec.com to /etc/apache2/sites-available/rentcorp-le-ssl.conf
Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.

AH00526: Syntax error on line 27 of /etc/apache2/sites-enabled/aww.conf:
Name duplicates previous WSGI daemon definition.

We were unable to install your certificate, however, we successfully restored your server to its prior configuration.

NEXT STEPS:

  • The certificate was saved, but could not be installed (installer: apache). After fixing the error shown below, try installing it again by running:
    certbot install --cert-name rentcorp.exodustec.com

Error while running apache2ctl configtest.
Action 'configtest' failed.
The Apache error log may have more information.

AH00526: Syntax error on line 27 of /etc/apache2/sites-enabled/aww.conf:
Name duplicates previous WSGI daemon definition.

My web server is (include version):apache2

The operating system my web server runs on is (include version): ubuntu 22.04 /

My hosting provider, if applicable, is:

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 2.6.0

This is the apache sites-enabled file. I can not find the name duplicates previous WSGI daemon definition

<VirtualHost *:80>
ServerName rentcorp.exodustec.com

DocumentRoot /rentcorp/src/rentcorp

ErrorLog /rentcorp/site/logs/error.log
CustomLog /rentcorp/site/logs/access.log combine

Alias /static /rentcorp/site/static/
Alias /media /rentcorp/site/media/

<Directory /rentcorp/site/static>
    Require all granted
</Directory>

<Directory /rentcorp/site/media>
    Require all granted
</Directory>

<Directory /rentcorp/src/rentcorp>
	 <Files wsgi.py>
  		 Require all granted
	</Files>
</Directory>

#WSGIDaemonProcess rentcorp python-home=/rentcorp/venv python-path=/rentcorp/src
WSGIDaemonProcess rentcorp python-path=/rentcorp/src/rentcorp:/rentcorp/venv/lib/python3.10/site-packages
WSGIProcessGroup rentcorp
WSGIScriptAlias / /rentcorp/src/rentcorp/wsgi.py

<Directory /rentcorp/src/templates>
    Require all granted
</Directory>

vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Put this directive outside of the VirtualHost (just above it). It shouldn't make any functional difference, but doing so will allow your VirtualHost to be cloned by Certbot for HTTPS.

5 Likes

This worked perfectly!

Thank you for your quick response and great advice.

4 Likes

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