# [solved] Apache 2.4: Invalid command 'SSLEngine'

## Gladdle

I have killed my Apache 2.4, if i start him, the follow appears:

```
/usr/sbin/apache2

AH00526: Syntax error on line 14 of /etc/apache2/httpd-vhosts-https.conf:

Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
```

Here is that file, i have removed the eMail Adress:

```
<VirtualHost 192.168.0.33:443>

   ServerName               owncloud.gladdle.rainyday-productions.de:443

   DocumentRoot             "/var/www/owncloud"

   ServerAdmin              ZENSIERT

   DirectoryIndex           index.html index.php

   ErrorLog                 /var/log/apache2/owncloud.error.log

   CustomLog                /var/log/apache2/owncloud.custom.log common

   SSLEngine                on

   SSLCertificateFile       /root/ssl/owncloud.gladdle.dynpc.org.crt

   SSLCertificateKeyFile    /root/ssl/owncloud.gladdle.dynpc.org.key

</VirtualHost>
```

The row with the error is that one: 

```
SSLEngine on
```

In the file /etc/apache2/httpd.conf is the Entry with SSL aviable:

```
<IfDefine SSL>

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

</IfDefine>

LoadModule speling_module modules/mod_speling.so

<IfDefine SSL>

LoadModule ssl_module modules/mod_ssl.so

</IfDefine>
```

Also in the /etc/conf.d/apache2 is the Entry:

```
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP -D WSGI"
```

Apache was compilled with those use flags: 

```
[ebuild   R   ~] www-servers/apache-2.4.29:2::gentoo  USE="ssl threads -debug -doc -ldap -libressl (-selinux) -static -suexec" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_anon authn_core authn_dbm authn_file authz_core authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers http2 include info log_config logio mime mime_magic negotiation proxy proxy_http rewrite setenvif socache_shmcb speling status unique_id unixd userdir usertrack vhost_alias watchdog -access_compat -asis -authn_dbd -authz_dbd -cache_disk -cache_socache -cern_meta -charset_lite -dbd -dumpio -ident -imagemap -lbmethod_bybusyness -lbmethod_byrequests -lbmethod_bytraffic -lbmethod_heartbeat -log_forensic -macro -proxy_ajp -proxy_balancer -proxy_connect -proxy_fcgi -proxy_ftp -proxy_html -proxy_scgi -proxy_wstunnel -ratelimit -remoteip -reqtimeout -slotmem_shm -substitute -version -xml2enc" APACHE2_MPMS="worker -event -prefork"
```

Has anyone an idea why my apache wont start? I didn't find anything on this forum or google.Last edited by Gladdle on Sun Jul 01, 2018 3:28 pm; edited 2 times in total

----------

## freke

Is it starting using the correct commandline/config-file(s) when invoking just /usr/sbin/apache2?

What if you do

```
/etc/init.d/apache2 restart
```

----------

## Gladdle

That happen: 

```
server / # /etc/init.d/apache2 restart

 * Starting apache2 ...

 * start-stop-daemon: failed to start `/usr/sbin/apache2'
```

Thats the reason i start apache directly. Apache was running a long time, but since an update or something the above error appears.

----------

## toralf

Hhm, shouldn't this *Quote:*   

> 
> 
> ```
> /etc/apache2/httpd2.conf 
> ```
> ...

 be 

```
/etc/apache2/httpd.conf 
```

?

----------

## Gladdle

 *toralf wrote:*   

> Hhm, shouldn't this *Quote:*   
> 
> ```
> /etc/apache2/httpd2.conf 
> ```
> ...

 

It was my fault, it's the file "/etc/apache2/httpd.conf". I have edited the above text.

And also, i have 2 config files, one for http and one for all https domains. If i disable the https config file my server starts!

----------

## freke

What happens if you comment out the <IfDefine SSL> in the httpd.conf - ie. forcing it to load the needed modules for SSL (could it be missing the -D SSL from the OPTS-entry/commandline?)

----------

## papas

is there the mod_ssl.so?

----------

## Gladdle

 *freke wrote:*   

> What happens if you comment out the <IfDefine SSL> in the httpd.conf - ie. forcing it to load the needed modules for SSL?

 

I have edited the "/etc/apache2/httpd.conf": 

```
#<IfDefine SSL>

LoadModule ssl_module modules/mod_ssl.so

#</IfDefine>
```

That happens: 

```
server / # /etc/init.d/apache2 restart

 * Caching service dependencies ...                                                                                                                    [ ok ]

 * Starting apache2 ...

 * start-stop-daemon: failed to start `/usr/sbin/apache2'                                                                                              [ !! ]

 * ERROR: apache2 failed to start

server / # /usr/sbin/apache2

```

But the server didn't start! The Logfile says:

```
[Sun Jul 01 17:14:51.241464 2018] [ssl:emerg] [pid 14893:tid 3070021648] AH02572: Failed to configure at least one certificate and key for owncloud.gladdle.dynpc.org:80

[Sun Jul 01 17:14:51.242307 2018] [ssl:emerg] [pid 14893:tid 3070021648] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned

[Sun Jul 01 17:14:51.254666 2018] [ssl:emerg] [pid 14893:tid 3070021648] AH02312: Fatal error initialising mod_ssl, exiting.

AH00016: Configuration Failed
```

 *freke wrote:*   

> could it be missing the -D SSL from the OPTS-entry/commandline?

 

If you read my 5th codeblock in my first post you see it  :Wink: 

 *papas wrote:*   

> is there the mod_ssl.so?

 

```
 server / # find / -name mod_ssl.so

/usr/lib/apache2/modules/mod_ssl.so
```

Seems like i found the problem, i have a 

```
<VirtualHost 192.168.0.33:443>

   ServerName         owncloud.gladdle.dynpc.org

   RedirectPermanent  / https://owncloud.gladdle.rainyday-productions.de

</VirtualHost>
```

 And THAT doesn't work but didn't show the correct error in the LOG Files...

----------

