Tutorial on how to Install Apache, Subversion and Trac with Virtual Hosting suppor in Ubuntu Linux
November 2, 2008
We recently had to setup Apache, Subversion and Trac all within a virtual hosting environment for one of our Clients to be able to develop easily and effictively among team members. They wanted to use multiple domain names for separate projects. Made sense to us, so we started looking for instructions on setting this up.
We wanted to setup LigHTTPD, however it's not nearly as easy because of no svn-dav module available, so we stuck with Apache 2 for now.
We found a howto on doing this, however there were a few vital steps and explanations missing so we've re-written it in hopes it will help others the trouble of searching to find this information.
So, lets move on to the tutorial shall we.
First install the required packages on your system. We started with a clean Ubuntu JEOS 8.0.4 Install on our server.
# sudo aptitude install enscript libapache2-mod-python python-docutils trac db4.3-util libapache2-svn subversion-tools
Now create a virtual host for your SVN container.
# mkdir -p /var/local/svn/svn.yourdomain.com
Now create a development group, and add the web user to it.
# addgroup svngroup; adduser www-data svngroup
Now Add a user to the system and add them to that group
# adduser username
# passwd username
Now add that user to the group required for SVN
# adduser username svngroup
Now setup the permissions for your SVN site.
# chmod 2770 /var/local/svn/svn.yourdomain.com
Now setup the repo as you normally would
# svnadmin create /var/local/svn/svn.yourdomain.com
Remove the current password file. We're using HTTPS (or HTTP) instead of SVNSERVE so no need for it.
# rm /var/local/svn/svn.yourdomain.com/conf/passwd
# touch /var/local/svn/svn.yourdomain.com/conf/passwd
Allow your group to write to the repo
# chmod -R g+w www-data:svngroup /var/local/svn/svn.yourdomain.com
Now set the repo access permissions.
# nano /var/local/svn/svn.yourdomain.com/conf/authz
It should look something similar to the following. If in doubt, refer to the Path-Based Auth section of Subversion.
[groups]
svngroup = username1,username2,username2
[/]
@svngroup = rw
Now, create a log directory within apache for your development site.
# mkdir /var/log/apache2/svn.yourdomain.com
Now create your virtual host.
# nano /etc/apache2/sites-available/svn.yourdomain.com
Copy the following in, editing to suit your environment. Note we're using a self signed certificate, you can change this to a properly signed one if you have it.
<VirtualHost [server's IP address]:443>
ServerName svn.yourdomain.com
<Location />
DAV svn
AuthType Basic
AuthName "svn.yourdomain.com"
AuthUserFile /var/local/svn/svn.yourdomain.com/conf/passwd
AuthzSVNAccessFile /var/local/svn/svn.yourdomain.com/conf/authz
SVNPath /var/local/svn/svn.yourdomain.com
Require valid-user
</Location>
CustomLog /var/log/apache2/svn.yourdomain.com/access.log combined
ErrorLog /var/log/apache2/svn.yourdomain.com/error.log
SSLEngine on
SSLCertificateFile /etc/ssl/certs/selfsigned.pem
# Add this once there is a real (non self-signed) certificate.
# SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
<VirtualHost [server's IP address]:80>
ServerName svn.yourdomain.com
Redirect / https://svn.yourdomain.com/
</VirtualHost>
Now, enable the site
# a2ensite svn.yourdomain.com
Now, create a username and password to access the svn site.
# htpasswd /var/local/svn/svn.yourdomain.com/conf/passwd username1
Now, create your SSL certificate. Details are here if you need them.
# sudo aptitude install ssl-cert
Now, we found out that the default Ubuntu SSL cert is only for 30 days, so, we changed this to be 365 a little more sane no? Thanks for the tip Devio.
# which make-ssl-cert
/usr/sbin/make-ssl-cert
# nano /usr/sbin/make-ssl-cert
Replace the line near the bottom that looks like this
openssl req -config $TMPFILE -new -x509 -nodes -out $output -keyout $output
With a line that looks like this instead
openssl req -config $TMPFILE -new -x509 -days 365 -nodes -out $output -keyout $output
Exit and save the file. Now we're ready to generate our final self signed SSL certificate for Apache on Ubuntu. Like this;
# make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/certs/selfsigned.pem
Make sure to set your "common name" to your server name - ie: svn.yourdomain.com
Now you can go ahead and restart Apache to verify your DAV enabled SVN site functions.
# /etc/init.d/apache2 restart
To verify, hit it's url in a browser
If everthing was successful, you now have SVN setup, with WEB-Dav support in Apache2 on Ubuntu. Continue to setup Trac.
First we have to create the web directory for Trac.
# mkdir -p /var/local/trac/trac.yourdomain.com
Now we setup the permissions
# chmod 2770 /var/local/trac/trac.yourdomain.com
Create a Trac instance for your project
# trac-admin /var/local/trac/trac.yourdomain.com initenv
Setup the proper ownerships for the directory
# chown -R www-data:svngroup /var/local/trac/trac.yourdomain.com
Now make sure the group is added to the repo
# chmod -R g+w /var/local/trac/trac.yourdomain.com
Configure Trac where required
# nano /var/local/trac/trac.yourdomain.com/conf/trac.ini
Create a directory for log files
# mkdir /var/log/apache2/trac.yourdomain.com
Now create a virtual host for your trac instance
# nano /etc/apache2/sites-available/trac.yourdomain.com
Now, copy the following into the virtual host configuration, changing to suit your domain and configuration
# Trac Configuration
<VirtualHost [server's IP address]:80>
ServerName trac.yourdomain.com
Redirect / https://trac.yourdomain.com/
</VirtualHost>
<VirtualHost [server's IP address]:443>
ServerName trac.yourdomain.com
DocumentRoot /var/local/trac/trac.yourdomain.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/trac/trac.yourdomain.com/
PythonOption TracUriRoot /
AuthType Basic
AuthName "trac.yourdomain.com"
# Use the SVN password file.
AuthUserFile /var/local/svn/svn.yourdomain.com/conf/passwd
Require valid-user
</Location>
CustomLog /var/log/apache2/trac.yourdomain.com/access.log combined
ErrorLog /var/log/apache2/trac.yourdomain.com/error.log
SSLEngine on
SSLCertificateFile /etc/ssl/certs/selfsigned.pem
# Add this once there is a real (non self-signed) certificate.
# SSLCertificateKeyFile /etc/apache2/ssl/server.key
</VirtualHost>
Now, enable this virtual host as well
# a2ensite trac.yourdomain.com
Configure Trac Permissions for your Trac instance.
# trac-admin /var/local/trac/trac.yourdomain.com
Use the following commands to view permissions, and set permissions.
"help permission"
We set the following permissions to one of our users from the command line
# trac-admin /var/local/trac/trac.yourdomain.com permission add username1 TRAC_ADMIN
Now you're ready to restart Apache with your new Trac VHOST.
# /etc/init.d/apache2 restart
Now you're ready to restart Apache and visit your Trac installation
Login with your user (username1) and password you setup earlier.
We hope this tutorial helps others when trying to setup SVN and Trac on Ubuntu with Virtual Hosts. Let us know if you have any other handy tips!
Migrating and Mounting VMWare Images from VMWare Server 2.x into a VMWare Server 1.x environment
September 5, 2008
Tonight we decided we'd had enough of VMWare Server 2.0's issues and shakiness. We started getting the following error, because as it turns out (we're stupid for not thinking of this ahead of time - lesson learned) VMWare server beta's have an expiry date, along with it's bugs. Today we started getting this error:
"VCommand error: This product has expired."
This box holds some Asterisk Development stuff and some other Dev systems that we couldn't really have go down on us. So, we downgraded our VMWare 2.x Server to the latest 1.x branch of VMWare. Then on we went to importing Virtual Machines from Server 2.0 and Workstation 6. As soon as we started to power them on, the fun started. Of course! The VM's weren't compatible anymore and gave us a couple errors. Here's how we fixed it.
The first error we received was:
"A General System Error Occurred: Unknown Error"
This happened as soon as we tried to power on the VM. This was easily fixed. We entered the Virtual Machine's directory, and edited the .vmx file for the virtual machine, this is just plain text. Replacing the next few lines fixed it right up for us.
config.version = "8"
virtualHW.version = "6"became
config.version = "4"
virtualHW.version = "4"
Now we could power them up. However, we now encountered another error that we couldn't open the virtual disk we had created. The error was something about how the Virtual Disks were created in a later version of vmware, and couldn't be mounted. We'd have to re-create them. Obviously this wasn't an option.
In some of the Virtual Machine directories, we had a file to edit with a text editor, this was simple enough.
# nano virtualdiskname.vmxf
Then change this:
ddb.virtualHWVersion = "6"
became
ddb.virtualHWVersion = "4"
However, some of the other directories (mainly the ones created with VmWare Workstation 6) did not have a simple text file to edit, instead we had to edit the actual virtual disk using a hex editor. We chose the wonderful heme editor. Usage Instructions for Heme are here.
Basically put, do this:
# heme virtualdisk.vmdk
Now press "w" on your keyboard to search for "virtualHWVersion". You will find it in the ascii column eventually. Hit "TAB" to enter Ascii mode, move your cursor with the arrow keys to where you need to replace the number. Replace the "8" or the "6" with a "4" and then press "s" to save the file. Answer yes to saving and then wait for it to save. Now exit the program by pressing "q". You'll notice it created a backup file with the "~" extension on it incase you messed up the hex editing. Leave this backup file here for now. Continue on, nothing to see here.
Now on the VMWare server, make sure that all the files in the virtual machine directory are chmodd'd properly.
# cd /virtual machine/directory/
# chown user:group *
# chmod og=rwx *
Now you should be able to start your vm without any issues.
If it all works, feel free to delete the backup .vmdk~ that heme created for you.
Good luck!
Ottawa – Wed Sept 3rd Webinar – Jay Phillips / Adhearsion: Next-Gen VoIP Development with Ruby and Asterisk
August 31, 2008
Asterisk and Ruby developers please join us at 6:30 pm Wednesday September 3rd for a presentation from Jay Phillips, author of Adhearsion and an avid Ruby, web, and telephony developer. Phillips has spoken at over a dozen conferences and meetups about his Adhearsion software and has written for publications such as Asterisk:
The Future of Telephony and Linux Journal magazine.
Wednesday September 3rd .. 6:30 pm
Adhearsion is an open-source, unconventional framework that ties technologies together neatly. Of these, Adhearsion is most noted as being "adhesion you can hear" for integrating VoIP by building atop the fantastic Asterisk PBX software by Digium. Adhearsion was designed to "understand" the many elements of the VoIP picture and both improve them individually and tie them together in one comprehensive solution.
With Adhearsion many tasks in VoIP engineering are improved, such as
* Writing call-processing instructions
* Trading VoIP functionality
* Integrating with on-phone XML-based microbrowsers
* Collaborating with technology beyond VoIP
* Database integration for DB-driven VoIP apps
* Sophisticated relationships with Asterisk's internals
* Opening up your PBX to RPC distributed computing
* ...and so forth.
Webinar Information:
http://present.carleton.ca/client/BigBlueButton.html
Name: <your name>
Conference: 85002
Password: viewpass
Dial in number: 613.520.7610, or 1.866.520.2505 (toll-free) Access code: 85002
New Nerdy Site Launched – www.ratemydialplan.com
May 4, 2008
Today we launched a new site, somewhat nerdy, but right up all our alleys.
Rate and compare Asterisk IP PBX Dialplans at our leisure.
Adding TinyMCE to your ProjectPier or ActiveCollab Installation
April 19, 2008
Many of you are project managers, and may be using Activecollab or ProjectPier.
We were tired of their lame editor, so we decided to add TinyMCE into our installed version, both for ease of client use, and internal use.
The instructions are very simple.
1. Go to ProjectPier, grab the latest version (or svn)
2. Install ProjectPier as you would normally
3. Install any custom patches or addons to project pier.
4. Download TinyMCE
5. Uncompress TinyMCE, and enter the newly extracted directory. You will see a javascript directory. Rename this to tiny_mce.
6. Copy your newly renamed "tiny_mce" directory to the root of your ProjectPier installation.
# cp -R tiny_mce /var/www/yoursite/htdocs/projectpier/
7. Now, this is the only "complicated" part. Go into your ProjectPier installation directory, and then enter the applications directory. Like this.
# cd /var/www/yoursite/htdocs/projectpier/
# cd application
# cd layouts
8. Now you're going to want to edit three files
# nano administration.php dashboard.php project_website.php
9. Now in these files, you're going to want to add the include for tiny_mce. Add the following code after the last "add_javascript_to_page" line at the top of each file and then you are done.
<?php echo add_javascript_to_page('dropdown.js') ?>
<script language="javascript" type="text/javascript" src="http://www.yoursite.com/projectpier/tiny_mce/tiny_mce.js"></script><script language="javascript" type="text/javascript">
tinyMCE.init({
force_p_newlines: "false",
forced_root_block : '',
theme : "advanced",
mode : "textareas"
});
</script>
10. That's It! You are finished adding TinyMCE to your Project Management Installation! It should look something like this.

Enjoy!
Asterisk VOIP Jobs Site Re-Launch!
March 15, 2008
Hello Asterisk Jobs Employers and Users,
First off we'd like to say thanks for signing up for the site and proving that there's an interest in keeping this moving forward. Using the money that has been contributed we've paid for more hosting, and development time for the site.
We wanted to let you know that we have completed our enhancements of the Asterisk VOIP Jobs Website.
With a brand new platform and user interface Asterisk-Jobs.com is guaranteed to deliver better results than ever. With the new Asterisk-Jobs.com launch we have enhanced the Asterisk-Jobs.com user experience. Job seekers are no longer required to complete an involved sign up process to view job listings; they are provided instant free access to all listed positions. In fact, Job seekers resumes aren't saved on our servers and are emailed directly to employers.
You can register to the new site here
With the site launch we have created exciting new pricing plans that we feel our employers will benefit much more from as compared to the previous plans. The new plans work out as follows:
· 1 Post - 5$
· 10 Posts - 45$ (1 Free)
· 25 Posts - 110$ (3 Free)
Of course if you need more than that you can always contact us to work out an affordable rate for mass posting.
Thanks for reading, and we look forward to having you post on the new site.
As always, the site is completely free for asterisk voip job seekers!
Asterisk Jobs Staff
OpenVox First PCI Express Analog Card Is Released!
February 20, 2008
Hi All,
OpenVox first PCI Express analog card A400E is now released to all our Asterisk Community users.
User could choose any of combinations of OpenVox FXO-100 or FXS-100 modules according to the business requirements.
Key Features:
* PCI Express 1.0 slot
* Scalable: Just add additional cards to extend system.
* Easy to use: Full software and hardware compatible with Digium's analog cards based on wctdm driver.
* It is mixable with X100M/S100M modules.
* Rohs Compliant.
Certificates: CE and FCC
Two Year Warranty!
For more Info, please visit www.openvox.com.cn
Regards,
Belief Mo



