пятница, 6 ноября 2015 г.

Install Looking Glass

Link for download LookingGlass is below topic.

OS: Centos 6.7

useradd lg
usermod -a -G apache lg

mkdir -p /opt/lg
bzip2 -d lg-1.9.tar.bz2
tar xvf lg-1.9.tar
cp lg.cgi lg.conf favicon.ico /opt/lg
chmod 644 /opt/lg/*
chmod 755 /opt/lg/lg.cgi
chmod g+x /home/lg

Install Perl modules:

yum install perl-XML-LibXML perl-libxml-perl gcc make perl-CPAN

Install Perl modules from CPAN:

perl -MCPAN -e shell
force install DB_File
force install Math::GMP
force install Archive::Zip
force install Math::Pari
force install Net::SSH::Perl
Configure ENV variable  and UTF8-encode:

vi lg.cgi

$ENV{HOME} = "/home/lg/";

$port = 22 if ($port eq "");
                $ssh = Net::SSH::Perl->new($host, port => $port);
                utf8::encode ($password);
                utf8::encode ($login);
                $ssh->login($login, $password);
                my ($out, $err) = $ssh->cmd("$command");
                @output = split (/\n/, $out);

vi /etc/httpd/conf.d/lg.conf

AddHandler cgi-script .cgi

<VirtualHost *:80>
    ScriptAlias /lg /opt/lg/lg.cgi

    <Directory "/opt/lg">
        Options -Indexes FollowSymLinks MultiViews +ExecCGI
        AllowOverride All
    </Directory>

    ServerAdmin admin@domain.ru
    DocumentRoot /opt/lg
    ServerName domain.com
    ErrorLog logs/lg-error_log
    CustomLog logs/lg-access_log common
</VirtualHost>

service httpd restart

Download from Google Drive