installing_from_source_on_debian
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| installing_from_source_on_debian [2007/09/18 09:24] – morten | installing_from_source_on_debian [2011/06/24 08:05] (current) – [Installing dependencies] vegardv | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Installing NAV from source on Debian GNU/Linux ====== | ====== 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. | + | 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. |
| + | |||
| + | Versions | ||
| + | ^ Debian | ||
| + | ^ NAV | ||
| ===== Installing dependencies ===== | ===== Installing dependencies ===== | ||
| + | |||
| + | Make sure you have the // | ||
| + | '' | ||
| + | |||
| + | < | ||
| + | deb http:// | ||
| + | deb-src http:// | ||
| + | |||
| + | deb http:// | ||
| + | deb-src http:// | ||
| + | </ | ||
| + | |||
| Install NAV's runtime dependencies: | Install NAV's runtime dependencies: | ||
| + | |||
| + | < | ||
| + | sudo aptitude install perl python sun-java6-jdk apache2-mpm-prefork \ | ||
| + | cricket postgresql-8.3 libapache2-mod-python \ | ||
| + | libpg-java libsnmp1.4-java python-pysnmp2 logrotate \ | ||
| + | python-cheetah python-xmpp python-django \ | ||
| + | python-egenix-mxdatetime python-gammu python-ipy \ | ||
| + | python-ldap python-psycopg2 python-pyrad \ | ||
| + | python-pysnmp-se python-twisted python-twisted-snmp \ | ||
| + | python-rrd rrdtool samba-common | ||
| + | </ | ||
| + | |||
| + | Be aware that NAV doesn' | ||
| + | |||
| < | < | ||
| - | sudo aptitude install perl python java-virtual-machine apache2-mpm-prefork \ | + | sudo update-alternatives |
| - | cricket php4-gd php4-pgsql postgresql-8.1 tomcat5.5 \ | + | sudo update-alternatives |
| - | libapache2-mod-php4 libapache2-mod-python libpgjava \ | + | |
| - | libpg-perl libnetaddr-ip-perl libdbd-pg-perl \ | + | |
| - | libsnmp1.4-java libsnmp-session-perl python-pysnmp2 \ | + | |
| - | | + | |
| - | 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: | + | Next, NAV's build time dependencies: |
| < | < | ||
| - | sudo aptitude install | + | sudo aptitude install |
| </ | </ | ||
| ===== Unpacking and building NAV ===== | ===== Unpacking and building NAV ===== | ||
| < | < | ||
| - | tar xvzf nav-3.3.0_rc1.tar.gz | + | tar xvzf nav-3.7.0.tar.gz |
| - | cd nav-3.3.0_rc1 | + | cd nav-3.7.0 |
| - | autoconf | + | ./ |
| - | ./ | + | export CLASSPATH=/ |
| - | export CLASSPATH=/ | + | |
| make | make | ||
| sudo make install | sudo make install | ||
| </ | </ | ||
| + | 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 ===== | ||
| - | While still in the NAV source code directory. | + | Edit ''/ |
| + | < | ||
| + | local | ||
| + | local | ||
| - | * FIXME follow doc/sql/README | + | host all |
| - | * Edit ''/ | + | host all |
| - | * '' | + | </ |
| - | ===== Making Python libraries available | + | Then reload PostgreSQL |
| - | We do this because we don't install the libraries to the systemwide Python library directories. | + | |
| < | < | ||
| - | sudo bash -c 'cat << | + | sudo invoke-rc.d postgresql-8.3 reload |
| + | </ | ||
| + | |||
| + | While still in the NAV source code directory, | ||
| + | |||
| + | To create the PostgreSQL user and database: | ||
| + | <code> | ||
| + | # The following command will prompt for a password for the new database user. | ||
| + | # Pick one of your own choosing. | ||
| + | sudo -u postgres ./ | ||
| + | </code> | ||
| + | |||
| + | :!: Then, take the password you chose for the database user and put this as the value to the '' | ||
| + | |||
| + | ===== Fixing Python library path ===== | ||
| + | We do this because we don't install the libraries to the systemwide Python library directories by default. | ||
| + | < | ||
| + | sudo bash -c 'cat << EOF >> / | ||
| import sys | import sys | ||
| __navpath = "/ | __navpath = "/ | ||
| Line 50: | Line 95: | ||
| EOF | EOF | ||
| ' | ' | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Fixing Java libraries ===== | ||
| + | < | ||
| + | cd / | ||
| + | sudo ln -s / | ||
| + | sudo ln -s / | ||
| </ | </ | ||
| Line 79: | Line 133: | ||
| < | < | ||
| - | # Let NAV authorize all access to this location | + | # Enable debugging on errors, if you like |
| - | PythonHeaderParserHandler nav.web | + | |
| PythonDebug on | PythonDebug on | ||
| </ | </ | ||
| Line 89: | Line 142: | ||
| 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 | ||
| </ | </ | ||
| + | ===== Cleaning up and configuring ===== | ||
| + | Create groups and users, and set proper permissions: | ||
| + | < | ||
| + | sudo addgroup --system nav | ||
| + | sudo adduser --system --no-create-home --home / | ||
| + | | ||
| + | sudo addgroup navcron dialout | ||
| - | ===== Installing NAV Java components | + | cd / |
| + | sudo chown -R navcron:nav . | ||
| + | </ | ||
| + | |||
| + | Edit ''/ | ||
| + | Also set '' | ||
| + | |||
| + | Optionally make the nav process control command more available: '' | ||
| + | |||
| + | |||
| + | ===== Initialize Cricket configuration | ||
| + | |||
| + | Cricket should already be installed as it is a part of the runtime dependencies. | ||
| + | |||
| + | Remove ''/ | ||
| + | |||
| + | Create a directory to place the nav cricket-config: | ||
| + | < | ||
| + | |||
| + | Change owner to navcron:nav | ||
| < | < | ||
| - | cd / | + | sudo chown navcron: |
| - | sudo ln -s / | + | </code> |
| - | cd /usr/local/nav/lib/java | + | 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 / |
| - | sudo ln -s /usr/share/java/postgresql.jar | + | < |
| - | sudo ln -s /usr/share/java/libsnmp-1.4.jar | + | $gConfigRoot = "/usr/local/nav/etc/cricket-config" |
| + | $gLogDir = your/ | ||
| </ | </ | ||
| - | Change '' | + | Copy / |
| + | < | ||
| + | cd / | ||
| + | sudo cp / | ||
| + | </ | ||
| + | |||
| + | As navcron, copy recursively / | ||
| + | < | ||
| + | sudo -u navcron cp -r / | ||
| + | </ | ||
| + | |||
| + | Create a directory to store Cricket's data files, and give '' | ||
| + | <code> | ||
| + | sudo mkdir / | ||
| + | sudo chown navcron / | ||
| + | </ | ||
| + | |||
| + | Go to the cricket-config directory and edit the "Defaults" | ||
| + | < | ||
| + | Target | ||
| + | dataDir | ||
| + | </ | ||
| + | |||
| + | Compile the cricket-config as navcron to create the cricket-database. | ||
| + | < | ||
| + | |||
| + | Run '' | ||
| + | < | ||
| + | cd / | ||
| + | sudo -u navcron ./mcc.py | ||
| + | </ | ||
| + | |||
| + | Now, start Cricket: | ||
| + | < | ||
| + | cd / | ||
| + | sudo ./nav start cricket | ||
| + | </ | ||
| + | |||
| + | ==== Cricket Web ==== | ||
| + | |||
| + | Create the cricket directory in apache/ | ||
| + | < | ||
| + | cd / | ||
| + | sudo mkdir cricket | ||
| + | </ | ||
| + | |||
| + | Make a symlink to the cricket cgi-scripts and copy cricket.css from source. | ||
| + | < | ||
| + | cd / | ||
| + | sudo ln -s / | ||
| + | sudo ln -s / | ||
| + | sudo ln -s grapher.cgi index.cgi | ||
| + | sudo ln -s / | ||
| + | sudo cp / | ||
| + | </ | ||
| + | Create .htaccess-file to make sure mod_python doesn' | ||
| < | < | ||
| - | sudo invoke-rc.d tomcat5.5 restart | + | sudo bash -c 'echo " |
| </ | </ | ||
installing_from_source_on_debian.1190107442.txt.gz · Last modified: by morten
