JC Web Concepts

Setting Up Blogofile

Blogofile is a simple blogging engine that brings something nice without the use of a database. I have been testing this out and I am starting to like this. I have even been thinking of replacing it with this. I am really enjoying this framework. Go ahead and watch this video below. After the video I will post the step by step instructions just in case you do not want to watch how to do it.

Moving Your SVN Repo

One of the things that I sometimes have to do is move an SVN repo to another server or you just want to back it up. This tutorial will show you how to do this.

svnadmin dump /pathToYourRepo > reponame_dump
Example: svnadmin dump /var/svn/mywebsite > mywebsite_dump

So now you want to go move this file to your new server and create your subversion repo. Make sure you use the same name as the old one. Go to folder where you uploaded your dump file to and do the following:

svnadmin load /pathToYourRepo < reponame_dump
Example: svnadmin dump /var/svn/mywebsite < mywebsite_dump

So there you go. In this tutorial I did not include setting up the subversion server cause I made the assumption you know how to do this since you already have an SVN repo setup.

Zenoss MySQL Database

One of the things I never understood after installing Zenoss, was where is this mysql database. I found out that with Zenoss it sets up it’s own MySQL server and it is even smart to put it on a different port. So lets say you want to access this database and see what it looks like. This can be done by doing the following:

su zenoss
mysql -u zenoss -p

Just enter the password for your zenoss database and then you can have access to the MySQL server. Hope this helps out someone.

Zenoss Local Templates

One of the coolest things I learned today was about creating local templates for specific devices. So lets say you have 5 Linux boxes and and only 2 are running apache. I do not need to graph apache stuff on my 3 other boxes. So I go into the device that I want to have its own version of the template and click on the down arrow and go to more. Then click on templates. You will now see all the templates that are bound to the device class. The one that you want to change to the specific device click on Create local copy. Now you can edit that template and it will only make changes for that device. I am telling you that Zenoss is just a great piece of software.

Zenoss Training

Today I went to a Zenoss training in Baltimore MD. This is a training that usually costs around $1500 USD to attend. They are offering this one day training session for free. As soon as I heard this I said where do you sign me up. Of course I have a 2 hour drive in rush hour to get to inner harbor but I will tell you it is worth it. So I thought I would share some highlights and my thoughts about how this training went.

Traveling
Well according to Google Maps , it would take me about an hour and half. With traffic believe it or not it only took about 2 hours. The hotel was easy to find and parking was not expensive at all.

Training Itself
Well lets get to the reason why you are reading this blog post. I really liked this training. The slide show presentation was done well. It started off by explaining the backend and how Zenoss works. Then they got into each section and explain how they work. I did feel it went a little fast but we only had so many things to cover is such a little time. There were a few questions which kinda took us off course, but the trainers got it back on track really fast.
The only con I had from the whole thing was the amount of time we had. Due to this we really could not drill down on certain things. The trainers did a great job in explaining the basic to give you the idea on how it works. I am very interested in possibly taken the paid training. Honestly if you have an opportunity to attend one of these you should. It is worth the traveling time and any feels involved.

Gifts
When I got there they had a bag of gifts to give everyone. I got a 4GB pen drive, a pen, Zenoss sticker, Zebra stress toy, and a Zenoss shirt. They also provided a great lunch. Thanks again to Zenoss team. Take a look at their website for more information on the product.

Zenoss

Zenoss is a monitoring tool that everyone should start to look at. In the past when you mention system monitoring software, people would say Nagios . Now do not get my wrong there is nothing really wrong with Nagios but it lacks somethings for my taste. Now I could continue on with comparing Nagios to Zenoss but this is not what I am looking to do in this blog post. I want to share with you the features that have attracted me to start using Zenoss.
First thing I like is the support for getting help with Zenoss. On freenode via IRC, the #zenoss room is filled with people who are will to help you with your struggles. I would mention some names but I will leave that for the reader to decide if they every have to visit there. The next thing I really like is that when you are setting it up for the first time you can put in your subnet or IP range and it will scan for all available devices. I got my devices added within 5 minutes of getting into the interface. GUI administration is something also that I really like. Now I know there are a ton of command line guys out there but sometimes is makes it easier. It also helps if some people you work with do not like the command line. I really like the Google map API interface that will let you map out your servers and see them on a map of the world. If you were like me and have some older servers that finding packages for are just a little bit hard; Then you are in luck. With Zenoss you can run commands via SSH. Now the cool thing is that you can specify your username and password so there is no copying your RSA keys or anything like that. Now I am starting to catch on to the SNMP protocol which I use for my newer machines. SNMP will give you more data than the SSH commands will. You can also connect to Windows computers with the username and password from that box as well. Another big thing I like is that you can get graphs from one application. So no need to run Nagios and Cacti.

There are tons more features that could make this into a novel to post about. Zenoss has already done this with their PDF manuals. Go ahead and download them here . Trust me you will love this system monitoring tool.

Setup SVN Server

SVN (which stands for Subversion) is a version control system. So let me speak some english here for you. Lets say you make a website for a customer. When you are finished it is version 1. A month or so later the customer calls you back and wants to add a page or 2. This would then be version 2. So you upload ver 2 to replace ver 1 and the customer hates it. Oh my I did not back up ver 1 and there are many changes that happened. Well if you are using SVN you can go in and tell the code to revert back to ver 1 and then upload those files and you are a happy camper.
Well with the quick explaining what the SVN is, now lets show you how to setup the server for this. I will be installing this on a Ubuntu 9.04 box. I have tested this way with versions 8.04 and 8.10. Now I am assuming that you have Apache 2 and up already installed and configured. Lets installing the app Subversion and install the apache module libapache2-svn

sudo apt-get update
sudo apt-get install subversion libapache2-svn

Now that we got that installed lets add a new group for subversion

sudo addgroup subversion

Next we make a main directory that will hold all of our SVN. You can have multiple sites or repositories as they are called for different sites or projects

sudo mkdir /home/svn

Note There is really no wrong place that you can setup the svn directory

Now we just need to make some permission changes to the directory we just made

sudo chown -R www-data:subversion /home/svn
sudo chmod -R g+rws /home/svn

Next we are going to create the SVN. For this example I will name the SVN myWebsite . Now you can name your repository pretty much anything you want.

sudo svnadmin create /home/svn/myWebsite

We now have the SVN setup but now we need to get this configure so users can now connect to this SVN. We now need to edit /etc/apache2/mods- available/dav_svn.conf and make some changes to that file. You can add the following to the end of the file

DAV svn
SVNPath /home/svn/myWebsite
AuthType Basic
AuthName "myWebsite subversion repository"
AuthUserFile /etc/subversion/passwd
Require valid-user

If you have multiple repositories you would just add another section and change myWebsite to the name of the other repo. Now lets add 2 username and passwords that can connect to the SVN.

sudo htpasswd -c /etc/subversion/passwd jcostanzo
# You are prompted for the password. Go ahead and make one up
sudo htpasswd /etc/subversion/passwd bsmith
# Notice we took out the -c This is due to the -c is a flag that creates the passwd file

Lets go ahead and finish up

sudo chown -R www-data:subversion myWebsite
sudo chmod -R g+rws myWebsite
sudo /etc/init.d/apache2 restart

That is it. You know have a working SVN server. In a later tutorial I will show you how to setup an SVN client to connect to this repositories. Below is a youtube video showing you how to do what I described above.