SSL troubles "Invalid command '-----BEGIN'"

Ok so I have followed the guides I have a nameCheap rapidSSL certificate booting ubuntu. I followed one of the guides in the library for installing a commercial CA certificate but now I can't even restart apache. I am getting this error:

  • Restarting web server apache2

Syntax error on line 1 of /etc/apache2/conf.d/ssl.crt/adsreloaded.crt:

Invalid command '–---BEGIN', perhaps misspelled or defined by a module not included in the server configuration


What does this even mean? Clearly it doesn't like my crt but I have no idea why. Also removing the SSL on CertificateFile info from the virtualHost configuration still throws the error…. Any ideas?


1 Reply

You're getting that error because you put your certificate under the /etc/apache2/conf.d directory. Anything under that directory will be interpreted as an Apache configuration file. A certificate is not a configuration file, so Apache can't interpret it.

Just move the certificate and key to a different location, such as /etc/ssl or /etc/apache2/ssl or /root/ssl or whatever else you find convenient. But remember to chown them to root and chmod them to 600. The directory where the certificate and key are stored should be 700. You don't want anybody other than root to have access to your certificates.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct