wiki:HaCiInstall

Version 1 (modified by larsux, 7 years ago) (diff)

--

Install

Overview

HaCi is a web frontend for administrating Networks. It consist of a (perl) CGI and a (mySQL) Database as backend.

Requirements

All you need is a Webserver (e.g.: Apache), a Database (e.g.: mySQL) and an OS which supports perl.

  • Perl (check with "$ perl -M<MODULE> -e 1 2>/dev/null && echo 'Ok' || echo 'Failed'")
    • CGI
    • CGI::Session
    • CGI::Cookie
    • CGI::Ajax
    • Math::BigInt v1.87
    • Math::BigInt::GMP (optional, but proposed for more performance!)
    • Template
    • Class::MakeMethods
    • Net::IPv6Addr
    • Cache::Cache
    • Digest::SHA
    • Locale::gettext
    • Time::Local
    • Net::SNMP
    • Net::DNS
    • Log::LogLite
    • Net::Ping::External
    • Socket6
    • IO::Socket::INET6
    • DNS::ZoneParse
    • DBD::mysql
    • Config::General
    • Net::CIDR
    • Text::CSV_XS (optional for importing CSV-Files)
  • HTTP Server
  • SQL Database

You can use the Script 'bin/checkPerlDependencies.sh' to check for Dependencies.

Installation

1)

First, extract the Archiv into a Directory, from which the HTTP Server will process it and check Dependencies.

2)

If needed, accommodate the File/Directory? Permissions, so the HTTP Server will have no problems.

<installDir>/logs : HTTPServer (rwx)
<installDir>/spool : HTTPServer (rwx)

3)

Modify the HaCi.conf.sample (<installDir>/etc) for your needs. It can be stored either in '/etc/HaCi.conf' or '<installDir>/etc/HaCi.conf'. '/etc/HaCi.conf' has precedence.

4)

Configure your Database and Webserver, for serving your new Tool. e.g.:

  • mySQL
    USE mysql;
    
    REPLACE INTO user (host, user, password)
      VALUES (
        'localhost',
        'HaCi',
    -- IMPORTANT: Change this password!
        PASSWORD('geheim!')
    );
    
    REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv, delete_priv, create_priv, drop_priv, index_priv, Alter_priv, Create_tmp_table_priv, Lock_tables_priv)
      VALUES (
        'localhost',
        'HaCi%',
        'HaCi',
        'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'
    );
    FLUSH PRIVILEGES;
    CREATE DATABASE HaCi;
    
  • Apache (httpd.conf)
    <VirtualHost *:80>
      ServerName  haci.domain.tld
      DocumentRoot  /var/www/HaCi/html
      ScriptAlias   /cgi-bin/  /var/www/HaCi/cgi-bin/
    
      <Directory /var/www/HaCi/cgi-bin>
        # If you want to use Mod-Perl ---
        PerlRequire   /var/www/HaCi/etc/startup.pl
        SetHandler    perl-script
        # PerlHandler   Apache::Registry       # mod-perl1
        PerlResponseHandler ModPerl::Registry  # mod-perl2
        #--------------------------------
        Options       +ExecCGI
      </Directory>
    </VirtualHost>
    
  • lighttpd
    • standalone (/etc/lighttpd/lighttpd.conf):
      server.document-root  = "/var/www/HaCi/html"
      server.errorlog    = "/var/www/HaCi/logs/error.log"
      alias.url    += ("/cgi-bin/" => "/var/www/HaCi/cgi-bin/")
      
    • VHost (/etc/lighttpd/conf-available/20-HaCi.conf):
      server.modules                 += ( "mod_simple_vhost" )
      simple-vhost.server-root        = "/var/www"
      simple-vhost.document-root      = "/html/"
      simple-vhost.default-host       = "HaCi"
      alias.url                      += ( "/cgi-bin/" => "/var/www/HaCi/cgi-bin/" )
      
  • activate CGI
    • Debian:
      $ ln -s /etc/lighttpd/conf-available/10-cgi.conf /etc/lighttpd/conf-enabled/
      
      Edit '/etc/lighttpd/conf-available/10-cgi.conf' and comment the alias-Line out:
      # alias.url       += ( "/cgi-bin/" => "/usr/lib/cgi-bin/" )
      
  • SuSE:
    Edit '/etc/lighttpd/modules.conf' and enable following line:
    include "conf.d/cgi.conf"
    

5)

HaCi Daemon (bin/HaCid.pl)
The HaCi Daemon is responsible for the recurrent Plugins. It runs them in defined intervals.
You can start it with the Parameter '-c' therewith it exists after one full run and you can start it by Crontab.
The Daemon stores its PID in 'spool' and writes its Logfile in 'logs'. So it must have write Permissions to this directories.

6)

For exporting the last CVS Version call

$ cvs -z3 -d:pserver:anonymous@haci.cvs.sourceforge.net:/cvsroot/haci export -D NOW HaCi

7)

FINISHED