Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1899  / 2 Years ago, sun, september 11, 2022, 7:16:55

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?


More From » svn

 Answers
2

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.


[#44334] Tuesday, September 13, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
izecaptur

Total Points: 113
Total Questions: 102
Total Answers: 114

Location: Northern Mariana Islands
Member since Fri, Jan 15, 2021
3 Years ago
;