User Tools

Site Tools


installing_from_source_on_debian

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
installing_from_source_on_debian [2007/09/18 10:48]
morten
installing_from_source_on_debian [2008/05/06 09:14]
morten cricket data dir fix
Line 3: Line 3:
  
 Versions used: Versions used:
-^ Debian | 4.0 (Etch) | +^ Debian | 4.0 (//Etch//) | 
-^ NAV    | 3.3.0-rc   |+^ NAV    | 3.3.3          ​| 
 + 
 + 
 + 
  
 ===== Installing dependencies ===== ===== Installing dependencies =====
-Install NAV's runtime dependencies:​+ 
 +Make sure you have the //​non-free//​ archive present in your 
 +''​sources.list''​.  ​Install NAV's runtime dependencies:​ 
 <​code>​ <​code>​
-sudo aptitude install perl python ​java-virtual-machine ​apache2-mpm-prefork \+sudo aptitude install perl python ​sun-java5-jdk apache2-mpm-prefork \
                       cricket php4-gd php4-pgsql postgresql-8.1 tomcat5.5 \                       cricket php4-gd php4-pgsql postgresql-8.1 tomcat5.5 \
-                      libapache2-mod-php4 libapache2-mod-python libpgjava \ +                      libapache2-mod-php4 libapache2-mod-python libpgjava \
                       libpg-perl libnetaddr-ip-perl libdbd-pg-perl \                       libpg-perl libnetaddr-ip-perl libdbd-pg-perl \
                       libsnmp1.4-java libsnmp-session-perl python-pysnmp2 \                       libsnmp1.4-java libsnmp-session-perl python-pysnmp2 \
Line 20: Line 27:
 </​code>​ </​code>​
  
-And, of course, NAV's build time dependencies:​+**OR**check out Morten Werner Forsbring'​s dummy NAV package, which depends on all of the above. ​ See the following nav-users posting for details: https://​postlister.uninett.no/​sympa/​arc/​nav-users/​2008-02/​msg00001.html . Be aware that NAV doesn'​t run well under the //kaffe// Java VM, which is why you should confirm that Sun's Java 5 JDK is installed (''​sun-java5-jdk''​). 
 + 
 +Next, NAV's build time dependencies:​
  
 <​code>​ <​code>​
-sudo aptitude install ​FIXME+sudo aptitude install ​sun-java5-jdk ant autoconf libsnmp1.4-java libtomcat5.5-java python python-cheetah tomcat5.5
 </​code>​ </​code>​
  
 ===== Unpacking and building NAV ===== ===== Unpacking and building NAV =====
 <​code>​ <​code>​
-tar xvzf nav-3.3.0_rc1.tar.gz +tar xvzf nav-3.3.3.tar.gz 
-cd nav-3.3.0_rc1+cd nav-3.3.3
 autoconf autoconf
 ./configure ./configure
Line 36: Line 45:
 sudo make install sudo make install
 </​code>​ </​code>​
 +
 +
 +
 +
  
 ===== Installing and initializing the database schema ===== ===== Installing and initializing the database schema =====
-While still in the NAV source code directory.+Edit ''/​etc/​postgresql/​8.1/​main/​pg_hba.conf'',​ change ''​ident sameuser''​ into ''​md5''​ for local users connecting through UNIX sockets (except the postgres user). ​ The file should look something like this: 
 +<​code>​ 
 +local   ​all ​        ​postgres ​                         ident sameuser 
 +local   ​all ​        ​all ​                              md5 
 + 
 +host    all         ​all ​        ​127.0.0.1/​32 ​         md5 
 +host    all         ​all ​        ::​1/​128 ​              md5 
 +</​code>​ 
 + 
 +Then reload PosttgreSQL to make the changes effective:​ 
 +<​code>​ 
 +sudo invoke-rc.d postgresql-8.1 reload 
 +</​code>​ 
 + 
 +While still in the NAV source code directory, ''​cd''​ to ''​doc/​sql''​ The following set of commands assume you have sudo access to run commands as the ''​postgres''​ system user.  If not, please become the ''​postgres''​ user in some other way.  The procedure has been adapted from ''​doc/​sql/​README''​. 
 + 
 +To create the set of PostgreSQL users and databases:​ 
 +<​code>​ 
 +sudo -u postgres bash 
 +# The following command will prompt for a password for the new database user. 
 +# Pick one of your own choosing.  
 +createuser --no-createrole --no-createdb --no-superuser --pwprompt nav 
 +createdb --owner nav --encoding UTF-8 manage 
 +createdb --owner nav --encoding UTF-8 navprofiles 
 +createdb --owner nav --encoding UTF-8 logger 
 +createdb --owner nav --encoding UTF-8 arnold 
 +createlang plpgsql manage 
 +createlang plpgsql navprofiles 
 +</​code>​ 
 + 
 +Then initialize the schemas and data: 
 +<​code>​ 
 +# First, export the password you selected for the database user above: 
 +export PGPASSWORD=<​secretpassword>​ 
 +psql -f manage.sql manage nav 
 +psql -f types.sql manage nav 
 +psql -f snmpoid.sql manage nav 
 +psql -f navprofiles.sql navprofiles nav 
 +psql -f logger.sql logger nav 
 +psql -f arnold.sql arnold nav 
 +</​code>​
  
-  * FIXME follow doc/​sql/​README +:!: Then, take the password you chose for the database user and put this as the value to the ''​userpw_nav''​ option in ''/​usr/local/nav/etc/db.conf''​.
-  * Edit ''/​etc/postgresql/8.1/main/pg_hba.conf''​, change ''​ident sameuser''​ into ''​md5''​ for local users connecting through UNIX sockets (except the postgres user) +
-  * ''​sudo invoke-rc.d postgresql-8.1 reload''​+
  
 ===== Fixing Python ===== ===== Fixing Python =====
Line 55: Line 106:
 ' '
 </​code>​ </​code>​
 +
 +
  
 ===== Fixing Java ===== ===== Fixing Java =====
Line 66: Line 119:
 </​code>​ </​code>​
  
-Change ''/​etc/​tomcat5.5/​web.xml'',​ the line that reads ''<​Connector port="​8180"​ maxHttpHeaderSize="​8192"'':​ alter ''​port="​8180"''​ to ''​port="​8080"'',​ as NAV expects Tomcat to listen to this port.  ​Then run the following:+Change ''/​etc/​tomcat5.5/​server.xml'',​ the line that reads ''<​Connector port="​8180"​ maxHttpHeaderSize="​8192"'':​ alter ''​port="​8180"''​ to ''​port="​8080"'',​ as NAV expects Tomcat to listen to this port.  ​
  
 +Change ''/​etc/​default/​tomcat5.5'',​ make sure the following two options are set like this:
 +<​code>​
 +CATALINA_OPTS="​-Djava.awt.headless=true -Xmx128M -server -Djava.ext.dirs=/​usr/​local/​nav/​lib/​java"​
 +TOMCAT5_SECURITY=no
 +</​code>​
 +
 +Then run the following:
 <​code>​ <​code>​
 sudo invoke-rc.d tomcat5.5 restart sudo invoke-rc.d tomcat5.5 restart
Line 119: Line 179:
 sudo invoke-rc.d apache2 force-reload sudo invoke-rc.d apache2 force-reload
 </​code>​ </​code>​
 +
 +
  
  
Line 137: Line 199:
 Optionally make the nav process control command more available: ''​sudo ln -s /​usr/​local/​nav/​bin/​nav /​usr/​sbin/​nav''​ Optionally make the nav process control command more available: ''​sudo ln -s /​usr/​local/​nav/​bin/​nav /​usr/​sbin/​nav''​
  
 +
 +
 +
 +
 +
 +
 +
 +===== Fixing Cricket =====
 +
 +Cricket should already be installed as it is a part of the runtime dependencies. ​
 +
 +Remove /​etc/​cron.d/​cricket or comment out the line starting with the following:
 +<​code>​*/​5 * * * *    cricket ...</​code>​
 +
 +Create a directory to place the nav cricket-config:​
 +<​code>​sudo mkdir /​usr/​local/​nav/​etc/​cricket-config</​code>​
 +
 +Change owner to navcron.nav
 +<​code>​
 +sudo chown navcron.nav /​usr/​local/​nav/​etc/​cricket-config
 +</​code>​
 +
 +Edit the /​etc/​cricket/​cricket-conf.pl and set the configroot variable. At the same time, fix the logging. Cricket defaults to /​var/​log/​cricket as logdir. This directory is created on install, but the owner is cricket. Either create your own logdir and set the correct path ($gLogDir) in /​etc/​cricket/​cricket-conf.pl or change ownership of /​var/​log/​cricket to navcron.
 +<​code>​
 +$gConfigRoot = "/​usr/​local/​nav/​etc/​cricket-config"​
 +$gLogDir = your/​log/​dir
 +</​code>​
 +
 +Copy /​usr/​local/​nav/​doc/​cricket/​cricket/​subtree-sets to /​etc/​cricket/​
 +<​code>​
 +cd /​etc/​cricket
 +sudo cp /​usr/​local/​nav/​doc/​cricket/​cricket/​subtree-sets .
 +</​code>​
 +
 +As navcron, copy recursively /​usr/​local/​nav/​doc/​cricket/​cricket-config/​ to your cricket-config
 +<​code>​
 +sudo -u navcron cp -r /​usr/​local/​nav/​doc/​cricket/​cricket-config /​usr/​local/​nav/​etc/​
 +</​code>​
 +
 +Create a directory to store Cricket'​s data files, and give ''​navcron''​ ownership of that directory.
 +<​code>​
 +sudo mkdir /​usr/​local/​nav/​var/​cricket-data
 +sudo chown navcron /​usr/​local/​nav/​var/​cricket-data
 +</​code>​
 +
 +Go to the cricket-config directory and edit the "​Defaults"​ file. Replace the Datadir with the correct path to cricket-data. Don't forget the %auto-target-path%
 +<​code>​
 +Target ​ --default--
 +    dataDir ​        = /​usr/​local/​nav/​var/​cricket-data/​%auto-target-path%
 +</​code>​
 +
 +Compile the cricket-config as navcron to create the cricket-database.
 +<​code>​sudo -u navcron cricket-compile</​code>​
 +
 +Run makecricketconfig.pl to create config from the database. The first time, remember that the database should contain data before doing this. Also, it's a good idea to start getDeviceData and let it run a good couple of minutes before making the cricket-config as it then will have gathered and stored data in the database.
 +<​code>​
 +cd /​usr/​local/​nav/​bin
 +sudo -u navcron ./​makecricketconfig.pl
 +</​code>​
 +
 +Finally we fix nav's startupscript for cricket. Go to /​usr/​local/​nav/​etc/​cron.d/​ and edit "​cricket"​.
 +<​code>​
 +CRICKETDIR = /​usr/​share/​cricket
 +
 +*/5 * * * * $CRICKETDIR/​collect-subtrees normal ​
 +12 5 * * * $BINDIR/​makecricketconfig.pl
 +0 5 * * * $BINDIR/​cleanrrds.pl -d -p /​usr/​local/​nav/​var/​cricket-data/​
 +</​code>​
 +
 +Now, start Cricket:
 +<​code>​
 +cd /​usr/​local/​nav/​bin
 +sudo ./nav start cricket
 +</​code>​
 +
 +
 +
 +
 +
 +
 +
 +==== Cricket Web ====
 +
 +Create the cricket directory in apache/​webroot/​
 +<​code>​
 +cd /​usr/​local/​nav/​apache/​webroot
 +sudo mkdir cricket
 +</​code>​
 +
 +Make a symlink to the cricket cgi-scripts and copy cricket.css from source.
 +<​code>​
 +cd /​usr/​local/​nav/​apache/​webroot/​cricket
 +sudo ln -s /​usr/​lib/​cgi-bin/​cricket/​grapher.cgi ​
 +sudo ln -s /​usr/​lib/​cgi-bin/​cricket/​mini-graph.cgi
 +sudo ln -s grapher.cgi index.cgi
 +sudo ln -s /​usr/​share/​cricket/​images
 +sudo cp /​usr/​local/​nav/​doc/​cricket/​public_html/​cricket.css .
 +</​code>​
 +
 +Create .htaccess-file to make sure mod_python doesn'​t handle this directory.
 +<​code>​
 +sudo bash -c 'echo "​SetHandler none" > .htaccess'​
 +</​code>​
installing_from_source_on_debian.txt · Last modified: 2011/06/24 08:05 by vegardv