(Click to open topic with navigation)
These instructions describe how to install and start Moab Accounting Manager (MAM).
Supported databases:
Software requirements:
Optional software:
Use the following commands to install the required Moab Accounting Manager dependencies and packages (listed in the Requirements section above).
RedHat 5 based system:
[root]# yum install gcc mysql mysql-server mysql-devel perl-DBD-MySQL libxml2-devel openssl-devel perl-suidperl readline-devel ncurses-devel httpd mod_ssl perl-TermReadKey perl-CGI-Session perl-Config-Tiny perl-Crypt-CBC perl-Crypt-DES perl-Crypt-DES_EDE3 perl-DateManip perl-DBI perl-Digest-HMAC perl-Digest-SHA1 perl-Error perl-Log-Dispatch-FileRotate perl-Log-Log4perl perl-Term-ReadLine-Gnu perl-XML-LibXML perl-Time-HiRes perl-CGI
RedHat 6 based system:
[root]# yum install gcc mysql mysql-server mysql-devel perl-DBD-MySQL libxml2-devel openssl-devel perl-suidperl readline-devel ncurses-devel httpd mod_ssl perl-CGI perl-CGI perl-CGI-Session perl-Config-Tiny perl-Crypt-CBC perl-Crypt-DES perl-Crypt-DES_EDE3 perl-Date-Manip perl-Time-HiRes perl-DBI perl-Digest-HMAC perl-Digest-SHA1 perl-Error perl-Log-Dispatch-FileRotate perl-Log-Log4perl perl-Term-ReadLine-Gnu perl-TermReadKey perl-XML-LibXML
On a RHEL 6 system, you may experience failed dependencies on perl(Config::Tiny) and perl(RRDs). You can install these by running the following:
[root]# rpm -Uvh ftp://ftp.pbone.net/mirror/ftp.centos.org/6/os/x86_64/Packages/rrdtool-perl-1.3.8-6.el6.x86_64.rpm --nodeps
Once those packages finish installing, rerun the yum install command.
SuSE-based system:
[root]# zypper install gcc mysql libmysqlclient-dev mysql-devel perl-DBD-MySQL libxml2-devel openssl-devel readline-devel ncurses-devel apache2 perl-CGI-Session perl-Crypt-CBC perl-Crypt-DES perl-Date-Manip perl-DBI perl-Digest-HMAC perl-Digest-SHA1 perl-Error perl-Log-Log4perl perl-Term-ReadLine-Gnu perl-XML-LibXML lsb-release perl-Params-Validate perl-TermReadKey perl-DBD-mysql perl-Log-Dispatch
[root]# cpan -i Config::Tiny Crypt::DES_EDE3 Log::Dispatch::FileRotate
[root]# chmod 4755 /usr/bin/sperl*
If any of the Perl module packages fail to install or are unavailable for your system, you can install it from CPAN by running cpan MODULENAME where MODULENAME is the respective perl module name.
RedHat-based system:
In RedHat-based systems, Security-Enhanced Linux (SELinux) blocks the use of Setuid Perl (used in client authentication). If you are using Setuid Perl as the security promotion method (this is the default if available), you will need to disable SELinux before you can install Moab Accounting Manager. Do the following:
[root]# nano /etc/sysconfig/selinux
SELINUX=disabled
[root]# setenforce 0
Moab Accounting Manager uses a configurable server port (default 7112) for client-server communication. If you have a firewall enabled, you must either disable the firewall (iptables, ip6tables) or configure the firewall to allow the server port. Do the following:
[root]# service iptables stop
[root]# chkconfig iptables off
If you are using the IPv6 firewall, replace each iptables with ip6tables in the example above.
To install Moab Accounting Manager
[root]# useradd -m moab
[root]# su - moab
[moab]$ tar -zxvf mam-7.2.3.tar.gz
[moab]$ cd mam-7.2.3
[moab]$ ./configure --with-db-type=mysql
[moab]$ make
[moab]$ exit
[root]# cd /home/moab/mam-7.2.3
[root]# make install
[root]# nano /etc/my.cnf
## Place this in the [mysqld] section:
default-storage-engine = INNODB
RedHat-based system:
[root]# chkconfig mysqld on
[root]# service mysqld restart
SuSE-based system:
[root]# chkconfig mysql on
[root]# service mysql restart
Create a database called mam and grant database privileges to the moab user.
[root]# mysql
mysql> create database mam;
mysql> grant all on *.* to 'moab'@'localhost' identified by 'changeme';
mysql> exit
The password you define must be synchronized with the database.password value in /opt/mam/etc/goldd.conf.
[moab]$ nano /opt/mam/etc/goldd.conf
database.password = changeme
[root]# mysql mam -u moab -p < hpc.sql
[root]# cp etc/profile.d/*.sh /etc/profile.d
[root]# . /etc/profile.d/mam.sh
RedHat-based system:
[root]# cp etc/init.d/mam.redhat /etc/init.d/mam
[root]# chkconfig --add mam
[root]# service mam start
SuSE-based system:
[root]# cp etc/init.d/mam.suse /etc/init.d/mam
[root]# chkconfig --add mam
[root]# service mam start
[root]# nano /opt/moab/etc/moab-private.cfg
CLIENTCFG[AM:mam] KEY=<MAMSecretKey> AUTHTYPE=HMAC64
[root]# service moab restart
SuSE-based system:
[root]# nano /etc/sysconfig/apache2
APACHE_SERVER_FLAGS="-DSSL"
### Reword per the per-OS variances below
RedHat-based system:
[root]# nano /etc/httpd/conf.d/ssl.conf
<Directory "/var/www/cgi-bin">
## Add these lines
Options ExecCGI
AddHandler cgi-script .cgi
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Aliases for /cgi-bin
Alias /cgi-bin/ /var/www/cgi-bin/
Alias /mam/ /var/www/cgi-bin/mam/
# Make shorter sub-dir name available
DirectoryIndex index.cgi
SuSE-based system:
[root]# cp /etc/apache2/vhosts.d/vhost-ssl.template
/etc/apache2/vhosts.d/mam-ssl.conf
[root]# nano /etc/apache2/vhosts.d/mam-ssl.conf
<Directory "/srv/www/cgi-bin">
## Add these lines
Options ExecCGI
AddHandler cgi-script .cgi
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Aliases for /cgi-bin
Alias /cgi-bin/ /srv/www/cgi-bin/
Alias /mam/ /srv/www/cgi-bin/mam/
# Make shorter sub-dir name available
DirectoryIndex index.cgi
Alternatively, if your network domain can be secured from man-in-the-middle attacks, you culd use a self-signed certificate. Often this does not require any additional steps since in many distributions, such as RedHat, the Appache SSL configuration provides self-signed certificates by default.
The following steps assume you are using self-signed certificates:
Create self-signed SSL certificate and key files. Some distributions such as RedHat ship with ready-made certificates.
For SuSE-based systems:
[root]# cd /etc/apache2
[root]# openssl genrsa -out ssl.key/server.key 1024
[root]# openssl req -new -key ssl.key/server.key -x509 -out ssl.crt/server.crt
RedHat-based system:
[root]# service httpd restart
SuSE-based system:
[root]# service apache2 restart
[root]# su - moab
[moab]$ gchpasswd
You can now access the GUI at https://<hostname>/cgi-bin/mam by logging in as moab and using the password you set.
You can define users, accounts, charge rates, etc., as needed for your site (for more information, see the "Getting Started" section of the Moab Accounting Manager Administrator Guide). An initialization script has been provided that can set up a sample initial environment (with some dummy users, accounts, charge rates, etc.) To initialize your database with this sample data, execute the script as the moab user:
[moab]$ mam-7.2.3/test/hpc-allocation-enforcement.sh
Related topics