|
|
(37 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
|
| |
|
| | | ==Introduction== |
| | This page with all descriptions are tested with Debian and Ubuntu Linux. The below package selection has been recently tested with Debian Stretch. |
|
| |
|
| ==Install== | | ==Install== |
| {| style="width: 60%;" | | {| style="width: 60%;" |
| |style="width:20%; vertical-align: top;"| | | |style="width:20%; vertical-align: top;"| |
| Sample for Debian 8: | | Sample for Debian 8.1 (Jessie) netinst amd64:<br> |
| *Default installation | | The installation goes quick and easy, it can be <br> |
| **Choose package '''Web server''' | | done in less then 10 minutes for experienced users |
| **Choose package '''SSh server''' | | *Choose Install |
| | **Software packages: |
| | ***Choose package '''SSH server''' |
| | ***Choose package '''Standard utilities''' |
|
| |
|
| |style="width:33%; vertical-align: top;"| | | |style="width:33%; vertical-align: top;"| |
Line 15: |
Line 19: |
|
| |
|
| =Packages= | | =Packages= |
| | |
| | On Debian always consider to update your repository first before you begin |
| | root@mylvs01:/# '''apt-get update''' |
| | |
| ==MySQL== | | ==MySQL== |
| apt-get install mysql-server-5.5 | | Note: On Debian Jessie the package is called mysql-server-5.5 while on Debian Stretch the package mysql-server is used. |
| | root@mylvs01:/# '''apt-get install mysql-server''' |
| | |
| ==Perl Core== | | ==Perl Core== |
| core modules | | core modules |
| apt-get install libnet-snmp-perl libxml-simple-perl libmail-sendmail-perl | | root@mylvs01:/# '''apt-get install libnet-snmp-perl libxml-simple-perl libmail-sendmail-perl libnet-whois-raw-perl libsoap-lite-perl ''' |
|
| |
|
| libnet-whois-raw-perl
| |
|
| |
|
| for monitoring purposes: | | for monitoring purposes: |
| apt-get install nagios-plugins-standard | | root@mylvs01:/# '''apt-get install nagios-plugins-standard nagios-nrpe-plugin''' |
|
| |
|
| other | | other required packages |
| apt-get install libdatetime-perl
| | root@mylvs01:/# '''apt-get install ipvsadm libdatetime-perl libnet-snmp-perl libxml-simple-perl libnet-ip-perl sudo nmap''' |
|
| |
|
| ==Apache Perl CGI== | | ==Apache Perl CGI== |
| apt-get install libapache2-mod-fcgid libcgi-fast-perl | | root@mylvs01:/# '''apt-get install apache2 libapache2-mod-fcgid libcgi-fast-perl''' |
| apt-get install libcgi-pm-perl libcgi-session-perl | | root@mylvs01:/# '''apt-get install libcgi-pm-perl libcgi-session-perl''' |
| apt-get install libfcgi-perl libfcgi0ldbl | | root@mylvs01:/# '''apt-get install libfcgi-perl libfcgi0ldbl''' |
|
| |
|
|
| |
|
| ===Enable CGI=== | | ===Enable CGI=== |
| a2enmod cgi | | root@mylvs01:/# '''a2enmod cgi''' |
| | | root@mylvs01:/# '''service apache2 restart''' |
| ===Apache additional===
| |
| apt-get install libnet-snmp-perl libxml-simple-perl | |
| | |
| | |
|
| |
|
| =SUDO= | | =SUDO= |
| Sudo is required to run commands from apache
| | Edit sudo: |
| apt-get install sudo | | root@mylvs01:/# '''visudo -f /etc/sudoers''' |
| *visudo -f /etc/sudoers
| | Add to sudo: |
| www-data ALL=NOPASSWD: /sbin/ipvsadm | | www-data ALL=NOPASSWD: /sbin/ipvsadm |
| www-data ALL=NOPASSWD: /usr/bin/nmap | | www-data ALL=NOPASSWD: /usr/bin/nmap |
Line 60: |
Line 65: |
| www-data ALL=NOPASSWD: /var/www/mylvs/scripts/reboot.sh | | www-data ALL=NOPASSWD: /var/www/mylvs/scripts/reboot.sh |
|
| |
|
| | | =Where to go next= |
| Note: The above commands represents all possible myLVS functions even if the scripts are not setup at this time.
| | <br> |
| | | *Go here: [[Setup MyLVS]] |
| | |
| =Permissions=
| |
| => make me look nice
| |
| Make sure to have this:
| |
| | |
| root@mylvs01:/var/www/mylvs# ls -all
| |
| total 124
| |
| drwxr-xr-x 6 www-data root 4096 Aug 22 14:14 .
| |
| drwxr-xr-x 4 root root 4096 Jun 12 14:48 ..
| |
| drwxr-xr-x 2 www-data root 4096 Aug 22 15:27 backup
| |
| -rw-r--r-- 1 www-data root 229 Feb 9 2015 LEGAL
| |
| -rwxr-xr-x 1 root demo 3828 Aug 18 13:25 mylvsinit.pl
| |
| -rwxr-xr-x 1 root demo 92370 Aug 18 13:30 mylvsmon.pl
| |
| drwxr-xr-x 2 www-data root 4096 Aug 22 14:59 scripts
| |
| drwxr-xr-x 4 www-data root 4096 Feb 9 2015 ws
| |
| drwxr-xr-x 4 www-data root 4096 Aug 22 14:10 wwwroot
| |
| root@mylvs01:/var/www/mylvs#
| |
| | |
| Please run the following to set permissions for www-data:
| |
| root@mylvs01:# chown www-data /var/www/mylvs -R
| |
| | |
| | |
| | |
| ==Main configuration==
| |
| | |
| *SQL related settings
| |
| {| class="wikitable"
| |
| |-
| |
| ! Element !! Attribute !! Description
| |
| |-
| |
| | SQLServer || Address || SQL Server address
| |
| |-
| |
| | SQLServer || Database || Database name
| |
| |-
| |
| | SQLServer || User || Username
| |
| |-
| |
| | SQLServer || Password || Plain password
| |
| |-
| |
| | |
| | |
| | SQLServerBackup || Address || '''SQL Backup''' Server address,<br>only used within an HA environment.
| |
| |-
| |
| | SQLServerBackup || Database || '''(HA) Backup''' Database name
| |
| |-
| |
| | SQLServerBackup || User || '''(HA) Backup''' Username
| |
| |-
| |
| | SQLServerBackup || Password || '''(HA) Backup''' Plain password
| |
| |-
| |
| | SQLServerBackup || ReplCommand || Command to be used when changes occur
| |
| |-
| |
| | |
| | |
| | SQLConfigBackup || Path|| Path to the helper scripts
| |
| |-
| |
| | SQLConfigBackup || ResoreApp || Name of the script to restore the sql data
| |
| |-
| |
| | SQLConfigBackup || BackupApp || Name of the script to backup the sql data
| |
| |-
| |
| | |
| |}
| |
| | |
| *LVS
| |
| {| class="wikitable"
| |
| |-
| |
| ! Element !! Attribute !! Description
| |
| |-
| |
| | LVS || Command || Command path and name of ipvsadm
| |
| |-
| |
| | Operator || Mailserver || Command path and name of ipvsadm
| |
| |-
| |
| | Operator || Mailfrom || Command path and name of ipvsadm
| |
| |-
| |
| | Operator || MailTo || Command path and name of ipvsadm
| |
| |-
| |
| | Operator || MailCC || Command path and name of ipvsadm
| |
| |-
| |
| | Operator || MailBCC || Command path and name of ipvsadm
| |
| |-
| |
| | Maintenance || FileAge || Command path and name of ipvsadm
| |
| |-
| |
| | Maintenance || SQLAge || Command path and name of ipvsadm
| |
| |-
| |
| |}
| |
| | |
| | |
| | |
| | |
| *HTTP Related Settings | |
| {| class="wikitable"
| |
| |-
| |
| ! Element !! Attribute !! Description
| |
| |-
| |
| | ShowAmount || ActiveWarning || Command path and name of ipvsadm
| |
| |-
| |
| | ShowAmount || InActiveWarning || Command path and name of ipvsadm
| |
| |-
| |
| | ShowAmount || HTTP_ERR || Command path and name of ipvsadm
| |
| |-
| |
| | ShowAmount || HTTP_WARN || Command path and name of ipvsadm
| |
| |-
| |
| | ShowAmount || MaxConCount || Command path and name of ipvsadm
| |
| |-
| |
| | Operation || WebSimulate || Command path and name of ipvsadm
| |
| |-
| |
| | Operation || MonSimulate || Command path and name of ipvsadm
| |
| |-
| |
| | |
| | Information || host || Command path and name of ipvsadm
| |
| |-
| |
| | Information || nmap || Command path and name of ipvsadm
| |
| |-
| |
| | Modules || Path || Command path and name of ipvsadm
| |
| |-
| |
| | StatusView || SupressedAddress || Command path and name of ipvsadm
| |
| |-
| |
| | View || HTMLLVSOutput || Command path and name of ipvsadm
| |
| |-
| |
| | Log || Name || Command path and name of ipvsadm
| |
| |-
| |
| | Log || Path || Command path and name of ipvsadm
| |
| |-
| |
| | Log || gzip || Command path and name of ipvsadm
| |
| |-
| |
| | Log || Days || Command path and name of ipvsadm
| |
| |-
| |
| | Logo || Path || Command path and name of ipvsadm
| |
| |-
| |
| |}
| |
| | |
| | |
| | |
| | |
| root@mylvs01:/# '''cat /etc/mylvs/mylvs.conf.xml'''
| |
| <?xml version="1.0"?>
| |
| <CONFIG>
| |
| <!-- LVS1 SQL Config!-->
| |
| <SQLServer Address="127.0.0.1" Database="mylvs" User="mylvsuser" Password="demo" />
| |
| <!-- LVS2 SQL Config!-->
| |
| <SQLServerBackup Enabled="0" Address="" Database="" User="" Password="" ReplCommand="no-sample-available-yet" />
| |
| <!-- SQL Configuration Backup !-->
| |
| <SQLConfigBackup Path="/var/www/mylvs/backup/" RestoreApp="/var/www/mylvs/scripts/mkrestore.sh" BackupApp="/var/www/mylvs/scripts/mkbackup.sh"/>
| |
| <!-- LVS General command string - add sudo to support appache!-->
| |
| <LVS Command="/usr/bin/sudo /sbin/ipvsadm" />
| |
| <!-- General mailing information if not given somewhere else used by the lvs monitor!-->
| |
| <Operator Mailserver="mail.mylvs.com" Mailfrom="lvsmon@mylvs.com" MailTo="postmaster@mylvs.com" MailCC="anybody@domain.com" MailBCC=""/>
| |
| <!-- Daily operations!-->
| |
| <Maintenance FileAge="5" SQLAge="5"/>
| |
| <!-- Color set which is used within the webinterface!-->
| |
| <ShowAmount ActiveWarning="200" InActiveWarning="2000" HTTP_ERR="120" HTTP_WARN="80" MaxConCount="1000"/>
| |
| <!-- Operation mode for testing!-->
| |
| <Operation WebSimulate="0" MonSimulate="0"/>
| |
| <!-- Used within the connection view, support whois and nmap which is needed to be installed!-->
| |
| <Information host="/usr/bin/sudo /usr/bin/host" nmap="/usr/bin/sudo /usr/bin/nmap -sS -O -v" />
| |
| <!-- Web styles/moudules!-->
| |
| <Modules Path="/usr/local/lvs/wwwroot/modules/"/>
| |
| <!-- Exlude addresses from the connection view!-->
| |
| <StatusView SupressedAddress=""/>
| |
| <!-- View Options!-->
| |
| <View HTMLLVSOutput="0"/>
| |
| <!-- Log Options!-->
| |
| <Log Name="mylvslog.log" Path="/var/log/mylvs/" gzip="/bin/gzip" Days="24"/>
| |
| <!-- Customize Logo!-->
| |
| <Logo Path="/images/Linux_Logo.gif" />
| |
| </CONFIG>
| |
Introduction
This page with all descriptions are tested with Debian and Ubuntu Linux. The below package selection has been recently tested with Debian Stretch.
Install
Sample for Debian 8.1 (Jessie) netinst amd64:
The installation goes quick and easy, it can be
done in less then 10 minutes for experienced users
- Choose Install
- Software packages:
- Choose package SSH server
- Choose package Standard utilities
|
|
Packages
On Debian always consider to update your repository first before you begin
root@mylvs01:/# apt-get update
MySQL
Note: On Debian Jessie the package is called mysql-server-5.5 while on Debian Stretch the package mysql-server is used.
root@mylvs01:/# apt-get install mysql-server
Perl Core
core modules
root@mylvs01:/# apt-get install libnet-snmp-perl libxml-simple-perl libmail-sendmail-perl libnet-whois-raw-perl libsoap-lite-perl
for monitoring purposes:
root@mylvs01:/# apt-get install nagios-plugins-standard nagios-nrpe-plugin
other required packages
root@mylvs01:/# apt-get install ipvsadm libdatetime-perl libnet-snmp-perl libxml-simple-perl libnet-ip-perl sudo nmap
Apache Perl CGI
root@mylvs01:/# apt-get install apache2 libapache2-mod-fcgid libcgi-fast-perl
root@mylvs01:/# apt-get install libcgi-pm-perl libcgi-session-perl
root@mylvs01:/# apt-get install libfcgi-perl libfcgi0ldbl
Enable CGI
root@mylvs01:/# a2enmod cgi
root@mylvs01:/# service apache2 restart
SUDO
Edit sudo:
root@mylvs01:/# visudo -f /etc/sudoers
Add to sudo:
www-data ALL=NOPASSWD: /sbin/ipvsadm
www-data ALL=NOPASSWD: /usr/bin/nmap
www-data ALL=NOPASSWD: /var/wwwl/mylvs/repl.sh
www-data ALL=NOPASSWD: /usr/local/nagios/libexec/check_nrpe
www-data ALL=NOPASSWD: /var/www/mylvs/scripts/mkbackup.sh
www-data ALL=NOPASSWD: /var/www/mylvs/scripts/mkbackupcomment.sh
www-data ALL=NOPASSWD: /usr/bin/mysqldump
www-data ALL=NOPASSWD: /usr/bin/mysql
www-data ALL=NOPASSWD: /bin/echo
www-data ALL=NOPASSWD: /var/www/mylvs/scripts/mkbackup.sh
www-data ALL=NOPASSWD: /var/www/mylvs/scripts/mkrestore.sh
www-data ALL=NOPASSWD: /var/www/mylvs/scripts/reboot.sh
Where to go next