This is a working document. Please comment if you find some errors.
Disclaimer, i am not a unix competent person so there is bound to be
mistakes.
Make sure that /etc/apt/sources list contain:
deb
http://ftp.xx.debian.org/debian/ sid main non-free contrib
deb-src
http://ftp.xx.debian.org/debian/ sid main non-free
contrib
The xx is simply the country code.
You should be running unstable(Sid) version, not the stable version
Run the apt-get circle
# apt-get update
# apt-get upgrade
Required packages ¶
Following packages are required to run NOC
* Python - 2.5 or later required
# apt-get install python2.5
IMPORTANT!!! Make sure you use python version 2.5 and not 2.4
# python --version
Python 2.5.4 <- Version may change in your version.
* PostgreSQL - 8.0 or later required
# apt-get install postgresql-8.3
* setuptools - Extension to python distutils (See wiki:Install/
setuptools)
# apt-get install python2.5-setuptools
* psycopg2 - PostgreSQL bindings for Python (See wiki:Install/
psycopg2)
# apt-get install python-psycopg2
* Django - version 1.0 or later required (See wiki:Install/Django)
# apt-get install python-django
Verify Django version:
# python
Python 2.5.4 (r254:67916, Feb 17 2009, 20:16:45)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import django
>>> django.VERSION
(1, 0, 2, 'final', 0)
>>>
Alternative installation of Django
# easy_install-2.5 django
* South - Django schema migration tool (See wiki:Install/South)
Install as in outlined in the wiki. I could not find South as a
debian package.
# apt-get install subversion-tools # I installed the whole
package
# svn co
https://svn.aeracode.org/svn/south/trunk south
# cd south
# python setup.py install
Verify that South is installed for Python2.5. You should find
South-0.x-pyx.x.egg is in /usr/lib/python2.5/site-packages
* protobuf - Google's data interchange format, used for internal
RPC
# apt-get install python2.5-protobuf
Optional packages ¶
* flup - Required to run NOC web daemon in FastCGI mode (See
wiki:Install/flup?)
# apt-get install python-flup
* Sphinx - Python documentation tool. Required to rebuild online
documentation
# apt-get install python-sphinx
* Mercurial - Distributed version control system. Required to
fetch updates from repository
# apt-get install mercurial # Perhaps trac-mercurial instead
* pysnmp4 - Python SNMP implementation. Required for trap
collector in noc-activator (disabled by default).
# apt-get install python-pysnmp4 # Perhaps python-pysnmp4-mibs
also
* pyasn1 - Python ASN.1 parser. Required for trap collector in noc-
activator (disabled by default).
# apt-get install python-pyasn1
* libsmi -- smidump required for MIB uploading
# apt-get install libsmi2-dev
# libsmi2-common should already be installed. I do not know if
this one is required.
* netifaces -- Python library to resolve interface names to IP
addresses.
Allows write interface names instead of IP addresses in configs
# apt-get install python2.5-netifaces
* Web Server - required for production use of NOC web interface
o lighttpd
o Apache
# apt-get install apache2
Create system user and group
I am confused by the doc. The NocInstall says the user should
be noc,
while the Updating NOC says nocadmin.
Serveral scenarios possible:
a. Single user/group noc. /var/www/noc owned by noc and all
daemons
are launched as noc
b. /var/www/noc owned by nocadmin, /var/www/noc/local owned
by noc,
all daemons launched as noc
second scenario is preferred but more complicated.
# groupadd noc
# useradd -g noc -d /var/www -s /bin/false noc
Creating database
The documentation says createuser test. I user simply noc
# su - postgres
$ createuser noc
Answer n on all questions
$ createdb -EUTF8 -Onoc noc
Exit to superuser
Verify that you can connect to the noc database as the noc user
and the password.
# su - noc
$ psql -h localhost -U noc -W
You may have to edit the /etc/postgresql/8.3/main/pg_hba.conf
This is an example, do not use in a production enviroment:
# Database administrative login by UNIX sockets
# TYPE DATABASE USER IP-ADDRESS IP-
MASK METHOD
local all
all trust
# TYPE DATABASE USER IP-ADDRESS IP-
MASK METHOD
host all all 127.0.0.1
255.255.255.255 trust
# TYPE DATABASE USER IP-ADDRESS IP-
MASK METHOD
host all all 0.0.0.0
0.0.0.0 trust
Also check:
# ls /var/run/postgresql/.s.PGSQL.*
/var/run/postgresql/.s.PGSQL.5433 /var/run/postgresql/.s.PGSQL.
5433.lock
You can also check with netstat what port the postgresql
listens on.
noc@dimurgos:~/noc$ netstat -an
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign
Address State
tcp 0 0
127.0.0.1:5433
0.0.0.0:* LISTEN
If you find that it uses port 5433, change the following line
in
/etc/postgresql/8.3/main/postgresql.conf and restart.
port = 5433 # (change
requires restart)
to:
port = 5432 # (change
requiresrestart)
Install NOC
# cd /var/www
# This is just an example. Relasenumber will change. Make sure
you dowload the
right one from
http://trac.nocproject.org/trac/wiki/NocDownload
# wget
http://trac.nocproject.org/trac/raw-attachment/wiki/NocDownload/noc-0.1.4.tgz
# gunzip noc-0.1.4.tgz
# tar -xvf noc-0.1.4.tar
Prepare etc/noc.conf
# cd /var/www/noc
# cp etc/noc.defaults etc/noc.conf
Change noc.conf to suit your installation. At least the line:
pg_dump = /usr/local/bin/pg_dump
should be changed to :
pg_dump = /usr/bin/pg_dump
Create local cache
# cd /var/www/noc
# mkdir local
Give noc user and noc group rights to the whole /var/www/noc
# chown -R noc:noc *
Initialize NOC database
All "python manage.py" commands must be executed as user "noc"
# su - noc
$ cd /var/www/noc
$ python manage.py syncdb
Syncing...
Creating table auth_permission
Creating table auth_group
Creating table auth_user
Creating table auth_message
Creating table django_content_type
Creating table django_session
Creating table django_site
Creating table django_admin_log
Creating table south_migrationhistory
You just installed Django's auth system, which means you don't
have any superusers defined.
Would you like to create one now? (yes/no): yes
Username (Leave blank to use 'noc'): noc
E-mail address:
n...@comace.net
Password:
Password (again):
Superuser created successfully.
Installing index for auth.Permission model
Installing index for auth.Message model
Installing index for admin.LogEntry model
Synced:
> django.contrib.auth
> django.contrib.contenttypes
> django.contrib.sessions
> django.contrib.sites
> django.contrib.admin
> south
Not synced (use migrations):
- noc.main
-
noc.sa
-
noc.fm
-
noc.cm
- noc.ip
-
noc.vc
- noc.dns
- noc.peer
Then you have to run
$ ./manage.py migrate
Testing NOC web interface
As root
# python manage.py runserver
0.0.0.0:81
Port 80 is in use by apache.
In a webbrowser you can test the application. Log in with username noc
and password noc