Solved Apache can't locate ssl_module, undefined symbol ssl_module

Hey, I did some searching and found some similar results but they were from years ago.

I'm running FreeBSD 12.4-RELEASE-p1

Earlier today I had apache24-2.4.57, php81-8.1.18, and py39-certbot-2.4.0,1 all working great!!

I did all my updates. No errors. BUT now Apache wont start...

Code:
# apachectl start
Performing sanity check on apache24 configuration:
httpd: Syntax error on line 155 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `ssl_module' in file /usr/local/libexec/apache24/mod_ssl.so: Undefined symbol "ssl_module"
Starting apache24.
httpd: Syntax error on line 155 of /usr/local/etc/apache24/httpd.conf: Can't locate API module structure `ssl_module' in file /usr/local/libexec/apache24/mod_ssl.so: Undefined symbol "ssl_module"
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24

Apache updated from 2.4.57 to 2.4.57_1
Certbot updated from 2.4.0,1 to 2.6.0,1 and STILL WORKS!! (I can do # certbot certificates and it shows me my current certs

I'm sure there is a simple solution but I cannot find it. Did I miss something obvious?? Thanks in advance.
 
In my continued search, I found some thread that suggested reinstalling openssl so I tried that, but I feel like that may have been a MISTAKE

Now I get...


Code:
# apachectl start
Performing sanity check on apache24 configuration:
AH00526: Syntax error on line 650 of /usr/local/etc/apache24/httpd.conf:
Invalid command 'SSLCipherSuite', perhaps misspelled or defined by a module not included in the server configuration
Starting apache24.
AH00526: Syntax error on line 650 of /usr/local/etc/apache24/httpd.conf:
Invalid command 'SSLCipherSuite', perhaps misspelled or defined by a module not included in the server configuration
/usr/local/etc/rc.d/apache24: WARNING: failed to start apache24

So now I'm afraid I made it worse??
 
How did you update?

Do you use packages or ports or both?

Your second set of errors looks like it can’t find mod_ssl - is that module enabled in httpd.conf?
 
How did you update?

Do you use packages or ports or both?

Your second set of errors looks like it can’t find mod_ssl - is that module enabled in httpd.conf?
I use portupgrade for my updates. That's how I got the first error.

BUT OMG, you just helped me fix it!! Earlier, I tried to comment out the mod_ssl line in my httpd.conf to see what would happen (it didn't help of course), but then I FORGOT to revert it back!!

Okay so, I just fixed my httpd.conf.

NOW my apache starts!! BUT I'm not sure what I did to fix the ORIGINAL ERROR???

At one point I uninstalled Apache and Apr and reinstalled them. Maybe that fixed it?
I have another server to update and it will probably do the same thing. I'd love to know the exact thing to do to fix this issue.
 
Perhaps the re-install of OpenSSL? But mod_ssl is part of Apache so maybe something you did there, yes.

You possibly also got the updated OpenSSL 1.1.1u so maybe that required extra rebuilding or reinstalls?
 
Perhaps the re-install of OpenSSL? But mod_ssl is part of Apache so maybe something you did there, yes.

You possibly also got the updated OpenSSL 1.1.1u so maybe that required extra rebuilding or reinstalls?
Thanks for the reply. I'm gonna come back to this thread in a day or two after I update my other machine, which is pretty much identical. At least I know what NOT to try next time. Hopefully I'll be able to pinpoint exactly what solves this issue in case anyone else has it.

On the machine I just fixed, it shows:

Code:
# openssl version
OpenSSL 1.1.1q-freebsd  5 Jul 2022
 
Do you build your ports against the base OpenSSL or ports SSL?

What does /usr/local/bin/openssl version show?
My ports were all built against the base OpenSSL. Trying to install OpenSSL was definitely a mistake but luckily I removed it before reinstalling any other ports, so I think I'm good with that server.

To answer your question...
Code:
# /usr/local/bin/openssl version
/usr/local/bin/openssl: Command not found.

# which openssl
/usr/bin/openssl

# usr/bin/openssl version
OpenSSL 1.1.1q-freebsd  5 Jul 2022
 
JUST NOW, I finished updating my second server, which is pretty much an identical build.
I ran into the same issue with Apache not starting... the same complaint...

Can't locate API module structure `ssl_module' in file /usr/local/libexec/apache24/mod_ssl.so: Undefined symbol "ssl_module"

But this time, the ONLY thing I did to fix it was:

Code:
# pkg delete apr

# cd /usr/ports/www/apache24
# make install clean

Then Apache started normally and everything works!!

Now, I'm not sure WHY that worked, but deleting Apr also removes Apache. Then reinstalling Apache also installs Apr. Problem solved.
 
Back
Top