Host your own open source project on Ubuntu in just 3 easy steps!
This is a zero-commentary guide to getting Apache 2, Subversion, and Trac all up and running with SSL on Ubuntu.
If you’re looking for more explanation of what each command does, please skip down to the references at the end of the post. If, on the other hand, you’re looking to get your open source project up and running fast without having to think too hard, you’ve come to the right place.
Note: I’ve tested this process on Ubuntu’s Gutsy Gibbon, v7.10.
1) Install Apache 2 with SSL
sudo apt-get install apache2 ssl-cert
sudo a2enmod ssl
sudo mkdir /etc/apache2/ssl
sudo /usr/sbin/make-ssl-cert \
/usr/share/ssl-cert/ssleay.cnf \
/etc/apache2/ssl/apache.pem
sudo cp /etc/apache2/sites-available/default \
/etc/apache2/sites-available/ssl
Edit:
sudo vi /etc/apache2/sites-available/ssl
Replace:
NameVirtualHost * <VirtualHost *>
With:
NameVirtualHost *:443
<VirtualHost *:443>
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLProtocol all
SSLCipherSuite HIGH:MEDIUM
sudo a2ensite ssl
Edit:
sudo vi /etc/apache2/apache2.conf
Add:
ServerName servername
2) Install Subversion
sudo apt-get install subversion libapache2-svn sudo mkdir /var/svn cd /var/svn sudo mkdir project sudo svnadmin create /var/svn/project sudo svn mkdir file:///var/svn/project/trunk -m trunk sudo svn mkdir file:///var/svn/project/tags -m tags sudo svn mkdir file:///var/svn/project/branches -m branches sudo chown -R www-data.www-data project sudo chmod -R g+rws project sudo htpasswd -c /etc/subversion/passwd user_name
Edit:
sudo vi /etc/apache2/mods-available/dav_svn.conf
Add:
<Location /svn>
DAV svn
SVNParentPath /var/svn
AuthType Basic
AuthName "Subversion"
AuthUserFile /etc/subversion/passwd
SSLRequireSSL
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
3) Install Trac
sudo apt-get install trac \
libapache2-mod-python \
python-setuptools
sudo mkdir /var/trac
cd /var/trac
sudo trac-admin project initenv
sudo trac-admin project permission add user_name TRAC_ADMIN
sudo chown -R www-data.www-data /var/trac
Edit:
sudo vi /etc/apache2/sites-available/ssl
Add to bottom:
<LocationMatch "/trac/[[:alnum:]]+/login">
AuthType Basic
AuthName "trac"
AuthUserFile /etc/subversion/passwd
Require valid-user
SSLRequireSSL
</LocationMatch>
<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /var/trac
PythonOption TracUriRoot /trac
SSLRequireSSL
</Location>
sudo /etc/init.d/apache2 restart
References
- Viktor Zigo’s Installation of Subversion on Ubuntu, with Apache, SSL, and BasicAuth.
- Ariejan de Vroom’s How to setup a Ubuntu development server – Part 1 and How to setup a Ubuntu development server – Part 2
- Ubuntu’s Subversion documentation
- Ben Collins-Sussman, Brian W. Fitzpatrick, and C. Michael Pilato’s Version Control with Subversion online book

I’m no expert, but with these step by step instructions I actually got everything working. I guess the next step is registering a domain with FrugalName and making my project official.
Thomas, rad, that’s great to hear. Feel free to write back with the domain name you end up choosing, I’d be happy to advertise your project here.
Btw, I posted this on Digg, if you’re so inclined to spread the word…
i hate it when there is no explanation. there is not your fault though, even official tutorials have not any