Mylvs installation: Difference between revisions

From MyLVS
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
test
BUG FOUND while adding a new server, after confirm, the server becomes disblaed, should be enabled !
 
 
*12Jun15
Install Debian8
 
Software selection:
  -Web server
  -SSh server
  -Standard system utilities
 
 
*Install
apt-get install mysql-server-5.5
 
*run mmysql and create the database "mylvs"
 
*Import myLVS Database (emtpty template)
mysql -u root -p < lvs.sql
 
Create /var/wwwmylvs - unzip jessie-mylvs-base.zip to /var/www/mylvs
chown www-data /var/www/mylvs -R
 
 
Recover mylvs-etc.zip
 
 
********************************************
13Jun15
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' IDENTIFIED BY 'demo' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON mylvs.* TO mylvsuser@localhost
    IDENTIFIED BY 'demo';
 
Apache config:
/etc/apache2/sites-enabled/mylvs.conf
 
<Directory "/var/www/.ssh/">
Options None
AllowOverride None
Order deny,allow
Allow from none
#Require valid user
</Directory>
<Directory "/var/www/mylvs/wwwroot/cgi-bin">
  AuthName "LVS Access"
  AuthType Basic
  AuthUserFile /var/www/mylvs/wwwroot/.htpasswd.users
  require valid-user
  AllowOverride AuthConfig
  Order deny,allow
  Allow from none
  Options +ExecCGI
  AddHandler cgi-script cgi pl
</Directory>
<VirtualHost *:80>
ServerAdmin mis@hitchhiker.com
DocumentRoot /var/www/mylvs/wwwroot
ServerName mylvs.foo
ErrorLog /var/log/apache2/mylvs.foo.error
CustomLog /var/log/apache2/mylvs.foo.access combined
ScriptAlias /cgi-bin/ /var/www/mylvs/wwwroot/cgi-bin/
Redirect /index.html http://mylvs.foo/cgi-bin/mylvs.pl
</VirtualHost>
 
**************************************************************
Install Apache CGI
apt-get install libapache2-mod-fcgid libcgi-fast-perl libcgi-pm-perl libcgi-session-perl libfcgi-perl libfcgi0ldbl
 
Enable CGI
a2enmod cgi
 
Get Perl modules
apt-get install libnet-snmp-perl libxml-simple-perl
 
 
Add myLVS User:
insert into tblUsers (userID,name,operations,showcon,searchcon,reset,reboot,search,whois,nslookup,scan,servermanager) values ('1','demo','1','1','1','1','1','1','1','1','1','1');
 
Add Apache PWD
root@mylvs01:/var/www/mylvs/wwwroot# htpasswd -c .htpasswd.users demo
 
User demo, password demo
root@mylvs01:/var/www/mylvs/wwwroot# less .htpasswd.users
demo:$apr1$MdLnKnYz$CZiDv6sKqSZrA25nFIm7u/
 
 
*************************************************************
SUDO
 
Install
apt-get install sudo
 
 
visudo -f /etc/sudoers
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/script/mkbackup.sh
www-data ALL=NOPASSWD: /var/www/mylvs/script/mkbackupcomment.sh
www-data ALL=NOPASSWD: /usr/bin/mysqldump
www-data ALL=NOPASSWD: /usr/bin/mysql
 
 
 
*****
 
apt-get install ipvsadm
 
 
 
 
 
 
Add Demo Node and test Clients (as seen in pictures)
Result:
 
root@mylvs01:/# ipvsadm -L -n
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
  -> RemoteAddress:Port          Forward Weight ActiveConn InActConn
TCP  192.168.2.220:80 rr
  -> 192.168.2.221:80            Route  100    0          0
  -> 192.168.2.222:80            Route  100    0          0
root@mylvs01:/#
 
 
Add Wiki Page: http://test.mylvs.com
 
GRANT ALL PRIVILEGES ON test_mylvs.* TO mywikitest@localhost
    IDENTIFIED BY 'blademo';
 
 
 
 
 
 
 
 
{| border="0" cellpadding="2" width="500" align="left"
{| border="0" cellpadding="2" width="500" align="left"
|- valign="top" align="left"
|- valign="top" align="left"
Line 13: Line 151:
! width="45%" | [[File:01-02-01-Copy-Web01.png|400px|thumb|left|Log view]]
! width="45%" | [[File:01-02-01-Copy-Web01.png|400px|thumb|left|Log view]]
|}
|}
<br>
[[File:00-00-00-Debian.png|400px|thumb|left|Log view]]
<br>
=Test=
01-01-01-Add-Web01.png
01-01-02-Confirm.png
01-01-03-ServerMain.png
01-02-01-Copy-Web01.png
01-02-02-Confirm.png
01-02-03-Summary.png
01-ServerSetup.png
02-01-01-Node-Empty.png
02-01-02-NewNode.png
02-01-03-Confirm.png
02-02-01-Add-new-server-to-node.png
02-02-02-Add-Web01-to-node.png
02-02-03-Add-Web03-to-node.png
02-02-04-node-Overview.png
02-02-05-apply-settings.png
02-ConfirmTestnode.png

Latest revision as of 21:59, 13 June 2015

BUG FOUND while adding a new server, after confirm, the server becomes disblaed, should be enabled !


  • 12Jun15
Install Debian8
Software selection:
 -Web server
 -SSh server
 -Standard system utilities


  • Install
apt-get install mysql-server-5.5
  • run mmysql and create the database "mylvs"
  • Import myLVS Database (emtpty template)
mysql -u root -p < lvs.sql

Create /var/wwwmylvs - unzip jessie-mylvs-base.zip to /var/www/mylvs chown www-data /var/www/mylvs -R


Recover mylvs-etc.zip


13Jun15 GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%' IDENTIFIED BY 'demo' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON mylvs.* TO mylvsuser@localhost

   IDENTIFIED BY 'demo';

Apache config: /etc/apache2/sites-enabled/mylvs.conf

<Directory "/var/www/.ssh/">

Options None
AllowOverride None
Order deny,allow
Allow from none
#Require valid user

</Directory> <Directory "/var/www/mylvs/wwwroot/cgi-bin">

 AuthName "LVS Access"
 AuthType Basic
 AuthUserFile /var/www/mylvs/wwwroot/.htpasswd.users
 require valid-user
 AllowOverride AuthConfig
 Order deny,allow
 Allow from none
 Options +ExecCGI
 AddHandler cgi-script cgi pl

</Directory> <VirtualHost *:80>

ServerAdmin mis@hitchhiker.com
DocumentRoot /var/www/mylvs/wwwroot
ServerName mylvs.foo
ErrorLog /var/log/apache2/mylvs.foo.error
CustomLog /var/log/apache2/mylvs.foo.access combined
ScriptAlias /cgi-bin/ /var/www/mylvs/wwwroot/cgi-bin/
Redirect /index.html http://mylvs.foo/cgi-bin/mylvs.pl

</VirtualHost>

Install Apache CGI

apt-get install libapache2-mod-fcgid libcgi-fast-perl libcgi-pm-perl libcgi-session-perl libfcgi-perl libfcgi0ldbl

Enable CGI

a2enmod cgi

Get Perl modules

apt-get install libnet-snmp-perl libxml-simple-perl


Add myLVS User:

insert into tblUsers (userID,name,operations,showcon,searchcon,reset,reboot,search,whois,nslookup,scan,servermanager) values ('1','demo','1','1','1','1','1','1','1','1','1','1');

Add Apache PWD

root@mylvs01:/var/www/mylvs/wwwroot# htpasswd -c .htpasswd.users demo

User demo, password demo root@mylvs01:/var/www/mylvs/wwwroot# less .htpasswd.users

demo:$apr1$MdLnKnYz$CZiDv6sKqSZrA25nFIm7u/


SUDO

Install apt-get install sudo


visudo -f /etc/sudoers 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/script/mkbackup.sh www-data ALL=NOPASSWD: /var/www/mylvs/script/mkbackupcomment.sh www-data ALL=NOPASSWD: /usr/bin/mysqldump www-data ALL=NOPASSWD: /usr/bin/mysql


apt-get install ipvsadm




Add Demo Node and test Clients (as seen in pictures) Result:

root@mylvs01:/# ipvsadm -L -n IP Virtual Server version 1.2.1 (size=4096) Prot LocalAddress:Port Scheduler Flags

 -> RemoteAddress:Port           Forward Weight ActiveConn InActConn

TCP 192.168.2.220:80 rr

 -> 192.168.2.221:80             Route   100    0          0
 -> 192.168.2.222:80             Route   100    0          0

root@mylvs01:/#


Add Wiki Page: http://test.mylvs.com

GRANT ALL PRIVILEGES ON test_mylvs.* TO mywikitest@localhost

   IDENTIFIED BY 'blademo';





List of all server
 
Detailed service view



List of all nodes
 
Log view




Log view



Test

01-01-01-Add-Web01.png
01-01-02-Confirm.png
01-01-03-ServerMain.png
01-02-01-Copy-Web01.png
01-02-02-Confirm.png
01-02-03-Summary.png
01-ServerSetup.png
02-01-01-Node-Empty.png
02-01-02-NewNode.png
02-01-03-Confirm.png
02-02-01-Add-new-server-to-node.png
02-02-02-Add-Web01-to-node.png
02-02-03-Add-Web03-to-node.png
02-02-04-node-Overview.png
02-02-05-apply-settings.png
02-ConfirmTestnode.png