Subversion is a commonly used central version control system for software development. There are currently still a large number of organizations that rely upon it, many have since moved on to Git.
sudo apt-get install apache2 apache2-utils
sudo apt-get install subversion subversion-tools libapache2-svn
sudo mkdir /home/svn
svnadmin create /home/svn/test
Create a group for subversion users:
sudo groupadd subversion
sudo adduser USERNAME
Add a user to the group:
sudo useradd -G USERNAME subversion
sudo chown -R www-data:subversion /home/svn/test
sudo chmod -R g+rws /home/svn/test
sudo a2enmod dav_svn
To create/clobber a new file for the first user:
sudo htpasswd -c /etc/apache2/.htpasswd YOURUSER
To add additional users:
sudo htpasswd /etc/apache2/.htpasswd YOURUSER
(repeat for new users without the -c as that creates/clobbers the file)
sudo vi /etc/apache2/sites-available/000-default.conf
Then add to the bottom:
(NOTE1: the LimitExcept can be enabled to allow anonymous access):
(NOTE2: the LimitXMLRequestBody can be uncomment to allow large commits)
AuthName "Subversion Repository"
# AuthUserFile /etc/svn-auth
#<LimitExcept GET PROPFIND OPTIONS REPORT>
sudo service apache2 reload
sudo service apache2 restart
NOTE: At this point you should be able to browse and do a remote checkout of the code from another machine….
svn co http://YOUR-IP-OR-HOSTNAME/svn/test --username YOURUSER --password YOURPASS
sudo vi /etc/init/svnserve.conf
Add the following:
# svnserve - Subversion server
description "Subversion server"
start on (local-filesystems and net-device-up IFACE=lo and started udev-finish)
stop on runlevel 
respawn limit 2 3600
exec /usr/bin/svnserve --foreground --daemon --config-file /home/svn/repos/conf/svnserve.conf --root /home/svn/repos/
sudo initctl start svnserve
Back on the client side…
Create a new folder inside your user folder:
Check out the project into this folder:
svn checkout http://YOUR-IP-OR-HOSTNAME/svn/test
Let us just add a new HTML index file to the folder:
Add it to version control:
svn add index.html
Commit the new file:
svn commit -m "commit message"
That should cover most cases for you…
After a while it can get tedious to access and review server logs via the command line. There are several tools available that can provide the same information in a graphical manner. Recently I’ve migrated to Splunk as there are both Enterprise and Free versions available.
- Of course, you’ll need a Splunk server installed first, as the forwarder is really just another (lighter) instance that will forward the log information to a central location.
- Download the system appropriate installer from:
- Check to see if you are running 32 or 64 bit OS.
uname -aIf you see i686 you are 32 bit, if x86_64 you are 64 bit!
- Download, you’ll likely need a different version:
sudo dpkg -i splunkforwarder-6.1.3-220630-linux-2.6-intel.deb
sudo dpkg -i splunkforwarder-6.1.3-220630-linux-2.6-amd64.deb
- Enable auto-start on reboot:
sudo ./splunk enable boot-start
- Start the server:
sudo service splunk start
- Set the password:
The default ‘
admin‘ password is ‘
changeme‘ so we need to change it immediately to do anything else, or we will see errors in future steps.
sudo /opt/splunkforwarder/bin/splunk edit user admin -password YOUR_NEW_PASSWORD -auth admin:changeme
- Set the server:
sudo /opt/splunkforwarder/bin/splunk add forward-server YOUR_SERVER_ADDRESS:9997
NOTE: if you get prompted for a splunk username/password you likely skipped the above step. Remember – the forwarder is a new ‘light’ installation of the server and as such has it’s own users!
- Enable some monitors on the box:Some common services and log locations to get you started…
- Apache2 HTTPd
sudo /opt/splunkforwarder/bin/splunk add monitor /var/log/apache2 -index main -sourcetype Apache2
sudo /opt/splunkforwarder/bin/splunk add monitor /opt/tomcat7/logs -index main -sourcetype Tomcat7
sudo /opt/splunkforwarder/bin/splunk add monitor /var/log/mysql -index main -sourcetype MySQL
- Postfix (SMTP)
sudo /opt/splunkforwarder/bin/splunk add monitor /var/log/mail.log -index main -sourcetype Postfix
- Squid3 (Proxy)
sudo /opt/splunkforwarder/bin/splunk add monitor /var/log/squid/access.log -index main -sourcetype Squid3
sudo /opt/splunkforwarder/bin/splunk add monitor /var/log/squid/cache.log -index main -sourcetype Squid3
sudo /opt/splunkforwarder/bin/splunk add monitor /opt/sonar/logs -index main -sourcetype Sonar
- (OPTIONAL) Verify configuration by opening file at the following:
- You now should be able to log into your server and see new data flowing from the forwarder.
NOTE: this requires you to enable ‘receiving’ of data on the port specified above, usually 9997.
I’ve discussed the use of SSH in several posts in the past, but while recently building a new environment, I realized that I’ve never indicated how the service itself should be installed.
sudo apt-get install openssh-server
If you desire to change any of the default configuration such as port or cyphers…
sudo vi /etc/ssh/ssh_config
NOTE: If you intend to access the server from the Internet, you will have to verify that port forwarding is enabled on your routers and firewalls.