Sep 20 2007

cintraAD: Setup a new Trac project

Tag: Linux, cintraADGrant Perry @ 11:32 pm

To create a new Trac project follow these steps:

sudo -s -H
trac-admin /var/trac/project initenv
trac-admin /var/trac/project permission add admin TRAC_ADMIN
chown -R www-data:www-data /var/trac/project

Now to setup the new Trac project with the same plugins as the example project. This also uses the same password file. So use unique usernames and users spanning multiple projects will have the same password!

nano /var/trac/project/conf/trac.ini

Add the following to the file:

[components]
trac.web.auth.loginmodule = disabled
webadmin.* = enabled
customfieldadmin.* = enabled
acct_mgr.* = enabled
acct_mgr.web_ui.RegistrationModule = disabled
 
[account-manager]
password_format = htpasswd
password_store = HtPasswdStore
password_file = /var/trac/trac.htpasswd

Then restart Apache!

apache2 -k restart

Now you should be able to point your browser to this addresses to see the new project!

  • http://servername/trac/project/
Share bookmark

Sep 20 2007

cintraAD: Setup a new Subversion repository

Tag: Linux, cintraADGrant Perry @ 10:19 pm

To create a new Subversion repository follow these steps:

mkdir /var/svn/project
mkdir ~/project
mkdir ~/project/branches
mkdir ~/project/tags
mkdir ~/project/trunk
svnadmin create /var/svn/project
svn import ~/project file:///var/svn/project -m "Initial directory import"

After this you’ll see the three directories added.

rm -rf ~/project
chown -R www-data:www-data /var/svn/project
apache2 -k restart

Now you should be able to point your browser to either of these addresses to see the new repository!

  • http://servername/svn/project/
  • http://servername/websvn/listing.php?repname=project
Share bookmark

Sep 20 2007

cintraAD: Change the SVN and Trac password

Tag: Linux, cintraADGrant Perry @ 10:05 pm

Particularly if you’re publishing your SVN and Trac over the internet, you should change the defaults passwords for these that were in the VM you downloaded. To change the Subversion password:

htpasswd /etc/apache2/dav_svn.passwd admin

To change the Trac password (one file is currently used for all trac projects) :

htpasswd /var/trac/trac.htpasswd admin
Share bookmark

Sep 20 2007

cintraAD: Change the root password

Tag: Linux, cintraADGrant Perry @ 9:57 pm

For security reasons if you’re using any downloaded VM you should not leave the default root password as provided. To change the password:

sudo passwd

You’ll then be asked to enter the original password, then asked twice to enter the new password.

Share bookmark

Sep 20 2007

cintraAD: Setup a static IP

Tag: Linux, cintraADGrant Perry @ 9:52 pm

Obviously it’s a bad idea to have a server assigned a different IP address by your DHCP server when it comes up. So here are some basic instructions to set a static IP address on this Ubuntu server.

sudo -s -H
vi /etc/network/interfaces

Then change the following line:

iface eth0 inet dhcp

to:

iface eth0 inet static
     address 192.168.1.100
     netmask 255.255.255.0
     network 192.168.1.0
     broadcast 192.168.1.255
     gateway 192.168.1.254

This is an example only - Obviously you’ll need to work out what to use for each yourself ;)

Share bookmark

Sep 18 2007

Installing Trac and some plugins

Tag: Apache, Linux, Programming, SubversionGrant Perry @ 10:44 pm

Trac is a popular open source issues management system written in Python. It also features a wiki and subversion browser. There are also countless plugins that have been created for it some of which I’m surprised aren’t included in the base install.

I’m installing this on a Ubuntu server, so you may need to find installation instructions to suit your distribution! To install the packages:

apt-get install trac libapache2-mod-python

Now to setup our first Trac project:

mkdir /var/trac
trac-admin /var/trac/example initenv

The last command will step you through some questions:

Project name - Being creative I named mine “Example“.
Database connection string - I hit enter using the default.
Repository type - I hit enter using the default as mine is SVN.
Path to repository - My repository for this example was /var/svn/example.

Next you’ll need to make sure your web server can access the files:

chown -R www-data /var/trac/

There are two ways of serving Trac through your web server one using CGI the other using the mod_python which I’ll be using. Include the following in your apache config:

 <Location /trac>
     SetHandler mod_python
     PythonHandler trac.web.modpython_frontend
     PythonOption TracEnvParentDir /var/trac
     PythonOption TracUriRoot /trac
 </Location>

This doesn’t include any security as you’ll see in most install tutorials. This is because I plan on installing a plugin to make use of a web based form log in instead.

If you restart apache then open http://ip-address/trac/ in your web browser you should see you list of Trac projects. Log in won’t work yet so we’ll continue…

Installing some Trac plugins

Now we’ll install some plugins you really can’t live without! We’ll start with WebAdmin which an interface for trac-admin command line utility. This would normally be used for adding component names to your projects - something you really should have to drop to a shell for! I’ll also install the AccountManagerPlugin while I’m at it…

First we need to configure the server to be able to install python eggs! This is how all of the Trac plugins are packaged…

apt-get install python-dev
cd /tmp
wget http://peak.telecommunity.com/dist/ez_setup.py
python ez_setup.py

Now that thats done lets get the plugins installed! Please note you may need to refer to the plugin websites to ensure you’re using the correct repository for your version of Trac.

easy_install http://svn.edgewall.com/repos/trac/sandbox/webadmin/
easy_install http://trac-hacks.org/svn/accountmanagerplugin/0.10

Now that these are installed we need to configure our Trac project to make use of them!

Open the trac.ini file inside under the /conf/ directory of your Trac project. Mine is located at /var/trac/example/conf/trac.ini

[components]
trac.web.auth.loginmodule = disabled
webadmin.* = enabled
acct_mgr.* = enabled
acct_mgr.web_ui.RegistrationModule = disabled
 
[account-manager]
password_format = htpasswd
password_store = HtPasswdStore
password_file = /var/trac/trac.htpasswd

We should setup that password file and create our first account:

htpasswd -c /var/trac/trac.htpasswd admin
trac-admin /var/trac/example permission add admin TRAC_ADMIN

Some plugins also use caching if you don’t follow this next step you’ll run in to some nasty errors (Permission denied: ‘/root/.python-eggs’) ! This is because the web server can’t write to the location they use by default… So:

mkdir /tmp/trac-cache
chown www-data /tmp/trac-cache/

Then include this line in your apache config along with the others for the /trac directory.

SetEnv PYTHON_EGG_CACHE /tmp/trac-cache

Then restart apache and cross your fingers!

Update!

After my success with this install I started looking at Trac-Hacks through all of the other plugins and also decided to install the following (I’ll update this as I find others):

Share bookmark

Sep 18 2007

WebSVN installation and customisation

Tag: SubversionGrant Perry @ 7:28 pm

WebSVN is a PHP based web interface to your Subversion repositories. Its official description is:

WebSVN offers a view onto your subversion repositories that’s been designed to reflect the Subversion methodology. You can view the log of any file or directory and see a list of all the files changed, added or deleted in any given revision. You can also view the differences between 2 versions of a file so as to see exactly what was changed in a particular revision.

You can also use custom templates with it! While the standard on is functional, I’ve chosen to setup the Calm Theme for WebSVN. As you see below its far more than just functional… beautiful even…

Calm theme for WebSVN

WebSVN installation

I’m using Ubuntu as my server but hopefully your distribution has WebSVN available in their repositories as well. You may just have to look for instructions more suited to your distribution! To install:

apt-get install websvn

As apart of this installation you’ll be asked to configure WebSVN (screens below).

WebSVN configuration screen 1 WebSVN configuration screen 2 WebSVN configuration screen 3

For these three screens:

  1. You need to select your web server for configuration.
  2. You can specific the parent path of your subversion repositories. If you don’t want them all available leave this blank.
  3. You can specific the individual repositories separated by a comma instead of specifying the parent folder. Otherwise leave this blank.

I’m using Apache 2 and I decided to make my repositories all available so I entered /var/svn on the first screen (the default folder for most people is /var/lib/svn). This can be modified later in /etc/websvn/svn_deb_conf.inc.

The rest of the installation was simple for me! By default the WebSVN places the application in /var/www/websvn/ and Apache is already serving /var/www/ for me.

All I did was add the same authentication as my /svn/ directory by adding the following in to the apache config.

<Location /websvn>
   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/apache2/dav_svn.passwd
   Require valid-user
</Location>

Calm theme setup

Use wget to download then gunzip and tar to explode the files. You can get the theme from the Calm Theme for WebSVN web page. Then copy the template in to the WebSVN directory:

mv calm-theme-for-websvn/ /var/www/websvn/templates/calm-theme-for-websvn

Then to setup the location of the template you want WebSVN to use. Open /etc/websvn/config.inc changing:

$config->setTemplatePath("$locwebsvnreal/templates/Standard/");

to

$config->setTemplatePath("$locwebsvnreal/template/calm-theme-for-websvn/");
Share bookmark

Sep 18 2007

Fixing linux network interfaces on VMware

Tag: Linux, VMwareGrant Perry @ 4:59 pm

When downloading a few Virtual Appliances I’ve found they haven’t had network connectivity ‘out of the box’. I’ve only noticed this with Ubuntu servers so far but admittedly I haven’t downloaded a lot of other flavors!

This appears to be because the MAC address for eth0 is different to the one of the creators VMware Server. Using the following command you’ll notice eth1 is seen instead:

ifconfig -a

I then just simply copied the MAC address shown and updated the MAC address listed against eth0 in /etc/iftab. Then restart the server.

Share bookmark

Sep 18 2007

Upgrade Ubuntu distribution

Tag: Linux, Operating systemsGrant Perry @ 4:50 pm

Firstly update the your repositories replacing with “breezy” with “dapper” for example. You can work out the release names and additionally even change the URL’s to a closer mirrors by referring to the official repository list. This can be done using:

vi /etc/apt/sources.list

If you’re not familiar with vi, ESC leaves editing mode and INS enters editting mode. To save and quit when not in editing mode use:

:wq

To update the sources list then upgrade your distribution use the following commands after each other:

apt-get update
apt-get dist-upgrade

Double check the the upgrade using:

apt-get -f install

Then reboot to make all your upgrades take effect:

shutdown -r now

Using the following command will then confirm your server’s version:

lsb_release -a

Update!

I’ve since found out the method above is not the recommended process for upgrading please refer to the preferred process using update-manager-core. Additionally the process I used above has been officially documented on the Ubuntu help site.

Share bookmark

Sep 17 2007

Defrag and Shrink VMware disks

Tag: VMwareGrant Perry @ 7:25 pm

The vmware-vdiskmanager.exe that comes with VMware Server can defrag and shrink your virtual drives.. But to make life easier check out these automated BAT files someones written to help out with the tasks. But remember not run this on VM’s that have snapshots!!

Share bookmark

« Previous PageNext Page »


Close
E-mail It