Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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'm trying to setup an SSL SVN. I got a tutorial, but when I'm trying to run the following command apache2-ssl-certificate I'm getting a command not found error message. My question is how can I fix this problem?

share|improve this question
up vote 3 down vote accepted

The tutorial you've found is unfortunately very old. To generate a SSL cert run the following:

mkdir -p /etc/apache2/ssl
openssl req -new -x509 -days 365 -nodes -out /etc/apache2/ssl/apache.pem -keyout /etc/apache2/ssl/apache.pem
ln -sf /etc/apache2/ssl/apache.pem /etc/apache2/ssl/`/usr/bin/openssl x509 -noout -hash < /etc/apache2/ssl/apache.pem`.0
chmod 600 /etc/apache2/ssl/apache.pem 

This will create a SSL cert that expires in 365 days. To adjust the lifetime just change the -days 365 argument.
Make sure that /etc/apache2/ports.conf contains something like:

<IfModule mod_ssl.c>
    Listen 443

Assuming you still enabled SSL (sudo a2enmod ssl) you need to create a new virtual host. For example create a file /etc/apache2/sites-available/svn, containing among others:

NameVirtualHost *:443
<virtualhost *:443>
        SSLEngine On
        SSLCertificateFile /etc/apache2/ssl/apache.pem

and enable this site with sudo a2ensite svn. So you have a site that listens for SSL connection. I hope this helps.

share|improve this answer

This is due to bug #77675. A solution is mentioned in the comments. I have not tried it myself so I don't know if it's correct. Anyway the solution should be to do the following:

apt-get install apache2
a2enmod ssl
a2ensite default-ssl
make-ssl-cert generate-default-snakeoil --force-overwrite
/etc/init.d/apache2 restart
share|improve this answer
it's not working. – OHLÁLÁ Jul 5 '11 at 8:43

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.