Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- install nocproject from source on Centos 6.0
- Проверяем версию python:
- # python -V
- Python 2.6.5
- Устанавливаем postgresql
- # yum install postgresql-server postgresql-libs postgresql-devel postgresql-contrib postgresql-plpython
- Указанный в документации вариант установки setuptools отказался работать.
- Скачиваем последнюю версию:
- # wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
- # tar -xvzf setuptools-0.6c11.tar.gz
- # cd setuptools-0.6c11
- # python setup.py install
- Я устанавливал Centos c LiveCD, поэтому доустанавливаем нужные пакеты:
- # yum install python-devel
- # yum install gmp gmp-devel gmp-static
- # yum install libsmi libsmi-devel
- # yum install mercurial
- # yum install hg
- Добавляем репозиторий MongoDB:
- # vim /etc/yum.repos.d/10gen.repo
- [10gen]
- name=10gen Repository
- baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
- gpgcheck=0
- #
- # yum install mongo-10gen mongo-10gen-server
- # yum install libtool httpd-devel apr-devel apr
- # easy_install psycopg2
- #easy_install gmpy
- #easy_install pycrypto
- Fping в родных репозитариях я не нашел, а так как подключать другие мне было лень - поставил так:
- #wget http://pkgs.repoforge.org/fping/fping-2.4-1.b2.3.el5.rf.i386.rpm
- #rpm --install fping-2.4-1.b2.3.el5.rf.i386.rpm
- #easy_install netifaces
- #/sbin/service postgresql initdb
- #/sbin/service postgresql start
- Настраиваем mongod:
- #/sbin/service mongod start
- # mongo
- use noc
- db.addUser('noc', '12345');
- db.auth('noc','12345');
- quit
- #/sbin/service mongod restart
- Postgres:
- #su - postgres
- $ createuser noc
- $ Shall the new role be a superuser? (y/n) n
- $ Shall the new role be allowed to create databases? (y/n) n
- $ Shall the new role be allowed to create more new roles? (y/n) n
- $ exit
- NOC Project:
- #hg clone http://hg.nocproject.org/noc noc
- #groupadd noc
- #useradd -g noc -s /bin/sh -d /home/noc noc
- #python setup.py install
- #cd /opt/noc/
- #./scripts/post-install
- # su - noc
- $ python setup.py install
- $ cd /opt/noc/
- $ ./scripts/post-install
- $ exit
- В документации написано, что права root:root необходимы только для каталогов /opt/noc/local и /opt/noc/static/doc
- Так вот - ключи не генерились до тех пор, пока я не выставил права на /opt/noc/etc/ssh
- Устанавливаем FastCGI:
- # wget wget http://www.fastcgi.com/dist/mod_fastcgi-current.tar.gz
- # tar -xvzf mod_fastcgi-current.tar.gz
- # cd mod_fastcgi-2.4.6/
- # cp -p Makefile.AP2 Makefile
- # make top_dir=/usr/lib/httpd
- # make install top_dir=/usr/lib/httpd
- Добавляем модуль в httpd.conf:
- LoadModule fastcgi_module /usr/lib/httpd/modules/mod_fastcgi.so
- Правим httpd.conf:
- FastCGIExternalServer /opt/noc/noc.fcgi -socket /tmp/noc.fcgi
- <VirtualHost *:80>
- DocumentRoot /opt/noc
- ServerName kovreng.relinfo.ru
- Alias /media /opt/noc/contrib/lib/django/contrib/admin/media/
- RewriteEngine On
- RewriteRule ^/(media.*)$ /$1 [QSA,L,PT]
- RewriteRule ^/(static.*)$ /$1 [QSA,L,PT]
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteRule ^/(.*)$ /noc.fcgi/$1 [QSA,L]
- <Directory /opt/noc>
- Order allow,deny
- Allow from all
- </Directory>
- <Location /media>
- Order allow,deny
- Allow from all
- </Location>
- </VirtualHost>
- # /sbin/service httpd restart
- Смотрим, где у нас находятся файлы:
- rsync, gpg, tar, smilint, mongodump, dig, pg_dump, smidump, ssh, gzip, hg - и правим соответствующие пути в файле
- /opt/noc/etc/noc.conf (Секции [cm] vcs_path и [path])
- Проверяем права на каталог репозитория:
- # ll /var/repo
- total 4
- drwxrwxrwx. 3 noc noc 4096 Aug 12 11:21 config
- Настраиваем активатор (файл /opt/noc/etc/noc-activator.conf)
- [activator]
- name = noc
- listen_instance = 0
- listen_traps =
- listen_syslog =
- listen_pm_data = 127.0.0.1
- secret = noc
- software_update = true
- max_scripts = 10
- pm_data_secret = noc
- Стартуем ;)
- # cd /opt/noc
- # ./scripts/noc-launcher.py start
- Логинимся в систему: http://host
- Учетная запись по умолчанию noc/noc
- Заходим в меню:
- Service Activation › Activators ›
- И создаем активатор, аналогично тому, который прописан в /opt/noc/etc/noc-activator.conf
- Все ;)
Advertisement
Add Comment
Please, Sign In to add comment