Archive for October, 2011

How to install gitweb in Ubuntu

After being told that I live in the stone age for using svn, I decided to try out git. Finally I got some time to continue learning git and setting the new environment. As a step one, we learned how to install git on Ubuntu. Then, I decided that I wanted to host my own repositories and we learned how to set up gitosis on Ubuntu. Now, after updating to Ubuntu 11.10 – Oneiric Ocelot, I am ready to continue setting up everything I need to start conveniently using git. So, in this post, I will be setting up the gitweb and documenting the process.

Gitweb is a convenient GUI that allows us to quickly see the project and diffs right in the browser. Before we move on to installing git web, make sure you have installed apache. Now, lets move on to installing gitweb:

sudo apt-get install gitweb

Now lets look in our /var/www folder:

cd /var/www

ls

I didn’t have gitweb folder here, so I created it:

sudo mkdir /var/www/gitweb

gitweb files should be in /usr/share/gitweb and we need them in our /var/www/gitweb, so lets create a symbolic link that will point to the files:

cd /var/www/gitweb

sudo ln -s /usr/share/gitweb/* .

To check if these are symbolic links, you can type:

ls -l

it should show what these files are linked to.

Next, locate the path to your git repositories. As per our install, we have it in /home/git/repositories. So, lets edit gitweb config to point to the right directory:

sudo gedit /etc/gitweb.conf

and replace:

$projectroot = "/var/cache/git";

to our path to git repositories, /home/git/repositories in my case to:

$projectroot = "/home/git/repositories";

Save the file and lets move on to next step – editing apache configuration. Open apache config for gitweb:

sudo gedit /etc/apache2/conf.d/gitweb

And edit it as follows (replace the paths if yours are different):

    RewriteEngine on
    RewriteRule ^/gitweb/([a-zA-Z0-9_\-]+\.git)/?(\?.*)?$ /cgi-bin/gitweb.cgi/$1 [L,PT]

    Alias /gitweb /home/git/repositories

    Options Indexes FollowSymlinks ExecCGI
    DirectoryIndex /cgi-bin/gitweb.cgi
    AllowOverride None

and save. Now its time to restart apache to apply the changes:

sudo /etc/init.d/apache2 restart

I got an error at first saying:

Syntax error on line 1 of /etc/apache2/conf.d/gitweb:
Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!

Which was because I needed to add rewrite package to apache:

sudo a2enmod rewrite

This time apache started with no errors.

Now you should be able to go to http://localhost/gitweb and see the gitweb page. If you have no public repositories yet, you may see “404 – No projects found” notice. To test it out, I went to my repo folder:

cd /home/git/repositories/

and changed the permissions on my gitosis-admin.git:

sudo chmod -R 755 gitosis-admin.git

Refresh the localhost/gitweb and ta-da! It shows a repository where I could click around and check things out. Since I didn’t want this repo to show publicly, I had to change the permissions back to:

sudo chmod -R 750 gitosis-admin.git

This is it for now. In the next git series posts I will try to go over creating new repositories, adding users, general git usage, installing redmine for project management and anything else I may find useful.

How to restore Unity when it disappears in Ubuntu 11.10

Well, after playing around the compizConfig Setting Manager I somehow screwed up the whole system. Unity along with any kind of menu was gone. Terminal Windows did not come up when pressing ALT+F# and even ctrl+alt+delete were not working. The only way terminal was able to come up was by pressing Ctrl+Alt+T . I did

unity --reset

but it did not work. What worked for me was typing:

ccsm

and enabling it again, disabling everything else that was conflicting. Hope this helps in case you are looking for the solution. 🙂

How to configure Unity in Ubuntu 11.10

I have been poking around the new Unity settings in Oneiric Ocelot.

First, check if you have compizconfig settings manager. If not, install by typing the following command in the terminal window:


sudo apt-get install compizconfig-settings-manager

Then go to unity dash and start typing compiz – it should show you the settings manager. Click it and go to “Desktop” options. I guess unity is a part of compiz now and this is where you can find “Ubuntu Unity Plugin” settings to edit the appearance.

I am kind of upset to see that there is no option to move the dock around. 🙁

Ubuntu Oneiric Ocelot – 11.10 review

Ububtu Oneiric Ocelot - 11.10

Ububtu Oneiric Ocelot - 11.10

As you all may know, the new version of Ubuntu was released on October 13, 2011, which is just over a week ago as of the time of writing this post. I wanted to upgrade right away, but decided to wait a bit for the user response as upgrades don’t always go smooth. Well, this one worked like a charm for me.

It took a little over an hour to perform the full upgrade. I made a backup just in case, which I also recommend doing. So far just a few programs need to be reinstalled. A ton of packages got deleted, but it’s mostly because they have a newer and improved versions.

As for the changes, the first thing I noticed was the desktop. It does look a lot better due to improved unity shell. I remember how much I hated it with the last upgrade when it just got added to Ubuntu and I am still not a big fan of it. It is, however, a lot more convenient and clean. I went from “definitely removing” to “may be I’ll poke around and keep it for a while”. I also don’t like the dock sitting on the right side, but I still have to look if I can relocate and change the size of it. The dash interface became a lot more usable too.

There are a few other small, but noticeable improvements, such as a new gnome login screen, login manager now uses LightDM.  Overall performance got slightly improved. Default mail client is now mozilla Thunderbird. Ubuntu now has a better support of 32 bit apps on 64 bit systems. It has a new backup client, which I still have to look into as it looks like they give you 5gb of online storage for free. Improved software center looks a lot better. These are just a few changes that I was pleased with.

There are other changes, but I think these are the biggest ones, at least for me. I like where it is going and will be waiting patiently for the next release. I want to see more improvements to unity as it looks like they put more focus on it now and it is here to stick.