선 밖에 선 자유인

JFFNMS 설치 in Linux 본문

IT/Security

JFFNMS 설치 in Linux

Hotman 2012. 1. 27. 15:07

** 출처 : http://sourceforge.net/apps/mediawiki/jffnms/index.php?title=Linux_Installation

 

Linux Installation

The following installation procedures may seem a little fiddly, but they will give each process the minimal access it needs to do its job. If you can use the pre-made packages for your particular distribution, that would be a lot easier.

This document assumes that you are installing the JFFNMS files into /opt/jffnms. Untaring the tar.gz file in /opt will give you a subdirectory jffnms-version, e.g. jffnms-0.8.5. Creating a symbolic link to jffnms will mean its easier to move versions

# cd /opt ; ln -s jffnms-0.8.5 jffnms

 

Fixing Permissions

The best way to set the permissions is to make a new JFFNMS user and group and then add the other common users to the group when you need to share directories or files.

Generally, anything run by cron (which is called an engine) is run as the JFFNMS user while the Apache webserver runs as a different user, usually www-data. You could just make everything globally read and write-able but it is better to lock things down a little.

First, create the new JFFNMS user:

 # groupadd jffnms

 # useradd -g jffnms -d /opt/jffnms -s /bin/false -c 'JFFNMS User' jffnms

 # usermod -G jffnms www-data

Log files, RRD files and TFTP files are written by engines, but the webserver needs to read them.

# chown jffnms www-data /opt/jffnms/logs /opt/jffnms/rrd /opt/jffnms/tftp

# chmod 2755 /opt/jffnms/logs /opt/jffnms/rrd /opt/jffnms/tftp

Configuration files need to be temporarily writeable by the webserver and readable by engines.

# chown www-data jffnms /opt/jffnms/conf

# chmod 2755 /opt/jffnms/conf

The image temporary directory needs to be writable by the webserver.

# chown www-data www-data /opt/jffnms/images/temp

# chmod 0755 /opt/jffnms/images/temp

Temporary engine directory, despite its name, needs to be writable by both the engines and webserver

# chown jffnms www-data /opt/jffnms/engine/temp

# chmod 0775 /opt/jffnms/engine/temp

 

Crontab

Install the JFFNMS crontab file

# crontab -u jffnms /opt/jffnms/docs/unix/crontab

Now modify the values at the top if they don't match your system:

# crontab -e -u jffnms

Allow JFFNMS to run cron jobs (AFAIK only needed in Solaris)

# echo jffnms >> /etc/cron.allow

Database Creation

Manually create the database "jffnms", set the permissions and then import the schema and data.

Replace the 'x' with the jffnms version number.

MySQL

# mysql -u <mysql admin username> -p<password>

mysql> CREATE DATABASE jffnms;

mysql> GRANT ALL PRIVILEGES ON jffnms.* TO jffnms@localhost IDENTIFIED BY 'jffnms';

mysql> FLUSH PRIVILEGES;

mysql> quit

  

# mysql -u jffnms -pjffnms jffnms < docs/jffnms-0.8.x.mysql

  

PostgreSQL

# psql template1 postgres

template1=# create user jffnms password 'jffnms' createdb;

template1=# \connect template1 jffnms

template1=# create database jffnms;

template1=# \q

# psql jffnms jffnms < docs/jffnms-0.8.x.pgsql

  

This will create the jffnms Tables and required records.

Apache Configuration

Apache can either be setup with a specific virtual host or off an existing host. The preferred method is to use a virtual host as it keeps all of the JFFNMS pages in one place and separate from everything else.

Virtual Host

<VirtualHost *>

 ServerName nms.example.com

 ServerAdmin webmaster@example.com

 DocumentRoot /opt/jffnms/htdocs

 LimitRequestLine 20000

 <Directory /opt/jffnms/htdocs >

  Options Indexes FollowSymLinks Multiviews

 </Directory>

</VirtualHost>

Use Alias directives within the virtual host if you want to move some of the sub-directories around. For example, if you want your temporary images to be put in a directory /var/lib/jffnms/tempimages, put the following line in the Apache configuration:

 Alias /jffnms/images/temp/ /var/lib/jffnms/tempimages/

PHP Module Load Errors are reported to /var/log/httpd/error_log (RedHat) or /var/log/apache/error_log (Gentoo)

Intial Setup

Point your browser to http://www.yourserver.com/jffnms or http://nms.yournet.com/ (depending on what you choose)

You should see the Setup screen, it should have auto-discovered your configuration. Verify that everything is correct (OK, YES in green) before saving the config.

Point your browser (again) to http://www.yourserver.com/jffnms or http://nms.yournet.com/ (depending on what you choose)

   Username: admin

   Password: admin

And now, you are inside the system.

 

Comments