Install Rancid and ViewVC on Centos 7

In this post I want to walk though the steps to install Rancid on CentOS 7 minimal. Rancid is a great tool to help monitor a device configuration for any changes. It also keeps track of them by using CVS (Concurrent Version System) for backups, so you can go back and compare versions or revert to a previous configuration. Rancid supports multiple hardware from Cisco, HP, Dell, Juniper and more. This is all open-source so you can create custom scripts or add commands to really make this a personal repository that fits your company.Β  During this install guide several things are required when we install Rancid, I have tired to make this as simple as possible but its not just a type and watch it install. You have to customize some of the scripts to make Rancid work like it should. Read it though and follow along.

So I’m already assuming that you have CentOS 7 minimal installed, with connection to the internet, and have just the root account with a password. You can pick up the latest CentOS at http://www.centos.org/

Login as the root account and let’s update this thing and accept any updates before we do anything else.

yum update

We now need to install all the prerequisites needed for Rancid and some other tools we’ll need for troubleshooting (if needed)

yum install nano wget ftp telnet mariadb-server mariadb perl tcl expect gcc cvs rcs httpd autoconf php-common php-gd php-pear php-pecl-memcache php-mysql php-xml mod_ssl MySQL-python

Since we installed Apache we will want to change the firewall rules on our system to allow HTTP and (HTTPS if we want it)

Allow HTTP:

firewall-cmd --permanent --zone=public --add-service=http

Allow HTTPS:

firewall-cmd --permanent --zone=public --add-service=https

Reload the Firewall to save changes

firewall-cmd --reload

Enable the Apache service to start on bootup and let’s start it up for the first time.

systemctl enable httpd.service
systemctl start httpd.service

After you enable Apache you should see a sample webpage from Apache when you browse to your server’s IP address with a browser. We now need to add a group for the rancid user.

groupadd netadm

Next we will create a user called rancid and put this user under the group we just created which is netadm. We will also put in the home directory for this rancid user.

useradd -g netadm -c "Networking Backups" -d /home/rancid rancid

Let’s be a little organized and create a directory to put all of our installation files. Once created let’s change directories to that tar folder we just created.

mkdir /home/rancid/tar

Move to the tar folder

cd /home/rancid/tar/

We will download the latest version of Rancid which at the time of this writing is 3.1
(3-1-16) UPDATE: Current version is 3.4.1 I updated the download paths below, πŸ™‚

wget ftp://ftp.shrubbery.net/pub/rancid/rancid-3.4.1.tar.gz

Extract the tar ball we just downloaded:

tar -zxvf rancid-3.4.1.tar.gz

Move into the rancid-3.1 folder:

cd rancid-3.4.1

Run/type in the following followed by enter. This get’s Rancid ready for install.

./configure --prefix=/usr/local/rancid

After all of the output clears run the install.

make install

Now let’s copy and modify some permissions

cp cloginrc.sample /home/rancid/.cloginrc
chmod 0640 /home/rancid/.cloginrc
chown -R rancid:netadm /home/rancid/.cloginrc
chown -R rancid:netadm /usr/local/rancid/
chmod 775 /usr/local/rancid/

We have to edit the rancid configuration file and put our devices in groups. Find “list of rancid groups” and uncomment it. Type in the groups you would like, for example (Routers Switches)

nano /usr/local/rancid/etc/rancid.conf
...
# list of rancid groups
LIST_OF_GROUPS="Routers Switches"
# more groups...
#LIST_OF_GROUPS="$LIST_OF_GROUPS noc billybobisp"
#
...

Switch to the Rancid user account

su -rancid

Run the following, this creates a CVS Repository with the groups you just entered in the List of Groups.

/usr/local/rancid/bin/rancid-cvs

No conflicts created by this import

cvs checkout: Updating Routers
Directory /usr/local/rancid/var/CVS/Routers/configs added to the repository
cvs commit: Examining configs
cvs add: scheduling file `router.db' for addition
cvs add: use 'cvs commit' to add this file permanently
RCS file: /usr/local/rancid/var/CVS/Routers/router.db,v
done
Checking in router.db;
/usr/local/rancid/var/CVS/Routers/router.db,v  --  router.db
initial revision: 1.1
done

No conflicts created by this import

cvs checkout: Updating Switches
Directory /usr/local/rancid/var/CVS/Switches/configs added to the repository
cvs commit: Examining configs
cvs add: scheduling file `router.db' for addition
cvs add: use 'cvs commit' to add this file permanently
RCS file: /usr/local/rancid/var/CVS/Switches/router.db,v
done
Checking in router.db;
/usr/local/rancid/var/CVS/Switches/router.db,v  --  router.db
initial revision: 1.1
done
[rancid@rancid ~]$

After the command runs logout of Rancid user and go back to root. Move back to TAR folder.

cd /home/rancid/tar/

Next we will want to download ViewVC and as of this writing the latest the version is 1.1.23.
(3-1-16) UPDATE: Current Version of ViewVC is 1.1.24, I updated the paths below, πŸ™‚

wget http://viewvc.tigris.org/files/documents/3330/49471/viewvc-1.1.24.tar.gz

Extract the tarball

tar -zxvf viewvc-1.1.24.tar.gz

Move to the ViewVC folder and run the installer, accept the defaults.

cd viewvc-1.1.24
./viewvc-install

We now need to modify the ViewVC configuration file, basically telling ViewVC where the CVS repo is.

nano /usr/local/viewvc-1.1.24/viewvc.conf

Find the following and edit as shown below:

...
## Example:
## cvs_roots = cvsroot: /opt/cvs/repos1,
##             anotherroot: /usr/local/cvs/repos2
##
#cvs_roots = cvs:

## svn_roots: Specifies each of the Subversion roots (repositories) on
## your system and assigns names to them. Each root should be given by
...
## Example:
## root_parents = /opt/svn: svn,
##                /opt/cvs: cvs
##
root_parents = /usr/local/rancid/var/CVS : cvs

## default_root: This is the name of the default root.  Valid names
...
## Example:
## rcs_dir = /usr/bin/
##
rcs_dir = /usr/local/bin

## cvsnt: Location of cvsnt program.  ViewVC can use CVSNT (www.cvsnt.org)
...
## use_rcsparse: Use the rcsparse Python module to retrieve CVS
## repository information instead of invoking rcs utilities [EXPERIMENTAL]
##
use_rcsparse = 1
...

We need to copy some files and change permissions for ViewVC.

cp /usr/local/viewvc-1.1.24/bin/cgi/*.cgi /var/www/cgi-bin
chmod +x /var/www/cgi-bin/*.cgi
chown apache:apache /var/www/cgi-bin/*.cgi

For this example we will use HTTP for ViewVC, although you could use HTTPS just have to modify the Apache (HTTPD file)

nano /etc/httpd/conf/httpd.conf

I put the following at the bottom of the HTTPD file

# Custom Rancid Config
<VirtualHost *:80>
        DocumentRoot /var/www
        ScriptAlias /cgi-bin/ "/var/www/cgi-bin"
        ScriptAlias /viewvc /var/www/cgi-bin/viewvc.cgi
        ScriptAlias /query /var/www/cgi-bin/query.cgi
<Directory "/var/www/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

We are almost done, we now need to turn on Mariadb which ViewVC uses, and start up the secure installation. (Accept all defaults and type in a root password for MariaDB.

systemctl enable mariadb
systemctl start mariadb
sudo mysql_secure_installation

Go back into MariaDB and create a ViewVC user and use the password you just created.

mysql -u root -p

Enter the following: (Replace YourPassowrdHere with something else)

CREATE USER 'VIEWVC'@'localhost' IDENTIFIED BY 'YourPasswordHere';
GRANT ALL PRIVILEGES ON *.* TO 'VIEWVC'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

Make the ViewVC Database with the username and password you just created. (Accept the defaults)

/usr/local/viewvc-1.1.24/bin/make-database
MySQL Hostname (leave blank for default):
MySQL Port (leave blank for default):
MySQL User: VIEWVC
MySQL Password: YourPasswordHere
ViewVC Database Name [default: ViewVC]:

Database created successfully.  Don't forget to configure the
[cvsdb] section of your viewvc.conf file.

Go back to MariaDB (MySQL) with the root password

mysql -u root -p

Create a Read-Only account for ViewVC on the MySQL database. (Replace YourROPassowrdHere with something else)

CREATE USER 'VIEWVCRO'@'localhost' IDENTIFIED BY 'YourROPasswordHere';
GRANT SELECT ON ViewVC.* TO 'VIEWVCRO'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
quit

We now need to configure the ViewVC configuration file with the user names and passwords to that we created in MySQL.

nano /usr/local/viewvc-1.1.24/viewvc.conf

Find cvsdb and change it to something like this:

##---------------------------------------------------------------------------
[cvsdb]

## enabled: Enable database integration feature.
##
enabled = 1

## host: Database hostname.  Leave unset to use a local Unix socket
## connection.
##
host = localhost

## post: Database listening port.
##
port = 3306

## database_name: ViewVC database name.
##
database_name = ViewVC

## user: Username of user with read/write privileges to the database
## specified by the 'database_name' configuration option.
##
user = VIEWVC

## passwd: Password of user with read/write privileges to the database
## specified by the 'database_name' configuration option.
##
passwd = YourPasswordHere

## readonly_user: Username of user with read privileges to the database
## specified by the 'database_name' configuration option.
##
readonly_user = VIEWVCRO

## readonly_passwd: Password of user with read privileges to the database
## specified by the 'database_name' configuration option.
##
readonly_passwd = YourROPasswordHere

Run the following command to build the Database.

/usr/local/viewvc-1.1.24/bin/cvsdbadmin rebuild /usr/local/rancid/var/CVS/CVSROOT/

Reboot the server once online you should be able view the Repository at http://rancid-servicer-ip/viewvc

Screenshot of ViewVC using Rancid
Screenshot of ViewVC using Rancid

If you see the groups that we created we looking good so far. To finish this installation off we need to setup Rancid to send emails. Usually you have to add the Rancid to the allowed senders list on your email infrastructure. Rancid uses aliases to send emails we need to edit the aliases file.

nano /etc/aliases

Depending on your infrastructure you might have different teams of people for different equipment that rancid is monitoring. Or you are running one-man-shop either way you can specify. In this example I’m using only one email address and created a new aliases called Rancid all of this is at the bottom of the aliases file.

# Custom Rancid Configuration (Put an Email Here)
rancid:         emailaddress@goeshere.com

# Custom Rancid Configuration
rancid-admin-Routers: rancid
rancid-Routers: rancid
rancid-admin-Switches: rancid
rancid-Switches: rancid

Depending on what you created in your List of Groups in the rancid configuration file you might have more or less. (In this example we just created Routers and Switches) We must specify these in the aliases file otherwise Rancid wont send emails for these groups. Once we are done editing you want to let our Rancid box know about the new aliases we just created. Type in the following command to update.

newaliases

In this example postfix is already installed so we just need to edit the postfix configuration file.

nano /etc/postfix/main.cf

Find and uncomment “relayhost” and type either the domain name (if you have MX records) the FQDN or IP address of your email system.

relayhost =  mycompanydomain.com
relayhost = email.mycompanydomain.com
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]

Start up posfix and enable it on boot

systemctl start postfix
systemctl enable postfix

Finished! We have just installed Rancid along with made some helpful tweaks like getting an upfront web page to view the configurations instead of CLI as well as setting up Rancid to email us if anything changes or if there are issues with connecting to any equipment. I’ll put the brakes here and in the next post we will go over how to customize rancid to log into devices and grab configurations. I hope this install guide is helpful and let me know if you have any questions. Enjoy New Year! πŸ™‚

If you can’t wait for me then you can check Shrubbery at http://www.shrubbery.net/rancid/
Read the README file once you download Rancid.

You can also check threads from Rancid Discussions at http://www.gossamer-threads.com/lists/rancid/

Advertisements

62 thoughts on “Install Rancid and ViewVC on Centos 7

    • Brad S July 29, 2015 / 8:08 am

      This was a great how to and saved me a lot of time! Thank you

      • Ryan July 29, 2015 / 7:49 pm

        Glad it worked out!

    • Ryan March 6, 2015 / 1:31 pm

      In this version I’m using Rancid 3.1 with Expect version 5.45. I have not experienced any of the hangs like mentioned above. The TCL version I’m using is 8.5.13. Maybe its fixed?

      Just in case if anyone wants to check:
      To check the Expect version run: expect -v
      To check TCL version go type tclsh followed by typing info patchlevel

      Thanks for bringing it up πŸ™‚

  1. Ben May 6, 2015 / 2:21 pm

    First off thanks so much for the detail you put into these instructions. I am hoping though, you might be able to help with an error I’m getting. I went through your list without incident until the first reboot and attempting to browse to rancid-ip/viewvc which returns a traceback error.


    Python Traceback

    Traceback (most recent call last):
    File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 4848, in main
    request.run_viewvc()
    File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 402, in run_viewvc
    self.view_func(self)
    File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 2202, in view_roots
    allroots = list_roots(request)
    File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 4698, in list_roots
    cfg.utilities, cfg.options.use_rcsparse)
    File "/usr/local/viewvc-1.1.23/lib/vclib/ccvs/init.py", line 56, in CVSRepository
    rootpath = canonicalize_rootpath(rootpath)
    File "/usr/local/viewvc-1.1.23/lib/vclib/ccvs/init.py", line 17, in canonicalize_rootpath
    assert os.path.isabs(rootpath)
    AssertionError

    I’ve tried googling and found only one forum poster with an identical error.. he says that he resolved his by modifying ‘rcs_dir = /usr/local/bin’ to ‘rcs_dir = /usr/bin’

    Which I did after LS’ing and finding out that /usr/local/bin was empty. However after another reboot the error persists.

    Any ideas would be awesome.. this is my second attempt at a successful config and I’m getting frustrated.

    Thanks!

    • Ryan May 6, 2015 / 8:01 pm

      Hey Ben,
      Usually this is some type of permission issue with either apache or the rancid user. You may want to also post your problem at http://www.gossamer-threads.com/lists/rancid/ might get someone better than me πŸ™‚

      Check the areas where you had to modify permissions like the cgi-bin folder (Apache should be the owner here)
      [root@rancid ~]# ls -l /var/www/cgi-bin/
      total 8
      -rwxr-xr-x. 1 apache apache 1782 Jan 1 05:55 query.cgi
      -rwxr-xr-x. 1 apache apache 1781 Jan 1 05:55 viewvc.cgi

      Also what Python version are you running? In this example it was:
      [root@rancid ~]# python -V
      Python 2.7.5

      Check to make sure you have RCS installed:
      [root@rancid ~]# yum install rcs
      Loaded plugins: fastestmirror
      Loading mirror speeds from cached hostfile
      * base: mirror.raystedman.net
      * extras: mirror.netdepot.com
      * updates: mirrors.kernel.org
      Package rcs-5.9.0-5.el7.x86_64 already installed and latest version
      Nothing to do

      I would also try to run rancid manually and have it connect to a device to see if you can get diffs just in CLI. That would help because then its likely something wrong with just Apache/ViewVC. What I’ll do is do a fresh install of Rancid on Centos 7 and see if I run into this problem, but I won’t be able to really look at until next week sometime.

      Good Luck and don’t get too frustrated πŸ˜‰
      Ryan

  2. Ben May 7, 2015 / 6:14 am

    Thanks Ryan.. Actually what I wound up doing was deleting the vhd and starting over from scratch with your page. I actually have it all working save one thing.. Rancid actually creating the config files. My boss is pushing DR and I won;t have a whole lot of time left in the near future to work on this so thats why I decided to start all over. But yeah I can run clogin x.x.x.x and end up with a responsive ssh prompt to that switch. But rancid-run generates nothing at all, even an empty log file.

  3. Ben May 7, 2015 / 11:33 am

    I figured it out Ryan. The router.db files formatting needs semi colons instead of colons.

  4. bobby May 22, 2015 / 2:33 pm

    What are you using Maria-db for?

  5. Kenan GΓΌlle (@KenanGulle) May 23, 2015 / 4:14 am

    [rancid@raancid root]$ bin/clogin 192.168.1.1
    bash: bin/clogin: Permission denied

    view error help me 😦

  6. mlf May 26, 2015 / 8:01 am

    It just worked with RHEL 6.5. After many attempts with other guides this one was just amazing. Thanks Ryan.

    • Ryan May 28, 2015 / 8:13 pm

      No Problem πŸ™‚

  7. Dan June 25, 2015 / 8:02 pm

    This is a fantastic guide. One of the best I have read in a long time. Thank you.

  8. sunny August 22, 2015 / 2:43 am

    Hi,

    Fantastic guide to install rancid and view VC. I am fairly new to linux and was able to set this up readin this guide.

    Well. now ihave certain devices belonging to cisco-sb type and trying to set that up i had to play a lot with the software and configs. I was able to set it up finally. Now i have quite a few revisions in ViewVC. Is there a way to clear all the revisions so that when i run ‘rancid-run’ next, the first revision i.e. 1.1 should have all devices config in it.

    I guess creating a new database should do it but want to get expert opinion. Please let me know. Any help would be much appreciated.

  9. Abhinav Bahri November 6, 2015 / 1:32 pm

    Hi

    I am getting this error

    “OSError: [Errno 13] Permission denied: ‘/usr/local/rancid/var/CVS'” while running viewvc on browser..

    directory permissions are,
    drwxrwxr-x. 4 rancid netadm 4096 Nov 6 09:02 CVS

    Any help will be appreciated.

    Thanks
    Abhinav

    • Ryan November 9, 2015 / 9:09 pm

      Hey Abhinav,
      Permissions look right as I just checked on my sample box but it just sounds like some type of permission issue It might be something with the viewvc.conf file. Can you verify that you made the correct changes as what I have outlined below. Try that. Ryan

      Find the following and edit as shown below:


      ## Example:
      ## cvs_roots = cvsroot: /opt/cvs/repos1,
      ## anotherroot: /usr/local/cvs/repos2
      ##
      #cvs_roots = cvs:

      ## svn_roots: Specifies each of the Subversion roots (repositories) on
      ## your system and assigns names to them. Each root should be given by

      ## Example:
      ## root_parents = /opt/svn: svn,
      ## /opt/cvs: cvs
      ##
      root_parents = /usr/local/rancid/var/CVS : cvs

      ## default_root: This is the name of the default root. Valid names

      ## Example:
      ## rcs_dir = /usr/bin/
      ##
      rcs_dir = /usr/local/bin

      ## cvsnt: Location of cvsnt program. ViewVC can use CVSNT (www.cvsnt.org)

      ## use_rcsparse: Use the rcsparse Python module to retrieve CVS
      ## repository information instead of invoking rcs utilities [EXPERIMENTAL]
      ##
      use_rcsparse = 1

      • Alex December 16, 2015 / 7:13 am

        Hi,

        I have the same problem as Abhinav. I’ve edited the viewvc.conf file as shown in the guide. I’ve also tried to use cvs_root and default_root instead of root_parents and it didn’t work either.

        What else can be the problem ?

        Cheers,
        Alex

      • Ryan December 16, 2015 / 7:29 pm

        Hey Alex,
        What is your permissions on that directory “/usr/local/rancid/var/CVS”? This is likely the issue, I can reproduce the issue if “Others/All Users” don’t have permission to read and or execute the CVS folder.

        Here is the error I get if CVS is not readable to All users does that match what you have?
        An Exception Has Occurred
        Python Traceback

        Traceback (most recent call last):
        File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 4848, in main
        request.run_viewvc()
        File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 402, in run_viewvc
        self.view_func(self)
        File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 2201, in view_roots
        expand_root_parents(request.cfg)
        File "/usr/local/viewvc-1.1.23/lib/viewvc.py", line 4720, in expand_root_parents
        roots = vclib.ccvs.expand_root_parent(pp)
        File "/usr/local/viewvc-1.1.23/lib/vclib/ccvs/init.py", line 32, in expand_root_parent
        subpaths = os.listdir(parent_path)
        OSError: [Errno 13] Permission denied: '/usr/local/rancid/var/CVS'

        Here is the output of my machine, notice the CVS folder permissions? I don’t have read and execute permission to all users.

        [root@rancid ~]# ls -l /usr/local/rancid/var/
        total 12
        drwxrwx---. 5 rancid netadm 67 Sep 23 18:36 CVS
        drwxr-x---. 2 rancid netadm 4096 Sep 23 19:00 logs
        drwxr-x---. 4 rancid netadm 4096 Sep 23 19:00 Routers
        drwxr-x---. 4 rancid netadm 4096 Sep 23 19:00 Switches

        Change it by running this command.
        chmod 775 /usr/local/rancid/var/CVS/

        Verify:
        ls -l /usr/local/rancid/var/
        total 12
        drwxrwxr-x. 5 rancid netadm 67 Sep 23 18:36 CVS
        drwxr-x---. 2 rancid netadm 4096 Sep 23 19:00 logs
        drwxr-x---. 4 rancid netadm 4096 Sep 23 19:00 Routers
        drwxr-x---. 4 rancid netadm 4096 Sep 23 19:00 Switches

        Hope that Helps.
        Ryan

  10. Alex December 17, 2015 / 1:59 am

    Hi Ryan,

    Thank you for your answer. The thing is that my CVS folder is already in 775 mode, that’s why I don’t understand this error.

    Do you have any idea ?

    Cheers,
    Alex

    • Ryan December 21, 2015 / 7:43 pm

      Hey Alex,
      Does your error match what I had above?

      Ryan

      • Alex January 4, 2016 / 1:09 am

        Hi Ryan,

        Sorry for the late answer.
        The error I get is the following:

        An Exception Has Occurred

        Python Traceback

        Traceback (most recent call last):
        File “/usr/lib/python2.7/site-packages/viewvc/lib/viewvc.py”, line 4855, in main
        request.run_viewvc()
        File “/usr/lib/python2.7/site-packages/viewvc/lib/viewvc.py”, line 408, in run_viewvc
        self.view_func(self)
        File “/usr/lib/python2.7/site-packages/viewvc/lib/viewvc.py”, line 2207, in view_roots
        expand_root_parents(request.cfg)
        File “/usr/lib/python2.7/site-packages/viewvc/lib/viewvc.py”, line 4727, in expand_root_parents
        roots = vclib.ccvs.expand_root_parent(pp)
        File “/usr/lib/python2.7/site-packages/viewvc/lib/vclib/ccvs/init.py”, line 32, in expand_root_parent
        subpaths = os.listdir(parent_path)
        OSError: [Errno 13] Permission denied: ‘/var/rancid/CVS’

        Cheers,

        Alex

      • Ryan January 4, 2016 / 8:05 pm

        Hey Alex,
        No problem hope your holiday was good πŸ˜‰

        So I noticed that you might have installed ViewVC a different way then I did in the above post, not sure if that has anything to do with or not but it might. Your ViewVC is located under /usr/lib/python2.7/site-packages/ where in this post ViewVC is installed under usr/local/.

        Can you run a sanity check on ViewVC? (This runs a small web server on the system)
        /usr/local/viewvc-1.1.23/bin/standalone.py -r /usr/local/rancid/CVS

        On your system it might be:
        /usr/lib/python2.7/site-packages/viewvc/bin/ standalone.py -r /usr/local/rancid/CVS

        Does that say any errors?
        Should report back as saying: server ready at http://localhost:49152/viewvc

        I would just do a curl to see the HTML document
        curl http://localhost:49152/viewvc

        The output should display HTML code if it is working.

        Hope that Helps,
        Ryan

  11. Alex January 5, 2016 / 9:55 am

    Ryan,

    I solved my problem (finally !!). I have SELinux enable on my server, I had to change the security context of my folder (using the command chcon).

    Cheers,

    Alex

    • Ryan January 5, 2016 / 1:03 pm

      Hey Alex,
      Glad you got it working and thanks for posting back your solution.

  12. night-fury January 22, 2016 / 1:40 pm

    Hi,

    thank you for the precise details you have listed !! its hard work.

    i have set it up on centos 7 and works well. pulled the devices, i can see the configs in viewvc. but the mail it sends, it sends to:
    rancid-switches@host-192-168-10-161.localdomain &
    rancid-rtr-fw@host-192-168-10-161.localdomain

    rather than sending it to he email ID which was defined in /etc/aliases. any idea why ?

    my files have configuration as below:

    /etc/aliases

    Custom Rancid Configuration (Put an Email Here)

    rancid: <i.have.my.emailaddress.here>@domain.com

    Custom Rancid Configuration

    rancid-admin-rtr-fw: rancid
    rancid-rtr-fw: rancid
    rancid-admin-switches: rancid
    rancid-switches: rancid

    My /etc/postfix/main.cf is:

    #relayhost = $mydomain
    #relayhost = [gateway.my.domain]
    #relayhost = [mailserver.isp.tld]
    #relayhost = uucphost
    relayhost = 10.20.30.40

    where can i check mail logs etc to know where the problem is? please help.

    • Ryan January 22, 2016 / 8:14 pm

      Hey Night-Fury,
      That actually looks right to me, rancid modifies the TO field in the email header but if you look in the log file located at /var/log/maillog you’ll see that the message does get forwarded. In this example (real-email@example.com) is the email address I typed in the aliases file to send the email messages to. You may have to change a setting in your email system to allow this message to send.
      [root@rancid log]# tail -n 9 maillog
      Jan 22 19:03:07 rancid postfix/pickup[5922]: 0C8708026C6B: uid=1000 from=
      Jan 22 19:03:07 rancid postfix/cleanup[6647]: 0C8708026C6B: message-id=20160123020307.0C8708026C6B@rancid.example.com
      Jan 22 19:03:07 rancid postfix/qmgr[1723]: 0C8708026C6B: from=rancid@rancid.example.com, size=1483, nrcpt=1 (queue active)
      Jan 22 19:03:07 rancid postfix/cleanup[6647]: 1DFC780BE715: message-id=20160123020307.0C8708026C6B@rancid.example.com
      Jan 22 19:03:07 rancid postfix/qmgr[1723]: 1DFC780BE715: from=rancid@rancid.example.com, size=1665, nrcpt=1 (queue active)
      Jan 22 19:03:07 rancid postfix/local[6655]: 0C8708026C6B: to=rancid-Switches@rancid.example.com, orig_to=, relay=local, delay=0.11, delays=0.06/0.04/0/0.02, dsn=2.0.0, status=sent (forwarded as 1DFC780BE715)
      Jan 22 19:03:07 rancid postfix/qmgr[1723]: 0C8708026C6B: removed
      Jan 22 19:03:07 rancid postfix/smtp[6658]: 1DFC780BE715: to=real-email@example.com, orig_to=, relay=email.example.com[192.168.2.25]:25, delay=0.74, delays=0.01/0.02/0/0.71, dsn=2.6.0, status=sent (250 2.6.0 20160123020307.0C8708026C6B@rancid.example.com [InternalId=322292] Queued mail for delivery)
      Jan 22 19:03:07 rancid postfix/qmgr[1723]: 1DFC780BE715: removed
      [root@rancid log]#

      Hope that Helps,
      Ryan

      • night-fury January 23, 2016 / 7:27 am

        hey Ryan, thanks for getting back on this. I do have similar logs:

        [root@host-192-168-10-161 log]# tail -n 9 maillog
        Jan 22 14:18:54 localhost postfix/postfix-script[1690]: starting the Postfix mail system
        Jan 22 14:18:54 localhost postfix/master[1716]: daemon started — version 2.10.1, configuration /etc/postfix
        Jan 23 10:33:17 localhost postfix/postfix-script[1787]: starting the Postfix mail system
        Jan 23 10:33:17 localhost postfix/master[1811]: daemon started — version 2.10.1, configuration /etc/postfix
        Jan 23 17:33:17 localhost postfix/pickup[21220]: DEC68243416E: uid=0 from=
        Jan 23 17:33:17 localhost postfix/cleanup[22244]: DEC68243416E: message-id=20160123120317.DEC68243416E@host-192-168-10-161.localdomain
        Jan 23 17:33:17 localhost postfix/qmgr[1821]: DEC68243416E: from=root@host-192-168-10-161.localdomain, size=47328, nrcpt=1 (queue active)
        Jan 23 17:33:18 localhost postfix/smtp[22246]: DEC68243416E: to=my.email@my.domain.com, relay=10.20.30.40[10.20.30.40]:25, delay=0.95, delays=0.06/0.14/0.01/0.74, dsn=2.6.0, status=sent (250 2.6.0 20160123120317.DEC68243416E@host-192-168-10-161.localdomain [InternalId=53596896886795, Hostname=MAIL.SERVER.FQDN] Queued mail for delivery)
        Jan 23 17:33:18 localhost postfix/qmgr[1821]: DEC68243416E: removed

        that means my mail server is messing with the emails. any pointer on what is to be changes in mail system?

        My mail logs, however, do not show anywhere that the mail is being sent to rancid-Switches@rancid.example.com etc. You think its a problem?

        -thanks
        night-fury

      • Ryan January 23, 2016 / 10:40 am

        Hey Night-Fury,
        Each mail system varies sometimes there are called trusted hosts or relays. The mail system has to trust rancid in sending emails. In your log it says queued mail for delivery so the message was sent. It is likely something on your email system.

        Good Luck.
        Ryan

      • night-fury January 24, 2016 / 12:15 am

        Okay, will check what can be done at the exchange end. Thank you for all your help πŸ™‚

  13. Adam January 29, 2016 / 9:06 am

    Hi I ran the last cmd and this is the out put. Can you help

    [root@rancid ~]# /usr/local/viewvc-1.1.23/bin/cvsdbadmin rebuild /usr/local/rancid/var/CVS/CVSROOT/
    Using repository root `/usr/local/rancid/var/CVS’
    Traceback (most recent call last):
    File “/usr/local/viewvc-1.1.23/bin/cvsdbadmin”, line 175, in
    db = cvsdb.ConnectDatabase(cfg)
    File “/usr/local/viewvc-1.1.23/lib/cvsdb.py”, line 904, in ConnectDatabase
    db.Connect()
    File “/usr/local/viewvc-1.1.23/lib/cvsdb.py”, line 59, in Connect
    table_list = self.GetTableList()
    File “/usr/local/viewvc-1.1.23/lib/cvsdb.py”, line 177, in GetTableList
    cursor.execute(sql)
    File “/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py”, line 174, in execute
    self.errorhandler(self, exc, value)
    File “/usr/lib64/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
    raise errorclass, errorvalue
    _mysql_exceptions.OperationalError: (1046, ‘No database selected’)

    • Ryan January 29, 2016 / 8:12 pm

      Hey Adam, I would check your viewvc.conf file and make sure you put the database you are connecting into the view.conf file in my example my database is ViewVC. The error message basically says there is no database selected when you run the rebuild script.

      Configure the ViewVC configuration file
      nano /usr/local/viewvc-1.1.23/viewvc.conf
      Look for database_name =
      Type in your database to connect ViewVC.

      Hope that Helps,
      Ryan

      • Adam January 31, 2016 / 4:09 am

        Hi Ryan,
        I checked everything in all the config files. In the end I deleted the VM are started again from scratch, sadly i got the end with the same error. Fancy building me a quick one and exporting it ti ovf/ova?

      • Ryan January 31, 2016 / 7:48 pm

        Hey Adam,
        Could you post your viewvc.conf file?

        Ryan

      • Adam February 2, 2016 / 9:23 am

        This is my error below.

        root@hmsgrancid viewvc-1.1.23]# /usr/local/viewvc-1.1.23/bin/cvsdbadmin rebuild /usr/local/rancid/var/CVS/CVSROOT/
        Using repository root `/usr/local/rancid/var/CVS’
        Traceback (most recent call last):
        File “/usr/local/viewvc-1.1.23/bin/cvsdbadmin”, line 175, in
        db = cvsdb.ConnectDatabase(cfg)
        File “/usr/local/viewvc-1.1.23/lib/cvsdb.py”, line 904, in ConnectDatabase
        db.Connect()
        File “/usr/local/viewvc-1.1.23/lib/cvsdb.py”, line 59, in Connect
        table_list = self.GetTableList()
        File “/usr/local/viewvc-1.1.23/lib/cvsdb.py”, line 177, in GetTableList
        cursor.execute(sql)
        File “/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py”, line 174, in execute
        self.errorhandler(self, exc, value)
        File “/usr/lib64/python2.7/site-packages/MySQLdb/connections.py”, line 36, in defaulterrorhandler
        raise errorclass, errorvalue
        _mysql_exceptions.OperationalError: (1046, ‘No database selected’)

        This is the viewvc.config file

        ##—————————————————————————
        ##

        Configuration file for ViewVC

        ##

        Information on ViewVC is located at the following web site:

        http://viewvc.org/

        ##
        ##—————————————————————————

        THE FORMAT OF THIS CONFIGURATION FILE

        ##

        This file is delineated by sections, specified in [brackets]. Within

        each section, are a number of configuration settings. These settings

        take the form of: name = value. Values may be continued on the

        following line by indenting the continued line.

        ##

        WARNING: Indentation always means continuation. Name=value lines

        should always start in column zero.

        ##

        Comments should always start in column zero, and are identified

        with “#”. By default each of the configuration items is

        commented out, with the default value of the option shown.

        You’ll need to remove the ‘#’ that precedes configuration

        options whose values you wish to modify.

        ##

        Certain configuration settings may have multiple values. These should

        be separated by a comma. The settings where this is allowed are noted

        below. Any other setting that requires special syntax is noted at that

        setting.

        ##

        SOME TERMINOLOGY USED HEREIN

        ##

        “root” – This is a CVS or Subversion repository. For Subversion, the

        meaning is pretty clear, as the virtual, versioned directory tree

        stored inside a Subversion repository looks nothing like the actual

        tree visible with shell utilities that holds the repository. For

        CVS, this is more confusing, because CVS’s repository layout mimics

        (actually, defines) the layout of the stuff housed in the repository.

        But a CVS repository can be identified by the presence of a CVSROOT

        subdirectory in its root directory.

        ##

        “module” – A module is a top-level subdirectory of a root, usually

        associated with the concept of a single “project” among many housed

        within a single repository.

        ##
        ##

        BASIC VIEWVC CONFIGURATION HINTS

        ##

        While ViewVC has quite a few configuration options, you generally

        only need to change a small subset of them to get your ViewVC

        installation working properly. Here are some options that we

        recommend you pay attention to. Of course, don’t try to change the

        options here — do so in the relevant section of the configuration

        file below.

        For correct operation, you will probably need to change the following

        configuration variables:

        cvs_roots (for CVS)

        svn_roots (for Subversion)

        root_parents (for CVS or Subversion)

        default_root

        root_as_url_component

        rcs_dir

        mime_types_files

        the many options in the [utilities] section

        It is usually desirable to change the following variables:

        address

        forbidden

        To optimize delivery of ViewVC static files:

        docroot

        To customize the display of ViewVC for your site:

        template_dir

        the [templates] override section

        ##

        ##—————————————————————————
        [general]

        cvs_roots: Specifies each of the CVS roots on your system and

        assigns names to them. Each root should be given by a “name: path”

        value (where the path is an absolute filesystem path). Multiple roots

        should be separated by commas and can be placed on separate lines.

        ##

        Example:

        cvs_roots = cvsroot: /opt/cvs/repos1,

        anotherroot: /usr/local/cvs/repos2

        ##
        #cvs_roots = cvs:

        svn_roots: Specifies each of the Subversion roots (repositories) on

        your system and assigns names to them. Each root should be given by

        a “name: path” value (where the path is an absolute filesystem path).

        Multiple roots should be separated by commas and can be placed on

        separate lines.

        ##

        NOTE: ViewVC offers experimental support for displaying remote

        Subversion repositories. Simply use the repository’s URL instead

        of a local filesystem path when defining the root.

        ##

        Example:

        svn_roots = svnrepos: /opt/svn/,

        anotherrepos: /usr/local/svn/repos2

        ##
        #svn_roots =

        root_parents: Specifies a list of directories under which any

        number of repositories may reside. You can specify multiple root

        parents separated by commas or new lines, each of which is of the

        form “path: type” (where the type is either “cvs” or “svn”, and

        the path is an absolute filesystem path).

        ##

        Rather than force you to add a new entry to ‘cvs_roots’ or

        ‘svn_roots’ each time you create a new repository, ViewVC rewards

        you for organizing all your repositories under a few parent

        directories by allowing you to simply tell it about those parent

        directories. ViewVC will then notice each repository of the

        specified type in that directory as a root whose name is the

        subdirectory in which that repository lives.

        ##

        For example, if you have three Subversion repositories located at

        /opt/svn/projects, /opt/svn/websites, and /opt/svn/devstuff, you

        could list them individually in svn_roots like so:

        ##

        svn_roots = projects: /opt/svn/projects,

        websites: /opt/svn/websites,

        devstuff: /opt/svn/devstuff

        ##

        or you could instead use the root_parents configuration option:

        ##

        root_parents = /opt/svn: svn

        ##

        The benefit of this latter approach is that, as you add new

        repositories to your /opt/svn directory, they automatically become

        available for display in ViewVC without additional configuration.

        ##

        WARNING: the root names derived for repositories configured via the

        root_parents option can, of course, clash with names you have

        defined in your cvs_roots or svn_roots configuration items. If

        this occurs, you can either rename the offending repository on

        disk, or grant new names to the clashing item in cvs_roots or

        svn_roots. Each parent path is processed sequentially, so the

        names of repositories under later parent paths may override earlier

        ones.

        ##

        Example:

        root_parents = /opt/svn: svn,

        /opt/cvs: cvs

        ##
        #root_parents = /usr/local/rancid/var/CVS : cvs

        default_root: This is the name of the default root. Valid names

        include those explicitly listed in the cvs_roots and svn_roots

        configuration options, as well as those implicitly indicated by

        virtue of being the basenames of repositories found in the

        root_parents option locations.

        ##

        NOTE: This setting is ignored when root_as_url_component is enabled.

        ##

        Example:

        default_root = cvsroot

        ##
        #default_root =

        mime_types_files: This is a list of pathnames to a set of MIME type

        mapping files to help ViewVC guess the correct MIME type of a

        versioned file. The pathnames listed here are specified in order of

        authoritativeness either as absolute paths or relative to this

        configuration file.

        ##

        As a convenience, ViewVC provides a MIME type mapping file

        (mimetypes.conf) which is, by default, the preferred provider of

        MIME type mapping answers, but which is also empty. If you find

        that ViewVC is unable to accurately guess MIME types based on the

        extensions of some of your versioned files, you can add records of

        your preferred mappings to the provided mimetypes.conf file (or to

        your system’s mapping files, if you wish).

        ##

        You might, for example, wish to have ViewVC also consult the mapping

        files provided by your operating system and Apache.

        ##

        Example:

        mime_types_files = mimetypes.conf,

        /etc/mime.types,

        /usr/local/apache2/conf/mime.types

        ##
        #mime_types_files = mimetypes.conf

        address: The address of the local repository maintainer. (This

        option is provided only as a convenience for ViewVC installations

        which are using the default template set, where the value of this

        option will be displayed in the footer of every ViewVC page.)

        ##

        Example:

        address = admin@server.com

        ##
        #address =

        kv_files: Provides a mechanism for custom key/value pairs to be

        available to templates. These are stored in key/value (KV) files.

        ##

        The paths of the KV files are listed here, specified either as

        absolute paths or relative to this configuration file. The files

        use the same format as this configuration file, containing one or

        more user-defined sections, and user-defined options in those

        sections. ViewVC makes these options available to template authors

        as:

        ##

        kv.SECTION.OPTION

        ##

        Note that an option name can be dotted. For example:

        ##

        [my_images]

        logos.small = /images/small-logo.png

        logos.big = /images/big-logo.png

        ##

        Templates can use these with a directive like: [kv.my_images.logos.small]

        ##

        Note that section names which are common to multiple KV files will

        be merged. If two files have a [my_images] section, then the

        options in those two like-named sections will be merged together.

        If two files have the same option name in a section, then one will

        overwrite the other (and which one “wins” is unspecified).

        ##

        To further categorize the KV files, and how the values are provided to

        the templates, a KV file name may be annotated with an additional level

        of dotted naming. For example:

        ##

        kv_files = [asf]kv/images.conf

        ##

        Assuming the same section as above, the template would refer to an image

        using [kv.asf.my_images.logos.small]

        ##

        Lastly, it is possible to use %lang% in the filenames to specify a

        substitution of the selected language-tag.

        ##

        Example:

        kv_files = kv/file1.conf, kv/file2.conf, [i18n]kv/%lang%_data.conf

        ##
        #kv_files =

        This option is a comma-separated list of language-tag values

        available to ViewVC. The first language-tag listed is the default

        language, and will be used if an Accept-Language header is not

        present in the request, or none of the user’s requested languages

        are available. If there are ties on the selection of a language,

        then the first to appear in the list is chosen.

        ##

        Example:

        languages = en-us, en-gb, de

        ##
        #languages = en-us

        ##—————————————————————————
        [utilities]

        ViewVC uses (sometimes optionally) various third-party programs to do some

        of the heavy lifting. Generally, it will attempt to execute those utility

        programs in such a way that if they are found in ViewVC’s executable

        search path ($PATH, %PATH%, etc.) all is well. But sometimes these tools

        aren’t installed in the executable search path, so here’s where you can

        tell ViewVC where to find them.

        ##

        NOTE: Options with a “_dir” suffix are for configuring the

        directories in which certain programs live. Note that this might

        not be the same directory into which the program’s installer dumped

        the whole program package — we want the deepest directory in which

        the executable program itself resides (“C:\rcstools\bin\win32”

        rather than just “C:\rcstools”, for example). The values of options

        whose names lack the “_dir” suffix should point to the actual

        program itself (such as “C:\Program Files\cvsnt\cvs.exe”).

        rcs_dir: Directory in which the RCS utilities are installed, used

        for viewing CVS repositories.

        ##

        Example:

        rcs_dir = /usr/bin/

        ##
        #rcs_dir = /usr/local/bin

        cvsnt: Location of cvsnt program. ViewVC can use CVSNT (www.cvsnt.org)

        instead of the RCS utilities to retrieve information from CVS

        repositories. To enable use of CVSNT, set the “cvsnt” value to the

        path of the CVSNT executable. (If CVSNT is on the standard path, you

        can also set it to the name of the CVSNT executable). By default

        “cvsnt” is set to “cvs” on Windows and is not set on other platforms.

        ##

        Examples:

        cvsnt = K:\Program Files\cvsnt\cvs.exe

        cvsnt = /usr/bin/cvs

        cvsnt = cvs

        ##
        #cvsnt =

        svn: Location of the Subversion command-line client, used for

        viewing Subversion repositories.

        ##

        Example:

        svn = /usr/bin/svn

        ##
        #svn =

        diff: Location of the GNU diff program, used for showing file

        version differences.

        ##

        Example:

        diff = /usr/bin/diff

        ##
        #diff =

        cvsgraph: Location of the CvsGraph program, a graphical CVS version

        graph generator (see options.use_cvsgraph).

        ##

        Example:

        cvsgraph = /usr/local/bin/cvsgraph

        ##
        #cvsgraph =

        ##—————————————————————————
        [options]

        root_as_url_component: Interpret the first path component in the URL

        after the script location as the root to use. This is an

        alternative to using the “root=” query key. If ViewVC is configured

        with multiple repositories, this results in more natural looking

        ViewVC URLs.

        ##

        NOTE: Enabling this option will break backwards compatibility with

        any old ViewCVS URL which doesn’t have an explicit “root” parameter.

        ##
        #root_as_url_component = 1

        checkout_magic: Use checkout links with magic /checkout/ prefixes so

        checked out HTML pages can have working links to other repository files

        ##

        NOTE: This option is DEPRECATED and should not be used in new ViewVC

        installations. Setting “default_file_view = co” achieves the same effect

        ##
        #checkout_magic = 0

        allowed_views: List the ViewVC views which are enabled. Views not

        in this comma-delited list will not be served (or, will return an

        error on attempted access).

        ##

        Valid items for this list include: “annotate”, “co”, “diff”, “markup”,

        “roots”, “tar”.

        ##

        ———-+———————————————————

        VIEW | DESCRIPTION

        ———-+———————————————————

        annotate | The ‘annotate’ view shows the contents of a single

        | revision of a versioned file in exactly the same way as

        | the markup view, but with additional line-by-line

        | change attribution (the revision number, author, etc.

        | the most recent edit to that line of text as of the

        | displayed version).

        ———-+———————————————————

        co | The ‘co’ (aka “checkout” or “download”) view isn’t

        | really a branded view at all, but allows for direct

        | downloading of the contents of a single revision of a

        | versioned file.

        ———-+———————————————————

        diff | The ‘diff’ view displays line-based differences between

        | two revisions of a versioned file in a variety of

        | different user-selectable formats.

        ———-+———————————————————

        markup | The ‘markup’ view shows the contents of a single

        | revision of a versioned file, with syntax highlighting

        | where possible and enabled. It can also optionally

        | show change log information for that revision of the

        | file.

        ———-+———————————————————

        roots | The ‘roots’ view is a simple listing of the various

        | repositories which ViewVC has been configured to serve

        | to users.

        ———-+———————————————————

        tar | The ‘tar’ view isn’t a branded view, but generates

        | a GNU Tar archive file containing a single versioned

        | directory and its contents (recursively).

        ———-+———————————————————

        ##
        #allowed_views = annotate, diff, markup, roots

        Comma-delimited list of MIME content types (with support for fnmatch-

        style glob characters) which are considered not-human-readable and for

        which ViewVC will neither generate links to, nor support the direct

        display of, non-checkout views which carry the file’s content (the

        ‘markup’, ‘annotate’, ‘diff’, and ‘patch’ views).

        ##

        NOTE: Handling of this option is given priority over ViewVC’s

        longstanding support for showing web-friendly file formats — even

        binary ones such as “image/jpeg” and “image/gif” — in the ‘markup’

        view. Thus, if you add “image/*” to this list, ‘markup’-view

        display of JPEG, GIF, and PNG images will be disabled.

        ##

        Example:

        binary_mime_types = application/octet-stream, image/*, application/pdf,

        application/vnd*, application/msword, audio/*

        #
        #binary_mime_types =

        authorizer: The name of the ViewVC authorizer plugin to use when

        authorizing access to repository contents. This value must be the

        name of a Python module addressable as vcauth.MODULENAME (most

        easily accomplished by placing it in ViewVC’s lib/vcauth/ directory)

        and which implements a ViewVCAuthorizer class (as a subclass of

        vcauth.GenericViewVCAuthorizer). You can provide custom parameters

        to the authorizer module by defining configuration sections named

        authz-MODULENAME and adding the parameter keys and values there.

        ##

        ViewVC provides the following modules:

        svnauthz – based on Subversion authz files

        forbidden – simple path glob matches against top-level root directories

        forbiddenre – root and path matches against regular expressions

        ##

        NOTE: Only one authorizer may be in use for a given ViewVC request.

        It doesn’t matter if you configure the parameters of multiple

        authorizer plugins — only the authorizer whose name is configured

        here (or effectively configured here via per-vhost or per-root

        configuration) will be activated.

        ##
        #authorizer =

        hide_cvsroot: Don’t show the CVSROOT directory

        1 Hide CVSROOT directory

        0 Show CVSROOT directory

        ##

        NOTE: Someday this option may be removed in favor of letting

        individual authorizer plugin hide the CVSROOT.

        ##
        #hide_cvsroot = 1

        mangle_email_addresses: Mangle email addresses in marked-up output.

        There are various levels of mangling available:

        0 – No mangling; markup un-mangled email addresses as hyperlinks

        1 – Obfuscation (using entity encoding); no hyperlinking

        2 – Data-dropping address truncation; no hyperlinking

        ##

        NOTE: this will not effect the display of versioned file contents, only

        addresses that appear in version control metadata (e.g. log messages).

        ##
        #mangle_email_addresses = 0

        custom_log_formatting: Specifies mappings of regular expressions to

        substitution format strings used to URL-ize strings found in

        revision log messages. Multiple mappings (specified as

        REGEXP:FORMATSTRING) may be defined, separated by commas.

        ##

        NOTE: Due to a limitation of the configuration format, commas may

        not be used in the regular expression portion of each mapping.

        Commas “in the raw” may not be used in the format string portion,

        either, but you can probably use the URI-encoded form of the comma

        (“%2C”) instead with no ill side-effects. If you must specify a

        colon character in either the regular expression or the format

        string, escape it with a preceding backslash (“:”).

        ##

        Example:

        custom_log_formatting =

        artf[0-9]+ : http://example.com/tracker?id=\0,

        issue ([0-9]+) : http://example.com/bug?id=\1&opts=full%2csortby=id

        ##
        #custom_log_formatting =

        default_file_view: “log”, “co”, or “markup”

        Controls whether the default view for file URLs is a checkout view or

        a log view. “log” is the default for backwards compatibility with old

        ViewCVS URLs, but “co” has the advantage that it allows ViewVC to serve

        static HTML pages directly from a repository with working links

        to other repository files

        ##

        NOTE: Changing this option may break compatibility with existing

        bookmarked URLs.

        ##

        ALSO NOTE: If you choose one of the “co” or “markup” views, be sure

        to enable it (via the allowed_views option)

        ##
        #default_file_view = log

        http_expiration_time: Expiration time (in seconds) for cacheable

        pages served by ViewVC. Note that in most cases, a cache aware

        client will only revalidate the page after it expires (using the

        If-Modified-Since and/or If-None-Match headers) and that browsers

        will also revalidate the page when the reload button is pressed.

        Set to 0 to disable the transmission of these caching headers.

        ##
        #http_expiration_time = 600

        generate_etags: Generate Etag headers for relevant pages to assist

        in browser caching.

        1 Generate Etags

        0 Don’t generate Etags

        ##
        #generate_etags = 1

        svn_ignore_mimetype: Don’t consult the svn:mime-type property to

        determine how to display a file in the markup view. This is

        especially helpful when versioned images carry the default

        Subversion-calculated MIME type of “application/octet-stream” (which

        isn’t recognized as viewable type by browsers).

        ##
        #svn_ignore_mimetype = 0

        max_filesize_kbytes: Limit ViewVC’s processing of file contents in

        “markup” and “annotate” views to only those files which are smaller

        than this setting, expressed in kilobytes. Set to 0 to disable

        this safeguard.

        ##

        NOTE: The “co” and “tar” views are unaffected by this setting.

        #max_filesize_kbytes = 512

        svn_config_dir: Path of the Subversion runtime configuration

        directory ViewVC should consult for various things, including cached

        remote authentication credentials. If unset, Subversion will use

        the default location(s) ($HOME/.subversion, etc.)

        ##
        #svn_config_dir =

        use_rcsparse: Use the rcsparse Python module to retrieve CVS

        repository information instead of invoking rcs utilities [EXPERIMENTAL]

        ##
        #use_rcsparse = 1

        sort_by: File sort order

        file Sort by filename

        rev Sort by revision number

        date Sort by commit date

        author Sort by author

        log Sort by log message

        ##
        #sort_by = file

        sort_group_dirs: Group directories when sorting

        1 Group directories together

        0 No grouping — sort directories as any other item would be sorted

        ##
        #sort_group_dirs = 1

        hide_attic: Hide or show the contents of the Attic subdirectory

        1 Hide dead files inside Attic subdir

        0 Show the files which are inside the Attic subdir

        ##
        #hide_attic = 1

        hide_errorful_entries: Hide or show errorful directory entries

        (perhaps due to not being readable, or some other rlog parsing

        error, etc.)

        1 Hide errorful entries from the directory display

        0 Show errorful entries (with their errors) in the directory display

        ##
        #hide_errorful_entries = 0

        log_sort: Sort order for log messages

        date Sort revisions by date

        rev Sort revision by revision number

        none Use the version control system’s ordering

        ##
        #log_sort = date

        diff_format: Default diff format

        h Human readable

        u Unified diff

        c Context diff

        s Side by side

        l Long human readable (more context)

        f Full human readable (entire file)

        ##
        #diff_format = h

        hr_breakable: Diff view line breaks

        1 lines break at spaces

        0 no line breaking

        Or, use a positive integer > 1 to cut lines after that many characters

        ##
        #hr_breakable = 1

        hr_funout: Give out function names in human readable diffs.

        (Only works well for C source files, otherwise diff’s heuristic falls short.)

        (‘-p’ option to diff)

        ##
        #hr_funout = 1

        hr_ignore_white: Ignore whitespace (indendation and stuff) for human

        readable diffs.

        (‘-w’ option to diff)

        ##
        #hr_ignore_white = 0

        hr_ignore_keyword_subst: Ignore diffs which are caused by keyword

        substitution (such as “$Id – Stuff”).

        (‘-kk’ option to rcsdiff)

        ##
        #hr_ignore_keyword_subst = 1

        hr_intraline: Enable highlighting of intraline changes in human

        readable diffs. [Requires Python 2.4]

        ##
        #hr_intraline = 0

        allow_compress: Allow compression via gzip of output if the Browser

        accepts it (HTTP_ACCEPT_ENCODING contains “gzip”).

        ##

        NOTE: this relies on Python’s gzip module, which has proven to be

        not-so-performant. Enabling this feature should reduce the overall

        transfer size of ViewVC’s responses to the client’s request, but

        will do so with a speed penalty.

        ##
        #allow_compress = 0

        template_dir: The directory which contains the EZT templates used by

        ViewVC to customize the display of the various output views. ViewVC

        looks in this directory for files with names that match the name of

        the view (“log”, “directory”, etc.) plus the “.ezt” extension. If

        specified as a relative path, it is relative to the directory where

        this config file resides; absolute paths may be used as well. If

        %lang% occurs in the pathname, then the selected language will be

        substituted.

        SEE ALSO: the [templates] configuration section, where you can

        override templates on a per-view basis.

        ##
        #template_dir = templates

        docroot: Web path to a directory that contains ViewVC static files

        (stylesheets, images, etc.) If set, static files will get

        downloaded directory from this location. If unset, static files

        will be served by the ViewVC script (at a likely performance

        penalty, and from the “docroot” subdirectory of the directory

        specified by the “template_dir” option).

        ##

        NOTE: This option is evaluated outside the context of a particular

        root. Be careful when using per-root configuration to select an

        alternate template set as the default value for this option will

        still be based on the global default template set per ‘template_dir’

        above, not on ‘template_dir’ as overridden for a given root.

        ##
        #docroot =

        show_subdir_lastmod: Show last changelog message for CVS subdirectories

        ##

        NOTE: The current implementation makes many assumptions and may show

        the incorrect file at some times. The main assumption is that the

        last modified file has the newest filedate. But some CVS operations

        touches the file without even when a new version is not checked in,

        and TAG based browsing essentially puts this out of order, unless

        the last checkin was on the same tag as you are viewing. Enable

        this if you like the feature, but don’t rely on correct results.

        ##

        SECURITY WARNING: Enabling this will currently leak unauthorized

        path names.

        ##
        #show_subdir_lastmod = 0

        show_roots_lastmod: In the root listing view, show the most recent

        modifications made to the root. (Subversion roots only.)

        ##

        NOTE: Enabling this feature will significantly reduce the

        performance of the root listing view.

        ##
        #show_roots_lastmod = 0

        show_logs: Show the most recent log entry in directory listings.

        ##
        #show_logs = 1

        show_log_in_markup: Show log when viewing file contents.

        ##
        #show_log_in_markup = 1

        cross_copies: Cross filesystem copies when traversing Subversion

        file revision histories.

        ##
        #cross_copies = 1

        use_localtime: Display dates as UTC or in local time zone.

        ##
        #use_localtime = 0

        iso8601_dates: Display timestamps using a standard ISO-8601 format.

        ##
        #iso8601_timestamps = 0

        short_log_len: The length (in characters) to which the most recent

        log entry should be truncated when shown in the directory view.

        ##
        #short_log_len = 80

        enable_syntax_coloration: Should we colorize known file content

        syntaxes?

        ##

        NOTE: This feature requires the Pygments Python module

        (http://pygments.org) and works only when ViewVC can determine the

        MIME content type of the file whose contents it wishes to colorize.

        Use the ‘mime_types_files’ configuration option to specify MIME

        type mapping files useful for making that determination.

        ##
        #enable_syntax_coloration = 1

        tabsize: The number of spaces into which horizontal tab characters

        are converted when viewing file contents. Set to 0 to preserve

        tab characters.

        ##
        #tabsize = 8

        detect_encoding: Should we attempt to detect versioned file

        character encodings? [Requires ‘chardet’ module, and is currently

        used only for the ‘markup’ and ‘annotate’ views.]

        ##
        #detect_encoding = 0

        use_cvsgraph: Use CvsGraph to offer visual graphs of CVS revision history.

        ##
        #use_cvsgraph = 0

        cvsgraph_conf: Location of the customized cvsgraph configuration file.

        May be specified as an absolute path or as a path relative to this

        configuration file.

        ##
        #cvsgraph_conf = cvsgraph.conf

        use_re_search: Enable regular expression search of files in a directory.

        ##

        WARNING: Enabling this option can consume HUGE amounts of server

        time. A “checkout” must be performed on each file in a directory,

        and the result needs to be searched for a match against the regular

        expression.

        ##

        SECURITY WARNING: Since a user can enter the regular expression, it

        is possible for them to enter an expression with many alternatives

        and a lot of backtracking. Executing that search over thousands of

        lines over dozens of files can easily tie up a server for a long

        period of time. This option should only be used on sites with

        trusted users. It is highly inadvisable to use this on a public site.

        ##
        #use_re_search = 0

        dir_pagesize: Maximum number of directory entries on a given page.

        This allows ViewVC to present discrete pages to the users instead of

        the entire directory. Set to 0 to disable pagination.

        ##
        #dir_pagesize = 0

        log_pagesize: Maximum number of revision log entries on a given page.

        This allows ViewVC to present discrete pages to the users instead of

        the entire revision log. Set to 0 to disable pagination.

        ##
        #log_pagesize = 0

        log_pagesextra: Maximum number of extra pages (based on

        log_pagesize) of revision log data to fetch and present to the user

        as additional options for display. Revision log information

        “beyond” this window is still accessible, but must be navigated to

        in multiple steps.

        ##

        Example:

        log_pagesize = 100

        log_pagesextra = 3

        ##

        For a versioned file with 1000 revisions, the above settings would

        present to the user the first 100 of those 1000 revisions, with

        links to three additional pages (the 200-299th revisions, 300-399th

        revisions, and 400-499th revisions) plus a link to the 500th

        revision. Following these links slides the display “window”,

        showing the requested set of revisions plus links to three

        additional pages beyond those, and so on.

        ##
        #log_pagesextra = 3

        limit_changes: Maximum number of changed paths shown per commit in

        the Subversion revision view and in query results. This is not a

        hard limit (the UI provides options to show all changed paths), but

        it prevents ViewVC from generating enormous and hard to read pages

        by default when they happen to contain import or merge commits

        affecting hundreds or thousands of files. Set to 0 to disable the

        limit.

        ##
        #limit_changes = 100

        ##—————————————————————————
        [templates]

        You can override the templates used by various ViewVC views in this

        section. By default, ViewVC will look for templates in the

        directory specified by the “template_dir” configuration option (see

        the documentation for that option for details). But if you want to

        use a different template for a particular view, simply uncomment the

        appropriate option below and specify the currect location of the EZT

        template file you wish to use for that view.

        Templates are specified relative to the configured template

        directory (see the “template_dir” option), but absolute paths may

        also be used as well.

        ##

        If %lang% occurs in the pathname, then the selected language will be

        substituted.

        ##

        NOTE: the selected language is defined by the “languages” item in the

        [general] section, and based on the request’s Accept-Language

        header.

        ##

        diff: Template used for the file differences view.

        ##
        #diff =

        directory: Template used for the directory listing view.

        ##
        #directory =

        error: Template used for the ViewVC error display view.

        ##
        #error =

        file: Template used for the file contents/annotation view.

        ##
        #file =

        graph: Template used for the revision graph view.

        ##
        #graph =

        log: Template used for the revision log view.

        ##
        #log =

        query: Template used for the non-integrated query interface.

        ##
        #query =

        query_form: Template used for the query form view.

        ##
        #query_form =

        query_results: Template used for the query results view.

        ##
        #query_results =

        revision: Template used for the revision/changeset view.

        ##
        #revision =

        roots: Template used for the root listing view.

        ##
        #roots =

        ##—————————————————————————
        [cvsdb]

        enabled: Enable database integration feature.

        ##
        #enabled = 1

        host: Database hostname. Leave unset to use a local Unix socket

        connection.

        ##
        #host = localhost

        post: Database listening port.

        ##
        #port = 3306

        database_name: ViewVC database name.

        ##
        #database_name = ViewVC

        user: Username of user with read/write privileges to the database

        specified by the ‘database_name’ configuration option.

        ##
        #user = VIEWVC

        passwd: Password of user with read/write privileges to the database

        specified by the ‘database_name’ configuration option.

        ##
        #passwd = gr33nback

        readonly_user: Username of user with read privileges to the database

        specified by the ‘database_name’ configuration option.

        ##
        #readonly_user = VIEWVCRO

        readonly_passwd: Password of user with read privileges to the database

        specified by the ‘database_name’ configuration option.

        ##
        #readonly_passwd = gr33nback

        row_limit: Maximum number of rows returned by a given normal query

        to the database.

        ##

        NOTE: This limits the amount of data provided to ViewVC by the

        database. It is from this already-reduced data set that ViewVC

        builds the query response it presents to the user, which may or may

        not include still more limiting via the query form’s ‘limit’

        parameter. In other words, there is no value which the user can use

        in the query form’s ‘limit’ parameter which will cause more data to

        be returned by the database for ViewVC to process.

        ##
        #row_limit = 1000

        rss_row_limit: Maximum number of rows returned by a given query to

        the database made as part of an RSS feed request. (Keeping in mind

        that RSS readers tend to poll regularly for new data, you might want

        to keep this set to a conservative number.)

        ##

        See also the `NOTE’ for the ‘row_limit’ option, which applies here

        as well.

        ##
        #rss_row_limit = 100

        check_database_for_root: Check if the repository is found in the

        database before showing the query link and RSS feeds.

        WARNING: Enabling this check adds the cost of a database connection

        and query to most ViewVC requests. If all your roots are represented

        in the commits database, or if you don’t care about the creation of

        RSS and query links that might lead ultimately to error pages for

        certain of your roots, or if you simply don’t want to add this extra

        cost to your ViewVC requests, leave this disabled.

        ##
        #check_database_for_root = 0

        ##—————————————————————————
        [vhosts]

        Virtual hosts are individual logical servers accessible via

        different hostnames, but which are all really the same physical

        computer. For example, you might have your web server configured to

        accept incoming traffic for both http://www.yourdomain.com/ and

        http://viewvc.yourdomain.com/. Users pointing their web browsers at

        each of those two URLs might see entirely different content via one

        URL versus the other, but all that content actually lives on the

        same computer, is served up via the same web server, and so

        on. It just looks like its coming from multiple servers.

        ##

        ViewVC allows you to customize its configuration options for

        individual virtual hosts. You might, for example, wish to expose

        all of your Subversion repositories at http://svn.yourdomain.com/viewvc/

        and all your CVS ones at http://cvs.yourdomain.com/viewvc/, with no

        cross-exposure. Using ViewVC’s virtual host (vhost) configuration

        support, you can do this. Simply create two vhost configurations

        (one for each of your hostnames), then configure the cvs_roots

        option only for the vhost associated with cvs.yourdomain.com, and

        configure the svn_roots option only for the vhost associated with

        svn.yourdomain.com.

        ##

        This section is a freeform configuration section, where you create

        both the option names and their values. The names of the options

        are then treated as canonical names of virtual hosts, and their

        values are defined to be comma-delimited lists of hostname globs

        against which incoming ViewVC requests will be matched to figure out

        which vhost they apply to.

        ##

        After you’ve named and defined your vhosts, you may then create new

        configuration sections whose names are of the form

        vhost-VHOSTNAME/CONFIGSECTION. VHOSTNAME here is the canonical name

        of one of the virtual hosts you defined under the [vhosts] section.

        Inside those configuration sections, you override the standard

        ViewVC options typically found in the base configuration section

        named CONFIGSECTION (“general”, “option”, etc.)

        ##

        NOTE: Per-vhost overrides may only be applied to the following

        sections:

        ##

        general

        options

        utilities

        templates

        cvsdb

        authz-*

        ##

        Here is an example:

        ##

        [vhosts]

        libs = libs.yourdomain.*, .yourlibs.

        gui = guiproject.yourdomain.*

        ##

        [vhost-libs/general]

        cvs_roots =

        svn_roots = svnroot: /var/svn/libs-repos

        default_root = svnroot

        ##

        [vhost-libs/options]

        show_logs = 1

        ##

        [vhost-gui/general]

        cvs_roots = cvsroot: /var/cvs/guiproject

        svn_roots =

        default_root = cvsroot

        ##

        ##—————————————————————————

        ViewVC recognizes per-root configuration overrides, too. To

        override the value of a configuration parameter only for a single

        root, create a configuration section whose names is of the form

        root-ROOTNAME/CONFIGSECTION. ROOTNAME here is the name of the root

        as defined explicitly in cvs_roots or svn_roots or implicitly as the

        basename of a root path in root_parents. Options found in this new

        configuration section override for this one root the corresponding

        options found in the base configuration section CONFIGSECTION

        (“options”, “authz-*”, etc.) as interpreted after per-vhost

        overrides (if any) have been applied.

        ##

        NOTE: Per-root overrides may only be applied to the following

        sections:

        ##

        options

        utilities

        authz-*

        ##

        WARNING: Do not use per-root overrides if your ViewVC instance is

        served via the standalone.py server option! Doing so could cause

        ViewVC to be unable to function properly (or at all).

        ##

        Here is an example showing how to enable Subversion authz-based

        authorization for only the single root named “svnroot”:

        [root-svnroot/options]

        authorizer = svnauthz

        ##

        [root-svnroot/authz-svnauthz]

        authzfile = /path/to/authzfile

        ##

        ##—————————————————————————
        [authz-forbidden]

        The “forbidden” authorizer forbids access to repository modules,

        defined to be top-level subdirectories in a repository.

        ##

        NOTE: The options in this section apply only when the ‘authorizer’

        option (in the [options] section) is set to ‘forbidden’.

        forbidden: A comma-delimited list of patterns which match modules

        that ViewVC should hide from users.

        ##

        You can use a simple list of modules, or something more complex:

        ##

        *) The “!” can be used before a module to explicitly state that it

        is NOT forbidden. Whenever this form is seen, then all modules will

        be forbidden unless one of the “!” modules match.

        ##

        ) Shell-style “glob” expressions may be used. “” will match any

        sequence of zero or more characters, “?” will match any single

        character, “[seq]” will match any character in seq, and “[!seq]”

        will match any character not in seq.

        ##

        *) Tests are performed in sequence. The first match will terminate the

        testing. This allows for more complex allow/deny patterns.

        ##

        Tests are case-sensitive.

        ##

        NOTE: Again, this is for the hiding of modules within repositories, not

        for the hiding of repositories (roots) themselves.

        ##

        Some examples:

        ##

        Disallow “example” but allow all others:

        forbidden = example

        ##

        Disallow “example1” and “example2” but allow all others:

        forbidden = example1, example2

        ##

        Allow only “example1” and “example2”:

        forbidden = !example1, !example2

        ##

        Forbid modules starting with “x”:

        forbidden = x*

        ##

        Allow modules starting with “x” but no others:

        forbidden = !x*

        ##

        Allow “xml”, forbid other modules starting with “x”, and allow the rest:

        forbidden = !xml, x*, !*

        ##
        #forbidden =

        ##—————————————————————————
        [authz-forbiddenre]

        The “forbiddenre” authorizer forbids access to repositories and

        repository paths by comparing a list of regular expressions

        (separated by commas) against paths consisting of the repository (or

        root) name plus the path of the versioned file or directory to be

        tested. For example, to see if the user is authorized to see the

        path “/trunk/www/index.html” in the repository whose root name is

        “svnrepos”, this authorizer will check the path

        “svnrepos/trunk/www/index.html” against the list of forbidden

        regular expressions. Directory paths will be terminated by a forward

        slash.

        ##

        NOTE: The options in this section apply only when the ‘authorizer’

        option (in the [options] section) is set to ‘forbiddenre’.

        forbiddenre: A comma-delimited list of regular expressions which

        match paths that ViewVC should hide from users.

        ##

        Like the “forbidden” authorizer…

        ##

        *) The “!” can be used before a module to explicitly state that it

        is NOT forbidden. Whenever this form is seen, then all modules will

        be forbidden unless one of the “!” modules match.

        ##

        *) Tests are performed in sequence. The first match will terminate the

        testing. This allows for more complex allow/deny patterns.

        ##

        Unlike the “forbidden” authorizer, you can can use this to hide roots, too.

        ##

        Some examples:

        ##

        Disallow files named “PRIVATE”, but allow all others:

        forbiddenre = /PRIVATE$

        ##

        Disallow the “hidden” repository, allowing all others:

        forbiddenre = ^hidden(/|$)

        ##

        Allow only the “example1” and “example2” roots and the paths inside them,

        disallowing all others (which can be done in multiple ways):

        forbiddenre = !^example1(/|$), !^example2(/|$)/

        forbiddenre = !^example12

        ##

        Only allow visibility of HTML files and the directories that hold them:

        forbiddenre = !^([^/]+|.*(/|.html))$

        ##
        #forbiddenre =

        ##—————————————————————————
        [authz-svnauthz]

        The “svnauthz” authorizer uses a Subversion authz configuration file

        to determine access to repository paths.

        ##

        NOTE: The options in this section apply only when the ‘authorizer’

        option (in the [options] section) is set to ‘svnauthz’.

        authzfile: Specifies the location of the authorization rules file

        (using an absolute path).

        ##
        #authzfile =

        root_relative_authzfile: Specifies the location of the

        authorization rules file using an path relative to the repository.

        ##

        Example:

        root_relative_authzfile = conf/access

        ##
        #root_relative_authzfile =

        force_username_case: Like the AuthzForceUsernameCase httpd.conf

        directive, set this to “upper” or “lower” to force the normalization

        to upper- or lower-case, respectively, of incoming usernames prior

        to comparison against the authorization rules files. Leave the

        option unset to preserve the username case.

        ##
        #force_username_case =

        ##—————————————————————————
        [query]

        The configuration items in this section are used exclusively by the

        ‘query’ script, a separate script from ViewVC itself that ships

        with ViewVC and allows for queries into the ViewVC commits

        database. If you aren’t using this separate script (which was made

        largely irrelevant by the introduction of an integrated “query”

        view in ViewVC itself, or aren’t using the ViewVC commits database

        functionality at all, you can ignore these configurations items

        altogether.

        viewvc_base_url: Base URL at which ViewVC may be accessed on this

        server. The default value for this option is determined at

        run-time by the various front-ends to the query script.

        ##

        Examples:

        viewvc_base_url = /viewvc.py

        viewvc_base_url = /viewvc.wsgi

        viewvc_base_url = /cgi-bin/viewvc

        viewvc_base_url = viewvc

        ##

        To disable cross-linking between the query script and ViewVC,

        uncomment this option and leave its value empty.

        ##
        #viewvc_base_url =

        ##—————————————————————————

      • Ryan February 2, 2016 / 6:03 pm

        Hey Adam,
        You have to un-commented these out by removing the “#” symbols. Follow the example above when you edit the viewvc.conf file.

        Hope that Helps.
        Ryan

      • Adam February 3, 2016 / 2:41 am

        Bingo! Thanks a lot Ryan!

      • Ryan February 3, 2016 / 7:12 pm

        You are welcome πŸ™‚

  14. Rohit March 10, 2016 / 12:46 am

    Great guide ! amazingly detailed ! thanks for the same.

    I have setup rancid, followed all the steps. Here’s a problem that I am facing.

    After defining hosts, devices in router.db and passwords/parameters in .cloginrc. I have also configured this to backup config of my cisco sb series switches (did the changes in rancid-fe and have rights permissions set for csblogin and csbrancid files). Finally i executed the /usr/local/rancid/bin/rancid-run command. This brought up all the devices UP in the repositories I created in CVS. all good.

    But the configuration is not being pulled by rancid. I checked logs and found the messages as below. Any help would be much appreciated.

    switch1 csblogin error: Error: missing close-brace
    switch1: missed cmd(s): show version,show system,show startup-config
    switch1: End of run not found

    Here are the settings that I did in the required files

    host file
    192.168.0.242 switch1

    router.db
    switch1:cisco-sb:up

    cloginrc
    add method switch1 ssh
    add user switch1 {admin}
    add password switch1 {passw0rd12$}
    add autoenable switch1 1
    add userprompt switch1 {“user name:”}

    -best
    Rohit

    • Ryan March 10, 2016 / 9:57 pm

      Hey Rohit,
      Everything looks good but on your router.db are you using semi-colon? (;) instead of a colon (:)? If you are using newer versions of rancid this needs to be a semi-colon in the router.db. It’s awesome that you are using a custom script to support other network devices however I’m have not used Cisco SB switches so the only thing I would look at is the cloginrc file. The missing close-brace error is usually means there is a brace “{” that is open still in your cloginrc file.

      Good Luck
      Ryan

      • Rohit March 12, 2016 / 12:55 am

        hey thanks Ryan.

        I am using colon coz its old version of rancid since in the new i can not update vendor table. however what you said is correct, i found the missing close brace. I looked for it before posting here but i guess I missed it and thought it could be due to some other reason. but thanks for getting back.

        again a great guide. it helped a lot !!!

  15. Iqbal March 18, 2016 / 5:23 am

    Hi Ryan πŸ™‚
    Hope you are doing well. After running the last command I get the following error. Could you please help me ?

    root@rancid-test:~# /usr/local/viewvc-1.1.24/bin/cvsdbadmin rebuild /usr/local/rancid/var/CVS/CVSROOT/
    Traceback (most recent call last):
    File “/usr/local/viewvc-1.1.24/bin/cvsdbadmin”, line 44, in
    import cvsdb
    File “/usr/local/viewvc-1.1.24/lib/cvsdb.py”, line 21, in
    import dbi
    File “/usr/local/viewvc-1.1.24/lib/dbi.py”, line 18, in
    import MySQLdb
    ImportError: No module named MySQLdb

    • Ryan March 21, 2016 / 5:25 pm

      Hey Iqbal,
      It looks like ViewVC can’t find the the MySQLdb module. Is MySQL (Mariadb) installed? I would think it is since you had to create users before running this command. What happens when you run this command? systemctl status mariadb

      Ryan

      • Iqbal March 22, 2016 / 4:52 am

        Hi Ryan,
        thanks for the reply. I don’t know what the reason is, but I was able to do it when I tried to do it again from the beginning πŸ™‚
        It looks like this now : https://onedrive.live.com/redir?resid=1BBA8AF56E1CCA90!4580&authkey=!AN-zNMBZRJY-d9I&v=3&ithint=photo%2cPNG

        What I want now is to change the ViewVC logo to be replaced by my company logo. I know I have to change the html page corresponding to it. But I don’t find that html page. Do you have any idea?
        Thanks a lot in advance πŸ™‚

      • Ryan March 25, 2016 / 6:19 pm

        Hey Iqbal,
        I have not played around the templates folder in ViewVC. All the HTML information is stored. usr/local/viewvc-1.1.24/templates/include

        Good Luck πŸ˜‰
        Ryan

  16. christopherbnash May 24, 2016 / 9:15 am

    [root@icewarp /]# /usr/local/viewvc-1.2-dev/bin/cvsdbadmin rebuild /usr/local/rancid/
    Traceback (most recent call last):
    File “/usr/local/viewvc-1.2-dev/bin/cvsdbadmin”, line 43, in
    import cvsdb
    File “/usr/local/viewvc-1.2-dev/lib/cvsdb.py”, line 20, in
    import dbi
    File “/usr/local/viewvc-1.2-dev/lib/dbi.py”, line 18, in
    import MySQLdb
    ImportError: No module named MySQLdb

    Having a problem. I checked my mariadb service and it’s working.

    • christopherbnash May 24, 2016 / 9:16 am

      [root@icewarp /]# /usr/local/viewvc-1.2-dev/bin/cvsdbadmin rebuild /usr/local/rancid/var/CVS/CVSROOT/

      • Ryan May 24, 2016 / 8:59 pm

        Chris did that rebuild work?

        Ryan

  17. christopherbnash May 25, 2016 / 9:10 am

    Yes fixed it. Problem was my config. The user ViewVC wasn’t cap and I need to install mysql-python and that fixed my issue.

  18. Jimmy.Li June 6, 2016 / 8:08 am

    Very helpful .I try to deploy Rancid in Centos 7 for a few weeks ,but cant solve problem caused by dependent packages ,I follow the instruction write by a few years ago ,some packages seems EOL, like mod_python and phpmhash .etc when i seems get into trouble , I find this awesome guidle .thank again ,especially you provide a link to discussions of the BBS .I look forward to your next article about Rancie

  19. Neel June 8, 2016 / 2:30 am

    Hello..

    Am very new to linux and am trying your installation guide above.

    After completing the installation, i have no access to http://rancid-ip/viewvc.

    When trying to restart httpd service. The following error is obtained.
    Job for httpd.service failed because the control process exited with error code. See “systemctl status httpd.service” and “journalctl -xe” for details.

    systemctl status httpd.service

    ● httpd.service – The Apache HTTP Server
    Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
    Active: failed (Result: exit-code) since Wed 2016-06-08 04:27:54 EDT; 1min 7s ago
    Docs: man:httpd(8)
    man:apachectl(8)
    Process: 2664 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
    Process: 2662 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
    Main PID: 2662 (code=exited, status=1/FAILURE)

    Jun 08 04:27:54 Test systemd[1]: Starting The Apache HTTP Server…
    Jun 08 04:27:54 Test httpd[2662]: httpd: Syntax error on line 368 of /etc/httpd/conf/httpd.conf: Expected but saw
    Jun 08 04:27:54 Test systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    Jun 08 04:27:54 Test kill[2664]: kill: cannot find process “”
    Jun 08 04:27:54 Test systemd[1]: httpd.service: control process exited, code=exited status=1
    Jun 08 04:27:54 Test systemd[1]: Failed to start The Apache HTTP Server.
    Jun 08 04:27:54 Test systemd[1]: Unit httpd.service entered failed state.
    Jun 08 04:27:54 Test systemd[1]: httpd.service failed.

    #journalctl -xe
    Jun 08 04:06:02 Test kill[2626]: kill: cannot find process “”
    Jun 08 04:06:02 Test systemd[1]: httpd.service: control process exited, code=exited status=1
    Jun 08 04:06:02 Test systemd[1]: Failed to start The Apache HTTP Server.
    — Subject: Unit httpd.service has failed
    — Defined-By: systemd

    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit httpd.service has failed.

    — The result is failed.
    Jun 08 04:06:02 Test systemd[1]: Unit httpd.service entered failed state.
    Jun 08 04:06:02 Test systemd[1]: httpd.service failed.
    Jun 08 04:06:02 Test polkitd[934]: Unregistered Authentication Agent for unix-process:2609:303230 (system bus name :1.15, object path /org/freedesktop
    Jun 08 04:27:54 Test polkitd[934]: Registered Authentication Agent for unix-process:2647:434481 (system bus name :1.16 [/usr/bin/pkttyagent –notify-f
    Jun 08 04:27:54 Test systemd[1]: Starting The Apache HTTP Server…
    — Subject: Unit httpd.service has begun start-up
    — Defined-By: systemd

    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit httpd.service has begun starting up.
    Jun 08 04:27:54 Test httpd[2662]: httpd: Syntax error on line 368 of /etc/httpd/conf/httpd.conf: Expected but saw
    Jun 08 04:27:54 Test systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
    Jun 08 04:27:54 Test kill[2664]: kill: cannot find process “”
    Jun 08 04:27:54 Test systemd[1]: httpd.service: control process exited, code=exited status=1
    Jun 08 04:27:54 Test systemd[1]: Failed to start The Apache HTTP Server.
    — Subject: Unit httpd.service has failed
    — Defined-By: systemd

    — Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

    — Unit httpd.service has failed.

    — The result is failed.
    Jun 08 04:27:54 Test systemd[1]: Unit httpd.service entered failed state.
    Jun 08 04:27:54 Test systemd[1]: httpd.service failed.
    Jun 08 04:27:54 Test polkitd[934]: Unregistered Authentication Agent for unix-process:2647:434481 (system bus name :1.16, object path /org/freedesktop
    lines 2349-2383/238

    Can you kindly help.

    • Ryan June 9, 2016 / 7:21 pm

      Neel,
      You might want to check your httpd.conf file (Line 368) there is something that is causing this error to come up, maybe a mistype?
      Jun 08 04:27:54 Test httpd[2662]: httpd: Syntax error on line 368 of /etc/httpd/conf/httpd.conf

      Hope that Helps,
      Ryan

      • Neel June 10, 2016 / 11:09 am

        Hello Ryan,

        Yea, thanks for he prompt reply. Indeed its a silly mistyping error. Its working great. Thanks. πŸ™‚

  20. Wayne June 16, 2016 / 11:41 pm

    A nice guide for me

    but when i access to “Query on /configs” website and click “search”, an error appears,can you help me solve?

    An Exception Has Occurred

    Python Traceback

    Traceback (most recent call last):
    File “/usr/local/viewvc-1.1.24/lib/viewvc.py”, line 4855, in main
    request.run_viewvc()
    File “/usr/local/viewvc-1.1.24/lib/viewvc.py”, line 408, in run_viewvc
    self.view_func(self)
    File “/usr/local/viewvc-1.1.24/lib/viewvc.py”, line 4484, in view_query
    db = cvsdb.ConnectDatabaseReadOnly(cfg)
    File “/usr/local/viewvc-1.1.24/lib/cvsdb.py”, line 908, in ConnectDatabaseReadOnly
    return ConnectDatabase(cfg, 1)
    File “/usr/local/viewvc-1.1.24/lib/cvsdb.py”, line 904, in ConnectDatabase
    db.Connect()
    File “/usr/local/viewvc-1.1.24/lib/cvsdb.py”, line 56, in Connect
    self._host, self._port, self._user, self._passwd, self._database)
    File “/usr/local/viewvc-1.1.24/lib/dbi.py”, line 63, in connect
    return MySQLdb.connect(host=host, port=port, user=user, passwd=passwd, db=db)
    File “/usr/lib64/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
    return Connection(*args, **kwargs)
    File “/usr/lib64/python2.7/site-packages/MySQLdb/connections.py”, line 187, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
    TypeError: connect() argument 3 must be string, not int

    • Ryan June 23, 2016 / 7:13 pm

      Hey Wayne,
      So to be honest I never really tried that query function. So I would not know where to start unfortunately. I did a test on my box and I get a different error then yours 😦
      To what it looks like you might have typed something wrong in the search bar, maybe? I would just search for everything “Since the beginning of time” and see if you get anything comes up

      Ryan

  21. ginesgb June 23, 2016 / 9:34 am

    Hi , it was looking like rancid change settings to make a single shipment notification email every 24 hours. I use RANCID for all my network device config backups. For non critical networks, or execs that wanted to know what was going on it the network .
    Greetings and thank you

    • Ryan June 23, 2016 / 7:13 pm

      Your Welcome πŸ™‚

  22. amolaknet July 27, 2016 / 11:23 am

    Hi Ryan,

    I am getting below error.

    [root@localhost viewvc-1.1.24]# /usr/local/viewvc-1.1.24/bin/make-database
    MySQL Hostname (leave blank for default):
    MySQL Port (leave blank for default):
    MySQL User: VIEWVC
    MySQL Password: *******
    ViewVC Database Name [default: ViewVC]:
    ERROR 1045 (28000): Access denied for user ‘VIEWVC’@’localhost’ (using password: YES)

    [ERROR] The database did not create sucessfully.

    MariaDB [(none)]> SHOW GRANTS FOR ‘VIEWVC’@’localhost’\G
    *************************** 1. row ***************************
    Grants for VIEWVC@localhost: GRANT ALL PRIVILEGES ON . TO ‘VIEWVC’@’localhost’ IDENTIFIED BY PASSWORD ‘*6025816A8686624E0CC3FA5F99FB8043E68252B7’ WITH GRANT OPTION
    1 row in set (0.00 sec)

    I have tried to grant privileges again and flush privileges but no luck.

    Could you please help.

    Thanks,
    Amolak

    • amolaknet July 27, 2016 / 1:28 pm

      nm…I have reinstalled mariadb-server & mariadb. It fixed the issue. Thanks for this great article.

      • Ryan July 28, 2016 / 7:39 pm

        No problem, glad you where able to get it working πŸ™‚

Leave a Reply...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s