Difference between revisions of "Electric Sheep"

From Jon's Wiki
 
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
 
  apt-get install libapache2-mod-perl2 graphviz netpbm libjpeg-progs mjpegtools electricsheep
 
  apt-get install libapache2-mod-perl2 graphviz netpbm libjpeg-progs mjpegtools electricsheep
  
2. Untar the [http://electricsheep.org/electricsheep-server-2.6.tar.gz server tarball] somewhere.
+
2. Untar the [http://electricsheep.org/electricsheep-server-2.6.tar.gz server tarball] to somewhere useful, eg. /home/sheep/server which assumes a ''sheep'' user in the ''www-data'' group.
  
3. Edit cgi/config.pl
+
3. Make a copy of the example config:
  
4. Edit cgi/global.pl
+
cp cgi/config.pl.eg cgi/config.pl
  
5. Edit etc/rc.fsd
+
4. Edit '''cgi/config.pl''' and tweak these vars as appropriate:
 +
 
 +
$outgoing_url_prefix = "<nowiki>http://myhost/sheepdir</nowiki>";
 +
$admin_name = "admin";
 +
$admin_password = "admin-password-here";
 +
 
 +
5. Edit '''cgi/global.pl''' and tweak these vars:
 +
 
 +
$root_url = "<nowiki>http://myhost/sheepdir</nowiki>"; # same as $outgoing_url_prefix
 +
$tmp_dir = "$run_dir/tmp";
 +
$fsd_log = "$run_dir/fsd_log";
 +
$access_log = "$run_dir/access_log";
 +
 
 +
6. Edit '''etc/rc.fsd''' so the last parameter on the start-stop-daemon call matches ''$fsd_log'' above:
 +
 
 +
$DIR/run/fsd_log
 +
 
 +
7. Do this from the base directory to compile and copy needed binaries into bin:
  
6. Do this from the base directory:
 
 
  cd src
 
  cd src
 
  make pnmmultipaste
 
  make pnmmultipaste
Line 23: Line 39:
 
  cp /usr/bin/dot bin
 
  cp /usr/bin/dot bin
  
7. Configure apache to point at the server, with configured Perl cgi:
+
8. Configure apache to point at the server, with configured Perl cgi (tweak to fit your Apache as necessary):
  
  Alias /sheep/cgi/list "/home/sheep/docroot/v2.6/cgi/list.txt"
+
  Alias /sheep/cgi/list "/home/sheep/server/cgi/list.txt"
  ScriptAlias /sheep/cgi/get "/home/sheep/docroot/v2.6/cgi/get.cgi"
+
  ScriptAlias /sheep/cgi/get "/home/sheep/server/cgi/get.cgi"
  ScriptAlias /sheep/cgi/put "/home/sheep/docroot/v2.6/cgi/put.cgi"
+
  ScriptAlias /sheep/cgi/put "/home/sheep/server/cgi/put.cgi"
  ScriptAlias /sheep/cgi/ "/home/sheep/docroot/v2.6/cgi/"
+
  ScriptAlias /sheep/cgi/ "/home/sheep/server/cgi/"
  Alias /sheep/ "/home/sheep/docroot/v2.6/"
+
  Alias /sheep/ "/home/sheep/server/"
 
    
 
    
  <Directory "/home/sheep/v2.6/cgi">
+
  <Directory "/home/sheep/server/cgi">
   SetEnv PERL5LIB /home/sheep/docroot/v2.6/cgi
+
   SetEnv PERL5LIB /home/sheep/server/cgi
 
   Order allow,deny
 
   Order allow,deny
 
   Allow from all
 
   Allow from all
Line 41: Line 57:
 
  </Directory>
 
  </Directory>
 
    
 
    
  <Directory "/home/sheep/docroot/v2.6">
+
  <Directory "/home/sheep/server">
 
   # need this as mpgs are links
 
   # need this as mpgs are links
 
   Options SymLinksIfOwnerMatch
 
   Options SymLinksIfOwnerMatch

Latest revision as of 00:50, 23 March 2007

Whizzy Electricsheep videos.

Installing the Electric Sheep server

1. Install the dependencies:

apt-get install libapache2-mod-perl2 graphviz netpbm libjpeg-progs mjpegtools electricsheep

2. Untar the server tarball to somewhere useful, eg. /home/sheep/server which assumes a sheep user in the www-data group.

3. Make a copy of the example config:

cp cgi/config.pl.eg cgi/config.pl

4. Edit cgi/config.pl and tweak these vars as appropriate:

$outgoing_url_prefix = "http://myhost/sheepdir";
$admin_name = "admin";
$admin_password = "admin-password-here";

5. Edit cgi/global.pl and tweak these vars:

$root_url = "http://myhost/sheepdir"; # same as $outgoing_url_prefix
$tmp_dir = "$run_dir/tmp";
$fsd_log = "$run_dir/fsd_log";
$access_log = "$run_dir/access_log";

6. Edit etc/rc.fsd so the last parameter on the start-stop-daemon call matches $fsd_log above:

$DIR/run/fsd_log

7. Do this from the base directory to compile and copy needed binaries into bin:

cd src
make pnmmultipaste
cd .. 
cp src/pnmmultipaste bin
cp /usr/bin/flam3-genome bin
cp /usr/bin/dot bin

8. Configure apache to point at the server, with configured Perl cgi (tweak to fit your Apache as necessary):

Alias /sheep/cgi/list "/home/sheep/server/cgi/list.txt"
ScriptAlias /sheep/cgi/get "/home/sheep/server/cgi/get.cgi"
ScriptAlias /sheep/cgi/put "/home/sheep/server/cgi/put.cgi"
ScriptAlias /sheep/cgi/ "/home/sheep/server/cgi/"
Alias /sheep/ "/home/sheep/server/"
 
<Directory "/home/sheep/server/cgi">
  SetEnv PERL5LIB /home/sheep/server/cgi
  Order allow,deny
  Allow from all
  # stop access to perl and backup files
  <FilesMatch "(.pl|~)$">
    Deny from all
  </FilesMatch>
</Directory>
 
<Directory "/home/sheep/server">
  # need this as mpgs are links
  Options SymLinksIfOwnerMatch
  Order allow,deny
  Allow from all
</Directory>