Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I went through this tutorial setting up my SSL on Apache2. But when I attempt to start my server I get this error:

Syntax error on line 1 of /etc/apache2/conf.d/ssl.crt/foo-server.crt: Invalid command '-----BEGIN', perhaps misspelled or defined by a module not included in the server configuration

What does it seem like I'm missing in my Apache setup? How can I check?

Aay help is greatly appreciated!


below is my vhost file:

<IfModule mod_ssl.c>

  <VirtualHost *:443>

    RailsEnv development

    DocumentRoot /home/dan/rails/foo/public

    SSLEngine On
    SSLCipherSuite HIGH:MEDIUM
    SSLProtocol all -SSLv2
    SSLCertificateFile /etc/apache2/conf.d/ssl.crt/foo-server.crt
    SSLCertificateKeyFile /etc/apache2/conf.d/ssl.key/foo-server.key
    SSLCertificateChainFile /etc/apache2/conf.d/ssl.crt/foo-ca.crt
    SSLCertificateFile /etc/apache2/conf.d/ssl.crt/foo-ca.crt

    <Directory "/home/dan/rails/foo/public">
      Order allow,deny
      Allow from all


share|improve this question

Check your include directive. It appears httpd is trying to run your certificate file as if it was a configuration file. So the "---begin RSA key" at the start of certificate file is getting handled like an (invalid) command. In your main httpd.conf file, I'm betting your include is something like this: Include conf.d/ssl.crt/* when it should be more like this: Include conf.d/ssl.crt/*.conf or Include conf.d/*.conf

Include is used to pull in all the additional configuration files for other httpd modules. One of which is ssl.conf. However, you don't want those keys to be treated like config files, else you get the error you're seeing.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.