User Tools

Site Tools


hints:misc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
hints:misc [2023/07/08 21:05] – [Building BGPDUMP] philiphints:misc [2023/08/19 07:20] (current) – [Building a Looking Glass] philip
Line 41: Line 41:
  
 You can now take your MRT files, eg as produce by [[http://routeviews.org|RouteViews]] and convert them into plain text for further analysis. You can now take your MRT files, eg as produce by [[http://routeviews.org|RouteViews]] and convert them into plain text for further analysis.
 +
 +===== Building a Looking Glass =====
 +
 +These instructions cover how to put together the [[https://github.com/Cougar/lg|Cougar Looking Glass]] code. Why choose this one? Well, it's there, it seems to work fine, and installs nicely on Ubuntu 22.04. Even though the code itself hasn't been touched since 2009!
 +
 +First off, grab the few files you need off the repo - you could clone it, but there are only a few files, and they haven't been changed in a while. Put them all in **/usr/local/src/LG**. All the directions below assume that the working directory is here.
 +
 +Assuming a basic install of Ubuntu 22.04, we need to add a few packages, including a compiler.
 +<code>
 +sudo apt install apache2 make gcc libexpat1-dev
 +</code>
 +
 +Next we need to install a few extra perl modules to support the looking glass. Assuming we don't have CPAN already set up, we need to do:
 +<code>
 +cpan App::cpanminus
 +</code>
 +This installs the basic CPAN environment to make adding in modules simpler. Once the CPAN environment is in place, you then need to run:
 +<code>
 +cpan install CPAN::DistnameInfo
 +cpan install XML::Parser
 +cpan install Net::Telnet
 +</code>
 +which will install the XML parser and telnet support for Perl. This should all complete successfully - you'll see these two packages and all the supporting modules being automatically installed.
 +
 +With the Apache2 webserver installed in its default configuration, we now need to create two folders for the Looking Glass components.
 +<code>
 +sudo mkdir -p /var/www/looking-glass/lg
 +</code>
 +And then copy the required components into place.
 +<code>
 +sudo cp -p favicon.ico index.html lg.cgi lg.conf /var/www/looking-glass/lg/
 +</code>
 +
 +Next we need to create the Apache site configuration:
 +<code>
 +cd /etc/apache2/sites-available
 +</code>
 +and create a new config file with the URL of your site, for example, **lg.my.site.conf** with the following contents:
 +<code>
 +<VirtualHost *:80>
 +  ServerName  lg.my.site
 +
 +  DocumentRoot /var/www/looking-glass/lg/
 +
 +  Alias /lg/favicon.ico /var/www/looking-glass/lg/favicon.ico
 +  Alias /libraries /var/www/looking-glass/libraries
 +  ScriptAlias /lg /var/www/looking-glass/lg/lg.cgi
 +
 +  <Directory "/var/www/looking-glass/lg">
 +    AllowOverride None
 +    Options +ExecCGI
 +    AddHandler cgi-script .cgi .pl
 +    Require all granted
 +  </Directory>
 +
 +</VirtualHost>
 +</code>
 +
 +We need to turn on support for CGI:
 +<code>
 +sudo a2enmod cgid
 +</code>
 +
 +Then we need to enable the site:
 +<code>
 +sudo a2ensite lg.my.site
 +</code>
 +and then restart Apache2 for it to go live:
 +<code>
 +sudo systemctl restart apache2
 +</code>
 +
 +
  
  
 [[start| Back to Home page]] [[start| Back to Home page]]
  
hints/misc.1688814301.txt.gz · Last modified: 2023/07/08 21:05 by philip