Home Network Setup, Part 6

Heya,

Well I had this sitting in my drafts for quite some time and thought I’d be best to publish this immediately purely to get it out the door as quickly as possible.

Setting up JFFNMS

Firstly I add the Dag Wieers archives to the servers yum configuration.

/etc/yum.repos.d/dag.repo:

[dag]
name=Dag RPM Repository for Red Hat Enterprise Linux
baseurl=http://apt.sw.be/redhat/el4/en/$basearch/dag
gpgcheck=1
enabled=1

I then import the GPG key:

[root@dione yum.repos.d]# rpm –import http://dag.wieers.com/packages/RPM-GPG-KEY.dag.txt
Now that we have Dag Wieers archive setup it’s time to install a bunch of prerequisites:

[root@dione ~]# yum install mysql-server php net-snmp php-snmp php-gd php-mysql graphviz fping nmap rrdtool php-rrdtool
Setting up Install Process
Setting up repositories
dag 100% |=========================| 1.1 kB 00:00
update 100% |=========================| 951 B 00:00
base 100% |=========================| 1.1 kB 00:00
addons 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Package php-gd.i386 0:4.3.9-3.9 set to be updated
—> Package php-snmp.i386 0:4.3.9-3.9 set to be updated
—> Downloading header for graphviz to pack into transaction set.
graphviz-2.2-1.2.el4.rf.i 100% |=========================| 14 kB 00:00
—> Package graphviz.i386 0:2.2-1.2.el4.rf set to be updated
—> Package php-mysql.i386 0:4.3.9-3.9 set to be updated
—> Package net-snmp.i386 0:5.1.2-11.EL4.6 set to be updated
—> Package php.i386 0:4.3.9-3.9 set to be updated
—> Package mysql-server.i386 0:4.1.12-3.RHEL4.1 set to be updated
—> Downloading header for fping to pack into transaction set.
fping-2.4-1.b2.2.el4.rf.i 100% |=========================| 3.6 kB 00:00
—> Package fping.i386 0:2.4-1.b2.2.el4.rf set to be updated
–> Running transaction check
–> Processing Dependency: php-pear for package: php
–> Restarting Dependency Resolution with new changes.
–> Populating transaction set with selected packages. Please wait.
—> Package php-pear.i386 0:4.3.9-3.9 set to be updated
–> Running transaction check

Dependencies Resolved

==========================================================
Package Arch Version Repository Size
==========================================================
Installing:
fping i386 2.4-1.b2.2.el4.rf dag 32 k
graphviz i386 2.2-1.2.el4.rf dag 910 k
mysql-server i386 4.1.12-3.RHEL4.1 base 6.7 M
net-snmp i386 5.1.2-11.EL4.6 base 491 k
php i386 4.3.9-3.9 update 1.3 M
php-gd i386 4.3.9-3.9 update 96 k
php-mysql i386 4.3.9-3.9 update 34 k
php-snmp i386 4.3.9-3.9 update 26 k
Installing for dependencies:
php-pear i386 4.3.9-3.9 update 265 k

Transaction Summary
==========================================================
Install 9 Package(s)
Update 0 Package(s)
Remove 0 Package(s)
Total download size: 9.8 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): graphviz-2.2-1.2.e 100% |=========================| 910 kB 00:07
(2/2): fping-2.4-1.b2.2.e 100% |=========================| 32 kB 00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: fping ######################### [1/9]
Installing: mysql-server ######################### [2/9]
Installing: net-snmp ######################### [3/9]
Installing: graphviz ######################### [4/9]
Installing: php ######################### [5/9]
Installing: php-gd ######################### [6/9]
Installing: php-snmp ######################### [7/9]
Installing: php-mysql ######################### [8/9]
Installing: php-pear ######################### [9/9]

Installed: fping.i386 0:2.4-1.b2.2.el4.rf graphviz.i386 0:2.2-1.2.el4.rf mysql-server.i386 0:4.1.12-3.RHEL4.1 net-snmp.i386 0:5.1.2-11.EL4.6 php.i386 0:4.3.9-3.9 php-gd.i386 0:4.3.9-3.9 php-mysql.i386 0:4.3.9-3.9 php-snmp.i386 0:4.3.9-3.9
Dependency Installed: php-pear.i386 0:4.3.9-3.9
Complete!
[root@dione ~]

Next we fix a few permissions for JFFNMS:

[root@dione ~]# chmod +s /usr/bin/nmap
[root@dione ~]# chmod a+x /usr/bin/nmap
[root@dione ~]# chmod a+x /usr/sbin/fping
[root@dione ~]# chmod +s /usr/sbin/fping

Next I had to make the following modifications to /etc/php.ini:

register_globals = On
error_reporting = E_ALL & ~E_NOTICE
include_path = “.:/usr/share/pear”

Next we setup some groups and users for JFFNMS:

[root@dione ~]# groupadd jffnms
[root@dione ~]# useradd -g jffnms -d /opt/jffnms -s /bin/false -c ‘JFFNMS User’ jffnms
[root@dione ~]# usermod -G jffnms apache

Next we download and extract our JFFNMS installation:

[root@dione ~]# wget http://optusnet.dl.sourceforge.net/sourceforge/jffnms/jffnms-0.8.2.tar.gz
–03:36:36– http://optusnet.dl.sourceforge.net/sourceforge/jffnms/jffnms-0.8.2.tar.gz
=> `jffnms-0.8.2.tar.gz’
Resolving optusnet.dl.sourceforge.net… 211.29.132.142
Connecting to optusnet.dl.sourceforge.net|211.29.132.142|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 557,085 (544K) [application/x-gzip]

100%[==========================================================================>] 557,085 145.60K/s ETA 00:00

03:36:37 (145.87 KB/s) – `jffnms-0.8.2.tar.gz’ saved [557085/557085]

[root@dione ~]# tar -zxf jffnms-0.8.2.tar.gz
[root@dione ~]# mv jffnms-0.8.2/* /opt/jffnms/

Next we fix ownerships:

[root@dione ~]# chown -R jffnms:jffnms /opt/jffnms
[root@dione ~]# chmod 770 /opt/jffnms
[root@dione ~]# chmod -R ug+rw /opt/jffnms

Next we load the crontab jobs:

[root@dione jffnms]# crontab -u jffnms /opt/jffnms/docs/unix/crontab

Now it’s time to initialise our MySQL database. I need to change the root password first and setup the MySQL user and database:

[root@dione jffnms]# service mysqld start
Starting MySQL: [ OK ]
[root@dione jffnms]# chkconfig –level 345 mysqld on
[root@dione jffnms]# mysqladmin -u root -p password ‘123456’
Enter password:
[root@dione jffnms]#

[root@dione jffnms]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.12

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> CREATE DATABASE jffnms;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON jffnms.* TO jffnms@localhost IDENTIFIED BY ‘123456’;
Query OK, 0 rows affected (0.01 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
[root@dione jffnms]#

Now we import our database:

[root@dione jffnms]# mysql -u jffnms -p jffnms < /opt/jffnms/docs/jffnms-0.8.2.mysql Enter password: [root@dione jffnms]#

Next we create a virtualhost for Apache:

/etc/httpd/conf.d/vhost-jffnms.conf
ServerAdmin stuart@seekbrain.com
DocumentRoot /opt/jffnms/htdocs
ServerName nms.seekbrain.com
LimitRequestLine 20000

And restart Apache:

[root@dione conf.d]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@dione conf.d]#

Now it’s possible to goto nms.seekbrain.com and finish configuration.

I’ll get through to the final Part of this Home Network setup cleaning everything up as much as possible.

Stuart