eboxServer

Differences between revisions 11 and 12
Revision 11 as of 2008-08-06 16:16:54
Size: 20487
Editor: localhost
Comment: converted to 1.6 markup
Revision 12 as of 2008-08-06 17:01:22
Size: 20485
Editor: localhost
Comment:
No differences found!

This is going to be a guide to install ebox in a virtual machine under dapper (using vm-ware). All ebox files will be backuped up through bacula Correct html version is here: SERVER_EBOX.html Unfortunately I wrote this howto with tomboy and exported to html. Now it's not easy to convert it to wiki format

DAPPER + EBOX + BACULA INSTALL

  • Install dapper LTS with RAID software
  • Install vmware server (http://www.howtoforge.com/ubuntu_vmware_server)

    apt-get install libx11-6 libx11-dev libxtst6 xlibs-dev xinetd wget linux-headers-uname -r build-essential gcc binutils-doc cpp-doc make manpages-dev autoconf automake1.9 libtool flex bison gdb gcc-doc gcc-4.0-doc libc6-dev-amd64 lib64gcc1

    mkdir /var/vm

    cd /tmp

    wget -c http://download3.vmware.com/software/vmserver/VMware-server-1.0.4-56528.tar.gz

    tar xvfz VMware-server-*.tar.gz && cd vmware-server-distrib && ./vmware-install.pl

    ALWAYS hit RETURN except for question: "Do you want program to probe for an unused private subnet? (yes/no/help) : yes "

    "Do you wish to configure another NAT network? (yes/no) [no] : no "

    "ALWAYS hit return except for question: " [/var/lib/vmware/Virtual Machines] : /var/vm

    "Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel: : your VMware Server serial number "

  • Install MUI

    cd /tmp

    wget -c http://download3.vmware.com/software/vmserver/VMware-mui-1.0.4-56528.tar.gz

    tar xvfz VMware-mui-*.tar.gz && cd vmware-mui-distrib

    ./vmware-install.pl

  • Copy your virtual machine "ebox" in /var/vm folder on server
  • Set auto VM's poweron and auto poweroff together with the server
  • Check /etc/hosts and /etc/network/interfaces (For EBOX MACHINE configure network through ebox web interface)

See NETWORK SAMPLE FOR SERVER and NETWORK SAMPLE FOR EBOX

  • Install bacula on the server ([http://www.debianhelp.co.uk/bacula3.htm]).

  • Add universe and multiverse to apt sources

    apt-get install apache2 apache2-common apache2-mpm-prefork apache2-utils libapache2-mod-php5 libapr0 libdbd-mysql-perl libexpat1 libmysqlclient15off libxml2 mysql-client mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 php5 php5-common libapache2-mod-auth-mysql bacula-common bacula-console bacula-director-common bacula-fd bacula-sd libpq3 mtx mt-st bacula-director-mysql

  • INSTALL POSTFIX (default configuration for "internet website") in order to enable bacula's notify msg
  • Create volums for bacula

    mkdir /dumps

    touch /dumps/FileStorage

    chown bacula:bacula /dumps/FileStorage

    # bconsole

    label

    FileStorage

See SAMPLE FILE bacula-sd.conf SAMPLE FILE bacula-fd.conf SAMPLE FILE bacula-dir.conf SAMPLE FILE bconsole.conf

Instructions to run a backup

  • bconsole

    run

    1

    yes

Instructions to run a restore

  • bconsole

    restore all

    5

    done

    yes

Instructions to stop volums (first stop bacula-director service)

  • rm /dumps/FileStorage && touch /dumps/FileStorage && chown bacula:bacula /dumps/FileStorage

    #bconsole

    label

    FileStorage

Instructions to reset mysql db (first stop bacula-director service)

  • rm /var/lib/bacula/*

    #mysql -p

    use bacula

    DROP TABLE BaseFiles, CDImages, Client, Counters, File, Filename, FileSet, Job, JobMedia, Media, Path, Pool, UnsavedFiles, Version;

    /usr/share/bacula-director/make_mysql_tables (add -p if we have set a mysql root passwd)

    In order to delete restored files on client.

    rm /tmp/bacula-restores (to be performed on EBOX server!!)

INSTALL BACULA GUI

HOWTO CREATE EBOX + VmwareTools

  • In VMWARE select "BUS-LOGIC" instead of "LSI" when creating the Virtual Machine (or IDE instead of SCSI)

    add this repo to /etc/apt/sources.list

    deb http://ftp.it.debian.org/debian/ sarge main contrib non-free

    deb http://security.debian.org/ sarge/updates main contrib non-free

    Install gcc and build-essential

    sudo apt-get install gcc build-essential

Instructions to reset SQLite db

  • rm /var/lib/bacula/bacula.db

    /usr/share/bacula-director/make_sqlite_tables

    chown bacula:bacula /var/lib/bacula/bacula.db

BWEB SAMPLE

  • $VAR1 = bless( {

    'graph_font' => '/root/DejaVuSerif.ttf',

    'name' => undef,

    'config_file' => '/etc/bacula/bweb.conf',

    'bconsole' => '/usr/bin/bconsole -n -c /etc/bacula/bconsole.conf',

    'password' => ,

    'fv_write_path' => '/var/spool/bweb',

    'template_dir' => '/usr/share/bweb/tpl',

    'dbi' => 'DBI:mysql:database=bacula',

    'email_media' => 'email@domain.com',

    'user' => 'bacula',

    'error' => ,

    'debug' => 0,

    'stat_job_table' => 'Job' }, 'Bweb::Config' );

NETWORK SAMPLE FOR SERVER

  • root@SERVER_EBOX:~# more /etc/hosts 127.0.0.1 localhost 127.0.1.1 SERVER_EBOX 192.168.2.80 SERVER_EBOX 192.168.2.85 ebox # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts


  • root@SERVER_EBOX:~# more /etc/network/interfaces # THIS SAMPLE file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 192.168.2.80 netmask 255.255.255.0 network 192.168.2.0 broadcast 192.168.2.255 gateway 192.168.2.140

NETWORK SAMPLE FOR EBOX

  • SERVER_EBOX-ebox:~# more /etc/hosts 127.0.0.1 localhost.localdomain localhost ebox 192.168.2.85 ebox 192.168.2.80 SERVER_EBOX # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts

  • SERVER_EBOX-ebox:~# more /etc/network/interfaces auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 192.168.2.85 netmask 255.255.255.0 network 192.168.2.0 broadcast 192.168.2.255 gateway 192.168.2.140

SAMPLE FILE bacula-sd.conf

# # Default Bacula Storage Daemon Configuration file # # For Bacula release 1.36.3 (22 April 2005) -- debian testing/unstable # # You may need to change the name of your tape drive # on the "Archive Device" directive in the Device # resource. If you change the Name and/or the # "Media Type" in the Device resource, please ensure # that dird.conf has corresponding changes. #

Storage { # definition of myself

  • Name = bluemind-sd SDPort = 9103 # Director's port

    WorkingDirectory = "/var/lib/bacula" Pid Directory = "/var/run/bacula" Maximum Concurrent Jobs = 20

}

# # List Directors who are permitted to contact Storage daemon # Director {

  • Name = bluemind-dir Password = "bluemind"

}

# # Restricted Director, used by tray-monitor to get the # status of the storage daemon # Director {

  • Name = bluemind-mon Password = "" Monitor = yes

}

# # Devices supported by THIS SAMPLE Storage daemon # To connect, the Director's bacula-dir.conf must have the # same Name and MediaType. #

Device {

}

# # A Linux or Solaris tape drive # #Device { # Name = DDS-4 # # Media Type = DDS-4 # Archive Device =/dev/nrst0 # AutomaticMount = yes; # when device opened, read it # AlwaysOpen = yes; # RemovableMedia = yes; # RandomAccess = no;

#}

# # A FreeBSD tape drive # #Device { # Name = DDS-4 # Description = "DDS-4 for FreeBSD" # Media Type = DDS-4 # Archive Device =/dev/nsa1 # AutomaticMount = yes; # when device opened, read it # AlwaysOpen = yes # Offline On Unmount = no # Hardware End of Medium = no # BSF at EOM = yes # Backward Space Record = no # Fast Forward Space File = no # TWO EOF = yes #}

# # A OnStream tape drive. # You need the kernel osst driver 0.9.14 or later, and # do "mt -f/dev/nosst0 defblksize 32768" once as root. # #Device { # Name = OnStream # Description = "OnStream drive on Linux" # Media Type = OnStream # Archive Device =/dev/nrst0 # AutomaticMount = yes; # when device opened, read it # AlwaysOpen = yes # Offline On Unmount = no

# Minimum Block Size = 32768 # Maximum Block Size = 32768 #}

# # A very old Exabyte with no end of media detection # #Device { # Name = "Exabyte 8mm" # Media Type = "8mm" # Archive Device =/dev/nrst0 # Hardware end of medium = No; # AutomaticMount = yes; # when device opened, read it # AlwaysOpen = Yes; # RemovableMedia = yes; # RandomAccess = no; #}

# # Send all messages to the Director, # mount messages also are sent to the email address # Messages {

  • Name = Standard director = bluemind-dir = all

}

ESEMPIO FILE bacula-fd.conf

# # Default Bacula File Daemon Configuration file # # For Bacula release 1.36.3 (22 April 2005) -- debian testing/unstable # # There is not much to change here except perhaps the # File daemon Name to #

# # List Directors who are permitted to contact THIS SAMPLE File daemon # Director {

  • Name = bluemind-dir Password = "bluemind"

}

# # Restricted Director, used by tray-monitor to get the # status of the file daemon # Director {

  • Name = bluemind-mon Password = "bluemind" Monitor = yes

}

# # "Global" File daemon configuration specifications # FileDaemon { # THIS SAMPLE is me

}

# Send all messages except skipped files back to Director Messages {

  • Name = Standard director = bluemind-dir = all, !skipped

}

SAMPLE FILE bacula-dir.conf

# # Default Bacula Director Configuration file # # The only thing that MUST be changed is to add one or more # file or directory names in the Include directive of the # FileSet resource. # # For Bacula release 1.36.3 (22 April 2005) -- debian testing/unstable # # You might also want to change the default email address # from root to your address. See the "mail" and "operator" # directives in the Messages resource. #

Director { # define myself

  • Name = bluemind-dir DIRport = 9101 # where we listen for UA connections

    QueryFile = "/etc/bacula/scripts/query.sql" WorkingDirectory = "/var/lib/bacula" PidDirectory = "/var/run/bacula" Maximum Concurrent Jobs = 1 Password = "bluemind" # Console password Messages = Daemon

}

JobDefs {

  • Name = "DefaultJob" Type = Backup Level = Incremental Client = bluemind-ebox-fd FileSet = "Full Set" Schedule = "WeeklyCycle" Storage = File Messages = Standard Pool = Default Priority = 10

}

# # Define the main nightly save backup job # By default, THIS SAMPLE job will back up to disk in /tmp Job {

  • Name = "bluemind-ebox-fd"

    JobDefs = "DefaultJob" Write Bootstrap = "/var/lib/bacula/Client1.bsr"

}

# Backup the catalog database (after the nightly save) Job {

}

# Standard Restore template, to be changed by Console program Job {

  • Name = "RestoreFiles" Type = Restore Client = bluemind-ebox-fd FileSet = "Full Set" Storage = File Pool = Default Messages = Standard Where = /

}

# List of files to be backed up FileSet {

  • Name = "Full Set" Include {
    • Options {
      • signature = MD5
      }

# # Put your list of files here, preceded by 'File =', one per line # or include an external list with: # # File = <file-name # # Note: / backs up everything on the root partition. # if you have other partitons such as /usr or /home # you will probably want to add them too. # # By default THIS SAMPLE is defined to point to the Bacula build # directory to give a reasonable FileSet to backup to # disk storage during initial testing. #

  • File = /home
  • }

# # If you backup the root directory, the following two excluded # files can be useful #

  • Exclude {
    • File = /proc File = /tmp File = /.journal File = /.fsck
    }

}

# # When to do the backups, full backup on first sunday of the month, # differential (i.e. incremental since full) every other sunday, # and incremental backups other days Schedule {

  • #Name = "WeeklyCycle" #Run = Full 1st sun at 1:05 #Run = Differential 2nd-5th sun at 1:05 #Run = Incremental mon-sat at 1:05 Name = "WeeklyCycle" Run = Full mon-sat at 11:08 Run = Differential 2nd-5th sun at 1:05 Run = Incremental mon-sat at 1:05

}

# THIS SAMPLE schedule does the catalog. It starts after the WeeklyCycle Schedule {

}

# THIS SAMPLE is the backup of the catalog FileSet {

}

# Client (File Services) to backup Client {

  • Name = bluemind-ebox-fd Address = bluemind-ebox FDPort = 9102

    Catalog = MyCatalog Password = "bluemind" # password for FileDaemon File Retention = 30 days # 30 days Job Retention = 6 months # six months AutoPrune = yes # Prune expired Jobs/Files

}

# Definiton of file storage device Storage {

  • Name = File

# Do not use "localhost" here

  • Address = bluemind # N.B. Use a fully qualified name here SDPort = 9103 Password = "bluemind"

    Device = FileStorage Media Type = File

}

# Definition of DDS tape storage device #Storage { # Name = DDS-4 # Do not use "localhost" here # Address = bluemind # N.B. Use a fully qualified name here # SDPort = 9103 # Password = "" # password for Storage daemon # Device = DDS-4 # must be same as Device in Storage daemon # Media Type = DDS-4 # must be same as MediaType in Storage daemon #}

# Definition of 8mm tape storage device #Storage { # Name = "8mmDrive" # Do not use "localhost" here # Address = bluemind # N.B. Use a fully qualified name here # SDPort = 9103 # Password = "" # Device = "Exabyte 8mm" # MediaType = "8mm" #}

# Generic catalog service Catalog {

  • Name = MyCatalog dbname = bacula; password = "@db_pswd@"

}

# Reasonable message delivery -- send most everything to email address # and to the console Messages {

  • Name = Standard

# # NOTE! If you send to two email or more email addresses, you will need # to replace the %r in the from field (-f part) with a single valid # email address in both the mailcommand and the operatorcommand. #

  • mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: %t %e of %c %l\" %r" operatorcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula: Intervention needed for %j\" %r"

    mail = email@domain.com = all, !skipped operator = email@domain.com = mount console = all, !skipped, !saved

# # WARNING! the following will create a file that you must cycle from # time to time as it will grow indefinitely. However, it will # also keep all your messages if they scroll off the console. #

  • append = "/var/lib/bacula/log" = all, !skipped

}

# # Message delivery for daemon messages (no job). Messages {

  • Name = Daemon mailcommand = "/usr/lib/bacula/bsmtp -h localhost -f \"\(Bacula\) %r\" -s \"Bacula daemon message\" %r" mail = root@localhost = all, !skipped console = all, !skipped, !saved append = "/var/lib/bacula/log" = all, !skipped

}

# Default pool definition Pool {

  • Name = Default Pool Type = Backup Recycle = yes # Bacula can automatically recycle Volumes

    AutoPrune = yes # Prune expired volumes Volume Retention = 365 days # one year Accept Any Volume = yes # write on any volume in the pool

}

# # Restricted console used by tray-monitor to get the status of the director # Console {

  • Name = bluemind-mon Password = "bluemind" CommandACL = status, .status

}

SAMPLE FILE bconsole.conf

# # Bacula User Agent (or Console) Configuration File #

Director {

  • Name = bluemind-dir DIRport = 9101 address = bluemind Password = "bluemind"

}

SAMPLE FILE CLIENT bacula-fd.conf

# # Restricted Director, used by tray-monitor to get the # status of the file daemon # Director {

  • Name = bluemind-dir Password = "6lu3m1nd" Monitor = yes

}

# # "Global" File daemon configuration specifications # FileDaemon { # THIS SAMPLE is me

}

# Send all messages except skipped files back to Director Messages {

  • Name = Standard director = ebox-dir = all, !skipped

}

eboxServer (last edited 2008-08-06 17:01:22 by localhost)