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 [2008/05/06 09:14]
morten cricket data dir fix
installing_from_source_on_debian [2010/02/10 12:15]
lkarsten don't use make -jX
Line 3: Line 3:
  
 Versions used: Versions used:
-^ Debian | 4.0 (//Etch//) | +^ Debian | 5.0 (//Lenny//) | 
-^ NAV    | 3.3.3          ​|+^ NAV    | 3.5.2           |
  
  
Line 13: Line 13:
  
 Make sure you have the //​non-free//​ archive present in your Make sure you have the //​non-free//​ archive present in your
-''​sources.list''​.  Install NAV's runtime dependencies:+''​sources.list'':​
  
 <​code>​ <​code>​
-sudo aptitude install perl python sun-java5-jdk apache2-mpm-prefork \ +deb http://​ftp.no.debian.org/​debian/​ lenny main contrib non-free 
-                      ​cricket php4-gd php4-pgsql postgresql-8.1 tomcat5.5 \ +deb-src http://ftp.no.debian.org/​debian/​ lenny main contrib non-free 
-                      libapache2-mod-php4 libapache2-mod-python libpgjava \ + 
-                      ​libpg-perl libnetaddr-ip-perl libdbd-pg-perl \ +deb http://​security.debian.org/ lenny/​updates main contrib non-free 
-                      ​libsnmp1.4-java libsnmp-session-perl python-pysnmp2 \ +deb-src http://​security.debian.org/​ lenny/​updates main contrib non-free
-                      ​logrotate python-cheetah python-egenix-mxdatetime \ +
-                      python-forgethtml python-forgetsql python-gammu \ +
-                      python-ipy python-ldap python-psycopg python-rrd \ +
-                      makepasswd wwwconfig-common samba-common+
 </​code>​ </​code>​
  
-**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 JDK is installed (''​sun-java5-jdk''​).+Install NAV's runtime dependencies:​ 
 + 
 +<​code>​ 
 +sudo aptitude install perl python sun-java6-jdk apache2-mpm-prefork \ 
 +                      cricket postgresql-8.3 libapache2-mod-python \ 
 +                      libpg-java libpg-perl libsnmp1.4-java \ 
 +                      python-pysnmp2 logrotate python-cheetah \ 
 +                      python-xmpp python-django \ 
 +                      python-egenix-mxdatetime python-forgethtml \ 
 +                      python-forgetsql python-gammu python-ipy \ 
 +                      python-ldap python-psycopg python-psycopg2 \ 
 +                      python-pyrad python-rrd makepasswd \ 
 +                      wwwconfig-common samba-common 
 +</​code>​ 
 + 
 +**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 JDK is installed (''​sun-java6-jdk''​) ​and is the active alternative for the ''​java''​ and ''​javac''​ commands: 
 + 
 +<​code>​ 
 +sudo update-alternatives --config java 
 +sudo update-alternatives --config javac 
 +</​code>​
  
 Next, NAV's build time dependencies:​ Next, NAV's build time dependencies:​
  
 <​code>​ <​code>​
-sudo aptitude install ​sun-java5-jdk ​ant autoconf libsnmp1.4-java libtomcat5.5-java python python-cheetah ​tomcat5.5+sudo aptitude install ant autoconf libsnmp1.4-java python python-cheetah ​sun-java5-jdk
 </​code>​ </​code>​
  
 ===== Unpacking and building NAV ===== ===== Unpacking and building NAV =====
 <​code>​ <​code>​
-tar xvzf nav-3.3.3.tar.gz +tar xvzf nav-3.5.2.tar.gz 
-cd nav-3.3.3+cd nav-3.5.2
 autoconf autoconf
-./​configure +./​configure ​CRICKETDIR=/​usr/​share/​cricket 
-export CLASSPATH=/​usr/​share/​java/​libsnmp-1.4.jar:/​usr/​share/​java/​postgresql.jar:/​usr/​share/​java/​servlet-api.jar+export CLASSPATH=/​usr/​share/​java/​libsnmp-1.4.jar:/​usr/​share/​java/​postgresql.jar
 make make
 sudo make install sudo make install
 </​code>​ </​code>​
- +Note: avoid using -j when calling make. It will break the build, since make tries to run many ant processes with interdependencies at the same time.
- +
  
  
 ===== Installing and initializing the database schema ===== ===== Installing and initializing the database schema =====
-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:+Edit ''/​etc/​postgresql/​8.3/​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>​ <​code>​
 local   ​all ​        ​postgres ​                         ident sameuser local   ​all ​        ​postgres ​                         ident sameuser
Line 60: Line 74:
 </​code>​ </​code>​
  
-Then reload ​PosttgreSQL ​to make the changes effective:+Then reload ​PostgreSQL ​to make the changes effective:
 <​code>​ <​code>​
-sudo invoke-rc.d postgresql-8.reload+sudo invoke-rc.d postgresql-8.reload
 </​code>​ </​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''​. 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:+To create the PostgreSQL ​user and database:
 <​code>​ <​code>​
-sudo -u postgres bash 
 # The following command will prompt for a password for the new database user. # The following command will prompt for a password for the new database user.
 # Pick one of your own choosing. ​ # Pick one of your own choosing. ​
-createuser --no-createrole --no-createdb ​--no-superuser --pwprompt nav +sudo -u postgres ./createdb.sh
-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>​ </​code>​
  
 :!: 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''​. :!: 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''​.
  
-===== Fixing Python =====+===== Fixing Python ​library path =====
 We do this because we don't install the libraries to the systemwide Python library directories. ​ We do however want them available for use systemwide: We do this because we don't install the libraries to the systemwide Python library directories. ​ We do however want them available for use systemwide:
 <​code>​ <​code>​
-sudo bash -c 'cat << EOF > /usr/​local/​lib/python2.4/​site-packages/​sitecustomize.py+sudo bash -c 'cat << EOF >> /etc/python2.5/​sitecustomize.py 
 import sys import sys
 __navpath = "/​usr/​local/​nav/​lib/​python"​ __navpath = "/​usr/​local/​nav/​lib/​python"​
Line 109: Line 105:
  
  
-===== Fixing Java =====+===== Fixing Java libraries ​=====
 <​code>​ <​code>​
-cd /​var/​lib/​tomcat5.5/​webapps 
-sudo ln -s /​usr/​local/​nav/​apache/​webapps/​*.war . 
- 
 cd /​usr/​local/​nav/​lib/​java cd /​usr/​local/​nav/​lib/​java
 sudo ln -s /​usr/​share/​java/​postgresql.jar sudo ln -s /​usr/​share/​java/​postgresql.jar
Line 119: Line 112:
 </​code>​ </​code>​
  
-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.   +===== Fixing Perl libraries ​=====
- +
-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>​ +
-sudo invoke-rc.d tomcat5.5 restart +
-</​code>​ +
- +
-===== Fixing Perl =====+
 <​code>​ <​code>​
 cd /​usr/​share/​perl5 cd /​usr/​share/​perl5
Line 165: Line 145:
  
 <​Location /> <​Location />
-    # Let NAV authorize all access to this location +    # Enable debugging on errors, if you like
-    PythonHeaderParserHandler nav.web ​+
     PythonDebug on     PythonDebug on
 </​Location>​ </​Location>​
Line 175: Line 154:
 sudo a2dissite default sudo a2dissite default
 sudo a2ensite default-nav sudo a2ensite default-nav
-sudo a2enmod php4 
 sudo a2enmod mod_python sudo a2enmod mod_python
 sudo invoke-rc.d apache2 force-reload sudo invoke-rc.d apache2 force-reload
Line 196: Line 174:
  
 Edit ''/​usr/​local/​nav/​etc/​nav.conf'',​ set your ''​ADMIN_MAIL''​ and ''​DOMAIN_SUFFIX''​ options. Edit ''/​usr/​local/​nav/​etc/​nav.conf'',​ set your ''​ADMIN_MAIL''​ and ''​DOMAIN_SUFFIX''​ options.
 +Also set ''​DJANGO_DEBUG=True''​ if you want complete error information when stuff goes awry in the web interface.
  
 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''​
Line 206: Line 185:
  
  
-===== Fixing ​Cricket =====+===== Initialize ​Cricket ​configuration ​=====
  
 Cricket should already be installed as it is a part of the runtime dependencies. ​ 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:​ +Remove ​''​/​etc/​cron.d/​cricket'' ​or comment out the active cron job line in the file.
-<​code>​*/​5 * * * *    cricket ​...</​code>​+
  
 Create a directory to place the nav cricket-config:​ Create a directory to place the nav cricket-config:​
 <​code>​sudo mkdir /​usr/​local/​nav/​etc/​cricket-config</​code>​ <​code>​sudo mkdir /​usr/​local/​nav/​etc/​cricket-config</​code>​
  
-Change owner to navcron.nav+Change owner to navcron:nav
 <​code>​ <​code>​
-sudo chown navcron.nav /​usr/​local/​nav/​etc/​cricket-config+sudo chown navcron:nav /​usr/​local/​nav/​etc/​cricket-config
 </​code>​ </​code>​
  
Line 257: Line 235:
 cd /​usr/​local/​nav/​bin cd /​usr/​local/​nav/​bin
 sudo -u navcron ./​makecricketconfig.pl 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>​ </​code>​
  
Line 302: Line 271:
 sudo bash -c 'echo "​SetHandler none" > .htaccess'​ sudo bash -c 'echo "​SetHandler none" > .htaccess'​
 </​code>​ </​code>​
 +
installing_from_source_on_debian.txt · Last modified: 2011/06/24 08:05 by vegardv