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 [2008/04/17 07:14] – bredal | installing_from_source_on_debian [2011/06/24 08:05] (current) – [Installing dependencies] vegardv | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Versions used: | Versions used: | ||
| - | ^ Debian | 4.0 (//Etch//) | | + | ^ Debian | 5.0 (//Lenny//) | |
| - | ^ NAV | 3.3.3 | + | ^ NAV | 3.7 | |
| + | ===== Installing dependencies ===== | ||
| + | Make sure you have the // | ||
| + | '' | ||
| + | < | ||
| + | deb http:// | ||
| + | deb-src http:// | ||
| - | ===== Installing dependencies ===== | + | deb http:// |
| + | deb-src http:// | ||
| + | </ | ||
| - | Make sure you have the // | + | Install NAV's runtime dependencies: |
| - | '' | + | |
| < | < | ||
| - | sudo aptitude install perl python sun-java5-jdk apache2-mpm-prefork \ | + | sudo aptitude install perl python sun-java6-jdk apache2-mpm-prefork \ |
| - | cricket | + | cricket postgresql-8.3 libapache2-mod-python \ |
| - | libapache2-mod-php4 | + | libpg-java libsnmp1.4-java python-pysnmp2 |
| - | libpg-perl libnetaddr-ip-perl libdbd-pg-perl \ | + | |
| - | | + | |
| - | | + | python-ldap python-psycopg2 |
| - | python-forgethtml | + | |
| - | python-ipy python-ldap python-psycopg | + | python-rrd rrdtool |
| - | | + | |
| </ | </ | ||
| - | **OR**, check out Morten Werner Forsbring' | + | Be aware that NAV doesn' |
| + | |||
| + | < | ||
| + | sudo update-alternatives --config java | ||
| + | sudo update-alternatives --config javac | ||
| + | </ | ||
| Next, NAV's build time dependencies: | Next, NAV's build time dependencies: | ||
| < | < | ||
| - | sudo aptitude install | + | sudo aptitude install ant autoconf |
| </ | </ | ||
| ===== Unpacking and building NAV ===== | ===== Unpacking and building NAV ===== | ||
| < | < | ||
| - | tar xvzf nav-3.3.3.tar.gz | + | tar xvzf nav-3.7.0.tar.gz |
| - | cd nav-3.3.3 | + | 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 ===== | ||
| - | Edit ''/ | + | Edit ''/ |
| < | < | ||
| local | local | ||
| Line 60: | Line 68: | ||
| </ | </ | ||
| - | Then reload | + | Then reload |
| < | < | ||
| - | sudo invoke-rc.d postgresql-8.1 reload | + | sudo invoke-rc.d postgresql-8.3 reload |
| </ | </ | ||
| While still in the NAV source code directory, '' | While still in the NAV source code directory, '' | ||
| - | To create the set of PostgreSQL | + | To create the PostgreSQL |
| < | < | ||
| - | 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 | + | 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 | + | |
| - | </ | + | |
| - | + | ||
| - | Then initialize the schemas and data: | + | |
| - | < | + | |
| - | # First, export the password you selected for the database user above: | + | |
| - | export PGPASSWORD=< | + | |
| - | 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 | + | |
| </ | </ | ||
| :!: Then, take the password you chose for the database user and put this as the value to the '' | :!: Then, take the password you chose for the database user and put this as the value to the '' | ||
| - | ===== Fixing Python ===== | + | ===== Fixing Python |
| - | We do this because we don't install the libraries to the systemwide Python library directories. | + | We do this because we don't install the libraries to the systemwide Python library directories |
| < | < | ||
| - | sudo bash -c 'cat << EOF > /usr/ | + | sudo bash -c 'cat << EOF >> /etc/python2.5/ |
| import sys | import sys | ||
| __navpath = "/ | __navpath = "/ | ||
| Line 109: | Line 99: | ||
| - | ===== Fixing Java ===== | + | ===== Fixing Java libraries |
| < | < | ||
| - | cd / | ||
| - | sudo ln -s / | ||
| - | |||
| cd / | cd / | ||
| sudo ln -s / | sudo ln -s / | ||
| sudo ln -s / | sudo ln -s / | ||
| - | </ | ||
| - | |||
| - | Change ''/ | ||
| - | |||
| - | Change ''/ | ||
| - | < | ||
| - | CATALINA_OPTS=" | ||
| - | TOMCAT5_SECURITY=no | ||
| - | </ | ||
| - | |||
| - | Then run the following: | ||
| - | < | ||
| - | sudo invoke-rc.d tomcat5.5 restart | ||
| - | </ | ||
| - | |||
| - | ===== Fixing Perl ===== | ||
| - | < | ||
| - | cd / | ||
| - | sudo ln -s / | ||
| </ | </ | ||
| Line 165: | 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 175: | 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 ===== | ===== Cleaning up and configuring ===== | ||
| Line 196: | Line 159: | ||
| Edit ''/ | Edit ''/ | ||
| + | Also set '' | ||
| Optionally make the nav process control command more available: '' | Optionally make the nav process control command more available: '' | ||
| - | + | ===== Initialize | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | ===== Fixing | + | |
| 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 / | + | Remove |
| - | < | + | |
| Create a directory to place the nav cricket-config: | Create a directory to place the nav cricket-config: | ||
| < | < | ||
| - | Change owner to navcron.nav | + | Change owner to navcron:nav |
| < | < | ||
| - | sudo chown navcron.nav cricket-config/ | + | sudo chown navcron:nav / |
| </ | </ | ||
| Line 233: | Line 192: | ||
| As navcron, copy recursively / | As navcron, copy recursively / | ||
| < | < | ||
| - | sudo -u navcron cp -r / | + | sudo -u navcron cp -r / |
| </ | </ | ||
| - | Decide where you want Cricket | + | Create a directory |
| - | < | + | < |
| + | sudo mkdir / | ||
| + | sudo chown navcron | ||
| + | </ | ||
| Go to the cricket-config directory and edit the " | Go to the cricket-config directory and edit the " | ||
| Line 248: | Line 210: | ||
| < | < | ||
| - | 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 | + | Run '' |
| < | < | ||
| cd / | cd / | ||
| - | sudo -u navcron ./makecricketconfig.pl | + | sudo -u navcron ./mcc.py |
| - | </ | + | |
| - | + | ||
| - | Finally we fix nav's startupscript for cricket. Go to / | + | |
| - | < | + | |
| - | CRICKETDIR = / | + | |
| - | + | ||
| - | */5 * * * * $CRICKETDIR/ | + | |
| - | 12 5 * * * $BINDIR/ | + | |
| - | 0 5 * * * $BINDIR/ | + | |
| </ | </ | ||
| Line 268: | Line 221: | ||
| sudo ./nav start cricket | sudo ./nav start cricket | ||
| </ | </ | ||
| - | |||
| - | |||
| ==== Cricket Web ==== | ==== Cricket Web ==== | ||
| Line 281: | Line 232: | ||
| Make a symlink to the cricket cgi-scripts and copy cricket.css from source. | Make a symlink to the cricket cgi-scripts and copy cricket.css from source. | ||
| < | < | ||
| + | cd / | ||
| sudo ln -s / | sudo ln -s / | ||
| sudo ln -s / | sudo ln -s / | ||
| Line 288: | Line 240: | ||
| </ | </ | ||
| - | Create .htaccess-file to remove python handling | + | Create .htaccess-file to make sure mod_python doesn' |
| < | < | ||
| - | vim .htaccess | + | sudo bash -c 'echo " |
| + | </ | ||
| - | SetHandler none | ||
| - | |||
| - | :wq | ||
| - | </ | ||
installing_from_source_on_debian.1208416473.txt.gz · Last modified: by bredal
