As of (almost) anything there's also a good howto on the Web for that.
Here are the basic/central steps to take.
# Subversion Configuration
<VirtualHost [server's IP address]:80>
ServerName svn.example.com
Redirect / https://svn.example.com/
</VirtualHost>
<VirtualHost [server's IP address]:443>
ServerName svn.example.com
<Location />
DAV svn
AuthType Basic
AuthName "svn.example.com"
AuthUserFile /var/local/www/svn/svn.example.com/conf/passwd
AuthzSVNAccessFile /var/local/www/svn/svn.example.com/conf/authz
SVNPath /var/local/www/svn/svn.example.com
Require valid-user
</Location>
CustomLog /var/log/apache2/svn.example.com/access.log combined
ErrorLog /var/log/apache2/svn.example.com/error.log
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
# Add this once there is a real (non self-signed) certificate.
# SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
# Trac Configuration
<VirtualHost [server's IP address]:80>
ServerName trac.example.com
Redirect / https://trac.example.com/
</VirtualHost>
<VirtualHost [server's IP address]:443>
ServerName trac.example.com
DocumentRoot /var/local/www/trac/trac.example.com/
Alias /trac/ /usr/share/trac/htdocs
<Directory "/usr/share/trac/htdocs/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Location />
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonInterpreter main_interpreter
PythonOption TracEnv /var/local/www/trac/trac.example.com/
PythonOption TracUriRoot /
AuthType Basic
AuthName "trac.example.com"
# Use the SVN password file.
AuthUserFile /var/local/svn/svn.example.com/conf/passwd
Require valid-user
</Location>
CustomLog /var/log/apache2/trac.example.com/access.log combined
ErrorLog /var/log/apache2/trac.example.com/error.log
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
# Add this once there is a real (non self-signed) certificate.
# SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
Have fun! :-)