RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2104867 - certbot-apache doesn't work with RHEL 9 httpd
Summary: certbot-apache doesn't work with RHEL 9 httpd
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: httpd
Version: CentOS Stream
Hardware: All
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: rhel-cs-infra-services-qe
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-07 11:06 UTC by marcin
Modified: 2022-09-14 10:16 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-14 10:16:18 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-127200 0 None None None 2022-07-07 11:08:18 UTC

Description marcin 2022-07-07 11:06:09 UTC
Description of problem:

While certbot-apache isn't packaged in CentOS 9 yet, it can be installed with
`pip`, for instance with the following commands:

```
dnf -y install certbot
pip install certbot-apache
```

It can be also installed by rebuilding a Fedora package `python-certbot-apache`.
Other guides suggest using `snap` to install `certbot`.


Version-Release number of selected component (if applicable):

* httpd-2.4.53-4.el9
* certbot-1.27.0-2.el9


How reproducible:

Always


Steps to Reproduce:
1. Install httpd
2. Install epel-release
3. Install certbot
4. Install certbot-apache
5. Run certbot --apache


Actual results:

```
# certbot --apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Error in checking parameter list: 
The apache plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError('Apache is unable to check whether or not the module is loaded because Apache is misconfigured.')
```


Expected results:

certbot should provide a regular functionality: allow to select domains,
generate certificates for them, edit httpd configurations and reload httpd.


Additional info:

certbot-apache calls the following command:

```
apachectl -t -D DUMP_RUN_CFG
```

On CentOS 8, this command returned with representation of httpd configuration,
so that certbot-apache worked correctly. On CentOS 9 it only returns the
following:

```
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
To pass extra arguments to httpd, see the httpd.service(8)
man page.
```

It is possible to patch /usr/sbin/apachectl to make certbot work:

```
--- /usr/sbin/apachectl.old	2022-07-07 13:03:41.288885616 +0200
+++ /usr/sbin/apachectl	2022-07-07 11:45:49.871770987 +0200
@@ -31,13 +31,13 @@
 SVC='httpd.service'
 HTTPD='/usr/sbin/httpd'
 
-if [ "x$2" != "x" ] ; then
-    echo Passing arguments to httpd using apachectl is no longer supported.
-    echo You can only start/stop/restart httpd using this script.
-    echo To pass extra arguments to httpd, see the $SVC'(8)'
-    echo man page.
-    exit 1
-fi
+#if [ "x$2" != "x" ] ; then
+#    echo Passing arguments to httpd using apachectl is no longer supported.
+#    echo You can only start/stop/restart httpd using this script.
+#    echo To pass extra arguments to httpd, see the $SVC'(8)'
+#    echo man page.
+#    exit 1
+#fi
 
 case $ACMD in
 start|stop|restart|status)
@@ -57,7 +57,8 @@
     ERROR=$?
     ;;
 configtest|-t)
-    $HTTPD -t
+    shift
+    $HTTPD -t "$@"
     ERROR=$?
     ;;
 -v|-V)
```

(Do note, that if you patch it manually, it will be reverted on update)

Comment 1 Joe Orton 2022-09-14 10:16:18 UTC
certbot should run httpd directly, and I can see there is a PR upstream do do exactly this, which is the best way to fix this:

https://github.com/certbot/certbot/pull/9402

I would rather not try to add more special cases in apachectl.


Note You need to log in before you can comment on or make changes to this bug.