# Apache cannot load modules



## imp (Jul 11, 2011)

When I try to start apache it gives me this error.

```
httpd: Syntax error on line 87 of /usr/local/etc/apache22/httpd.conf:
 Cannot load /usr/local/www/libexec/apache22/mod_ssl.so into server: Cannot open "/usr/local/www/libexec/apache22/mod_ssl.so"
```
I don't really understand what went wrong.


----------



## DutchDaemon (Jul 11, 2011)

Did you compile www/apache22 with SSL? Check 
	
	



```
$ grep SSL /var/db/ports/apache22/options                                                                           
WITH_SSL=true
```


----------



## imp (Jul 11, 2011)

Yes I did. It fails to load any modules. I checked by commenting out various modules in httpd.conf


----------



## DutchDaemon (Jul 11, 2011)

mod_ssl is supposed to live at /usr/local/libexec/apache22/mod_ssl.so; check the path directives in your httpd.conf again.


```
$ pkg_info -W /usr/local/libexec/apache22/mod_ssl.so
/usr/local/libexec/apache22/mod_ssl.so was installed by package apache-2.2.19
```


----------



## SirDice (Jul 12, 2011)

What does line 87 say in httpd.conf? According to the error message there's a syntax error there.


----------



## BSDKernel (Feb 28, 2013)

I am getting the same error after recompiling apache i.e 

```
httpd: Syntax error on line 56 of /usr/local/etc/apache22/httpd.conf:
 Cannot load /usr/local/www/libexec/apache22/mod_ssl.so into server: Cannot open "/usr/local/www/libexec/apache22/mod_ssl.so"
```

and when I run:
`# pkg_info -W /usr/local/libexec/apache22/mod_ssl.so`

I get pkg_info: 

```
/var/db/pkg/ftp/+CONTENTS: No such file or directory
```
I compiled apache with ssl.


----------



## DutchDaemon (Feb 28, 2013)

pkg_info is obsolete when you're using PKGNG. Use [cmd=]pkg which /usr/local/libexec/apache22/mod_ssl.so[/cmd]


```
# pkg which /usr/local/libexec/apache22/mod_ssl.so
/usr/local/libexec/apache22/mod_ssl.so was installed by package apache22-2.2.23_4
```


----------



## BSDKernel (Mar 1, 2013)

I run `pkg which /usr/local/libexec/apache22/mod_ssl.so` and *I* got 
	
	



```
su: pkg: command not found
```

*S*o *I* went to /usr/ports/ports-mgmt/pkg and installed but it gave me the error

```
===>  pkg-1.0.8 not supported on 7.x or early 8.0.
*** Error code 1

Stop in /usr/ports/ports-mgmt/pkg.
```


----------



## zehfi (Mar 1, 2013)

*F*or me mod_ssl.so is found at /usr/local/libexec/apache22. *T*ry to see if it's there.


----------



## Preacher (Mar 2, 2013)

imp said:
			
		

> When I try to start apache it gives me this error.
> 
> ```
> httpd: Syntax error on line 87 of /usr/local/etc/apache22/httpd.conf:
> ...



I don't know if I've got the same problem. The title says "Apache cannot load modules". Though it might be just about the SSL-module. I also got this message today after I added proxy_module and proxy_http_module (I want to configure a reverse proxy).

I've searched Google and tried a few things. But still got the message below when I uncomment the LoadModule statement for mod_ssl:


```
Performing sanity check on apache22 configuration:
httpd: Syntax error on line 93 of /usr/local/etc/apache22/httpd.conf: Cannot load
 /usr/local/libexec/apache22/mod_ssl.so into server: /usr/local/libexec/apache22/mod_ssl.so:
 Undefined symbol "TLSv1_2_server_method"
```

mod_ssl.so appears to exist in the given location. Also libssl.so has a symbolic link to libssl.so.8 in the following directory: /usr/local/lib.


----------



## Preacher (Mar 3, 2013)

After I had come to the realization there are two OpenSSL-versions in FreeBSD (the base-version - 0.9.8 branch and the ports-version - 1.0.1-branch) I did some searching again and found the following page:
https://mebsd.com/freebsd-security-hardening/openssl-upgrade-freebsd.html

I will cite the page's commands for clarity:

First update ports tree:
`# portsnap fetch update`

Add line in /etc/make.conf:

```
WITH_OPENSSL_PORT=yes
```

Then execute:
`# portupgrade -N security/openssl`

And the command that starts recompiling everything to use the ports OpenSSL (1.0.1):
`# portupgrade -Rrf security/openssl`

After that final command I went to sleep after some time. So I don't exactly know how much time it took. But I guess it took a mighty long time :e

This morning when I woke up I went to check and Apache starts again (with SSL module). Now to configure that reverse proxy


----------

