📄 getting-started.txt
字号:
$Id: getting-started.txt 3042 2004-11-05 12:51:23Z mortenv $Getting started with NAV 3.0============================(This guide assumes NAV is installed in /usr/local/nav)NAV 3.0 assumes a simpler directory structure than previous NAVversions. Below /usr/local/nav/ you will find the followingdirectories:apache/ -- Web related content/programs.bin/ -- Executable programs.doc/ -- Documentation.etc/ -- Configuration files.var/ -- Local data created by NAV programs, such as logs and other data files.In addition to this document, we advise you to take a look at theproject reports of NAVMore and tigaNAV, which explains much of thefunctionality implemented in NAV 3.0.Creating users and groups=========================Unless you have installed NAV through some automated system whichcreates necessary users and groups (such as RPM), you need to createthe the group "nav" and user "navcron". The navcron user should havenav as its default group, its home directory set to /usr/local/nav,and should be allowed to execute cron jobs. Other than that, the userneeds no special privileges. It is used to run unprivileged NAVprocesses, and will normally not even login password (i.e. needs nopassword set).Initializing the NAV databases==============================When you have installed NAV 3.0 for the first time, you need toinitialize the NAV database. The directory /usr/local/nav/doc/sql/contains the SQL scripts necessary to initialize the PostgreSQLdatabases used by NAV, and a README file explaining how.Please note that beforehand, you should configure your PostgreSQL toaccept tcp/ip connections ($PGDATA/postgresql.conf), set a passwordfor the postgres superuser and configure your pg_hba.conf to onlyaccept md5 authentication (not trust, and not ident). Please refer tothe PostgreSQL documentation for this.After initializing, you should again connect to PostgreSQL as thepostgres superuser, and choose passwords for the two nav users youcreated (navread and navwrite), using "ALTER USER ... WITH PASSWORD'...'". Then you need to configure NAV to use these passwords whenconnecting to PostgreSQL. This is done in the config file/usr/local/nav/etc/db.conf, by changing the directives"userpw_navread" and "userpw_navwrite".Configuring Apache==================Example Apache configuration has been provided elsewhere. Pleasedon't forget that if you run Apache 1.3, your /etc/init.d/httpd shouldset (and export) the environment variable PYTHONHOME to contain thepath to your non-threaded edition of Python.Some tips if you wish to configure Apache from scratch:- You need both mod_php4 and mod_python, and we strongly recommend mod_ssl.- Your document root should be /usr/local/nav/apache/webroot/.- .htaccess files below that directory should be allowed to override everything from the Apache configuration.- We strongly recommend that you force all users to access the NAV web interface through https instead of plain http, otherwise everything is sent to and from the web server unencrypted (including passwords). You can accomplish this by using a RewriteRule to have your web server redirect all http requests to https urls.Configuring Tomcat==================NAV comes with two Java servlets, Network Explorer and vlanPlot (theinteractive traffic map). The Tomcat servlet engine is therecommended container for these servlets. A Python module willforward Apache requests to these to servlets directly to a Tomcatserver running on the local host.You need to install and configure Tomcat on your NAV host, and makesure the two servlets (.war files) are in its webapps directory.The Python forwarding module will expect to find the Tomcat serverlistening on port 8080 (which is the Tomcat configuration default).Also, these servlets may use large amounts of memory while processingsome requests (especially if your port count is high, such as it is atNTNU); therefore it is recommended to increase the amount of memoryavailable to the Java Virtual Machine running the Tomcat server. TheSun JVM usually reserves a maxium of 64MB for a Java program, but thiscan be changed using the -Xmx<size> option of java. This can bepassed through to the JVM when starting Tomcat, e.g.: JAVA_OPTS="-Xmx128M" ./startup.shThis should start Tomcat with a maximum heap memory size of 128MB.Integrating Cricket with NAV============================This section assumes your cricket installation has been placed in/usr/local/nav/cricket/, with the cricket executables in/usr/local/nav/cricket/cricket/ (approximately as we all know from"Installing Cricket for the Complete Beginner" athttp://cricket.sourceforge.net/support/doc/beginner.html, only thatthe prefix is different).More detailed instructions for integrating Cricket with NAV can befound in /usr/local/nav/doc/cricket/README (with example files in thesame directory)To integrate your Cricket installation's public_html directory withthe NAV web interface, to the following as root:cd /usr/local/nav/apache/webrootln -s /usr/local/nav/cricket/public_html cricketecho "SetHandler none" > cricket/.htaccessNAV's toolbox comes ready with the "Statistics" tool, which sends youto the /cricket/ url.Configuring your environment============================Most NAV 3.0 programs rely on finding NAV libraries effortlessly.This means that certain environment variables should be set before NAVprograms are invoked (this also means they need to be set beforeApache starts). More specifically, the variables CLASSPATH, PERL5LIBand PYTHONPATH need to be set. Also, your java executable should befound on your PATH, or at least in $JAVA_HOME/bin .A shell script has been provided to set these environment variablescorrectly, nav_environ.sh. This script needs to be sourced into yourenvironment, preferrably at an early stage of your boot process,and/or at every user login.At NTNU, the script is sourced into the enviroment in two places. Thescript has been placed in /etc/profile.d/. Every script here issourced into the enviroment when a user logs in to a RedHat 9 system(though it seems root bypasses this). The same script is also sourceddirectly into the /etc/init.d/httpd script, by adding "source/etc/profile.d/nav_environ.sh" very near the beginning of the script.Configuring NAV===============All configuration files are located below /usr/local/nav/etc/.Default configuration files are placed here on your first install.Most of these are self-documenting, so mostly you just need to readthrough the files to configure NAV to your needs.Starting daemons and cron jobs==============================Starting and stopping NAV daemons and cron jobs is pretty much thesame as in NAV v2. Running "/usr/local/nav/bin/nav start" shouldpretty much start everything.Logging in to the web interface===============================When you first direct your browser to the NAV page served by yourApache, you are unauthenticated and will have the access privileges ofan anonymous user.You may log in to the web interface as the user "admin", using "admin"as your password. It is of course extremely recommended that youimmediately change this password to something harder to guess.The user "admin" is a member of the group "NAV Administrators", andwill therefore have access to absolutely everything in the webinterface.Managing accounts, groups and privileges in the web interface=============================================================All this is accomplished through the Useradmin panel, which should belinked from the navigation bar of the admin user. The Useradmin panelis still somewhat lacking in good looks and usability, but it works.Seeding your database=====================Seeding the database is no longer a process of maintaining text filescontaing information on your network equipment. All seeding of thedatabase is now done through the web interface, using the editdb tool,which operates directly on the contents of the NAVdb. Open the webinterface toolbox and select editdb.Fortunately for you, editdb has the ability to bulk import data fromtext files that are mostly the same format as the old seed text filesof NAV v2.Tips for bulk importing:- Due to dependencies within the database, it is recommended that you bulk import the seed files in the following order: Locations, Rooms, Vendors, Types, Organizations, User categories, Boxes, Services. The format of each bulk import type is documented in the bulk import forms of editdb.- When bulk importing boxes, it is a good idea to split the seed files into smaller pieces. Bulk importing triggers a burst of SNMP queries, and if you are importing a large amount of boxes, your web browser may time out waiting for the web server's reply.- Some vendors and types are already defined in the initial database. Before importing these, you can check which ones exist by looking at /editdb/vendor/list and /editdb/type/list- If you are trying to import a nested organizational structure, it may be neccesary to import the organization file several times.- Note that NAVv3 supports only these categories: GSW,GW,SW,EDGE,WLAN,SRV,OTHER. Equipment of all categories, except SRV and OTHER, is required to respond to SNMP queries, or it will not be allowed into the database.- Subcategories can be defined for all main categories.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -