User Tools

Site Tools


installing_from_source_on_debian

This is an old revision of the document!


Installing NAV from source on Debian GNU/Linux

This is an attempt at a guide and a few helpful pointers for those who don't care to use the prepackaged NAV for Debian. The versions used here are Debian Etch and NAV 3.3.0-rc1.

Installing dependencies

Install NAV's runtime dependencies:

sudo aptitude install perl python java-virtual-machine apache2-mpm-prefork \
                      cricket php4-gd php4-pgsql postgresql-8.1 tomcat5.5 \
                      libapache2-mod-php4 libapache2-mod-python libpgjava \ 
                      libpg-perl libnetaddr-ip-perl libdbd-pg-perl \
                      libsnmp1.4-java libsnmp-session-perl python-pysnmp2 \
                      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

And, of course, NAV's build time dependencies:

sudo aptitude install FIXME

Unpacking and building NAV

tar xvzf nav-3.3.0_rc1.tar.gz
cd nav-3.3.0_rc1
autoconf
./configure
export CLASSPATH=/usr/share/java/libsnmp-1.4.jar:/usr/share/java/postgresql.jar:/usr/share/java/servlet-api.jar
make
sudo make install

Installing and initializing the database schema

While still in the NAV source code directory.

  • FIXME follow doc/sql/README
  • 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

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:

sudo bash -c 'cat << EOF > /usr/local/lib/python2.4/site-packages/sitecustomize.py
import sys
__navpath = "/usr/local/nav/lib/python"
if __navpath not in sys.path:
    sys.path.append(__navpath)
EOF
'

Fixing Java

cd /var/lib/tomcat5.5/webapps
sudo ln -s /usr/local/nav/apache/webapps/*.war .

cd /usr/local/nav/lib/java
sudo ln -s /usr/share/java/postgresql.jar
sudo ln -s /usr/share/java/libsnmp-1.4.jar

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:

sudo invoke-rc.d tomcat5.5 restart

Fixing Perl

cd /usr/share/perl5
sudo ln -s /usr/local/nav/lib/perl/NAV* .

Configuring Apache

Put this in /etc/apache2/sites-available/default-nav:

ServerName nav.example.com
ServerAdmin webmaster@example.com

DirectoryIndex index.html index.html index.php index.cgi index.py
AccessFileName .htaccess
AddDefaultCharset UTF-8
AddHandler cgi-script .cgi

DocumentRoot /usr/local/nav/apache/webroot
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

<Directory "/usr/local/nav/apache/webroot">
    Options Indexes FollowSymLinks ExecCGI 
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

LogLevel warn

<Location />
    # Let NAV authorize all access to this location
    PythonHeaderParserHandler nav.web 
    PythonDebug on
</Location>

Then run the following commands:

sudo a2dissite default
sudo a2ensite default-nav
sudo a2enmod php4
sudo a2enmod mod_python
sudo invoke-rc.d apache2 force-reload

Cleaning up and configuring

Create groups and users, and set proper permissions:

sudo addgroup --system nav
sudo adduser --system --no-create-home --home /usr/local/nav \
             --shell /bin/sh --ingroup nav navcron;
sudo addgroup navcron dialout

cd /usr/local/nav/var
sudo chown -R navcron:nav .

Edit /usr/local/nav/etc/nav.conf, set your ADMIN_MAIL and DOMAIN_SUFFIX options.

Optionally make the nav process control command more available: sudo ln -s /usr/local/nav/bin/nav /usr/sbin/nav

installing_from_source_on_debian.1190109053.txt.gz · Last modified: 2007/09/18 09:50 by morten