Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

2 Answers 2

up vote 3 down vote accepted
+50

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
</IfModule>

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
        ...
</virtualhost>

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. –  run Jul 5 '11 at 8:43

Your Answer

 
discard

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.