]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
modified web commands to run in apache and httpi
authorJan Michel <j.michel@gsi.de>
Mon, 20 Jan 2014 13:20:14 +0000 (14:20 +0100)
committerJan Michel <j.michel@gsi.de>
Mon, 20 Jan 2014 13:20:14 +0000 (14:20 +0100)
web/htdocs/apacheEnv.pm [new file with mode: 0644]
web/htdocs/commands/get.pl
web/htdocs/commands/getmultreg.pl
web/htdocs/commands/getpadiwa.pl
web/htdocs/commands/nettrace.pl
web/htdocs/commands/put.pl
web/htdocs/commands/putbit.pl
web/htdocs/commands/spiexec.pl
web/htdocs/index.pl

diff --git a/web/htdocs/apacheEnv.pm b/web/htdocs/apacheEnv.pm
new file mode 100644 (file)
index 0000000..c2f5987
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/perl
+#This file sets the environment in case that the daqtools are run within an Apache web-server.
+
+$ENV{'DAQOPSERVER'} = 'jspc55:88';
+
+
+1;
\ No newline at end of file
index aaa9a4d7d597e61cabbcdf253927252f4146eead..962c9e7c7e58e61b81a038af37a8748953ee18d2 100755 (executable)
@@ -1,10 +1,18 @@
-&htsponse(200, "OK");
-print "Content-type: text/html\r\n\r\n";
-
-
-
+#!/usr/bin/perl
+use CGI::Carp qw(warningsToBrowser fatalsToBrowser); 
 use HADES::TrbNet;
 use Data::Dumper;
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print header("text/html");
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
+
+
 
  if (!defined &trb_init_ports()) {
    die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}");
index 3261120f433e4d092127df67c87588c7c3ed6698..6e8c1324f83cc9710c3e0f49831c555d30b2716a 100755 (executable)
@@ -1,10 +1,18 @@
-&htsponse(200, "OK");
-print "Content-type: text/html\r\n\r\n";
+#!/usr/bin/perl
+use HADES::TrbNet;
+use Data::Dumper;
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print header("text/html");
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
 
 
 
-use HADES::TrbNet;
-use Data::Dumper;
 
  if (!defined &trb_init_ports()) {
    die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}");
index 856d962b57ad7cac4cf0f538be1a850acc835e9e..930ed05aac281ef5fa1e524c1c6960d386633a61 100755 (executable)
@@ -1,15 +1,15 @@
-#!/usr/bin/perl -w
-
-eval{
-  &htsponse(200, "OK");
-  print "Content-type: text/html\r\n\r\n";
-  };
-
-
-
+#!/usr/bin/perl
 use HADES::TrbNet;
 use Data::Dumper;
-
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print header("text/html");
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
 
 
  if (!defined &trb_init_ports()) {
index 7396b298a45c326519a2fd45f1a8ba1bef4599c2..6080da892b98812ed0b97e346d7c3e50f3fa1111 100755 (executable)
@@ -1,11 +1,18 @@
-#!/usr/bin/perl -w
-&htsponse(200, "OK");
-print "Content-type: text/html\r\n\r\n";
-
-
+#!/usr/bin/perl
 use Date::Format;
 use HADES::TrbNet;
 use Data::Dumper;
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print header("text/html");
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
+
+
 
  if (!defined &trb_init_ports()) {
    die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}");
index 6d2d6fee28dea20065bf3560a852dbefcec8a45b..f60b50487bb4524d67a1083b422807847b6309e5 100755 (executable)
@@ -1,11 +1,17 @@
-&htsponse(200, "OK");
-print "Content-type: text/html\r\n\r\n";
-
-
-
+#!/usr/bin/perl
 use HADES::TrbNet;
 use Data::Dumper;
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print header("text/html");
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
 
+  
  if (!defined &trb_init_ports()) {
    die("can not connect to trbnet-daemon on the $ENV{'DAQOPSERVER'}");
  }
index 813ed54393f35599c6c2ca2caddbd419a065c0c0..f4e65593694d0bfeb7f7d568c34381a7d58873b0 100755 (executable)
@@ -1,6 +1,15 @@
-#!/usr/bin/perl -w
-&htsponse(200, "OK");
-print "Content-type: text/html\r\n\r\n";
+#!/usr/bin/perl
+use HADES::TrbNet;
+use Data::Dumper;
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print header("text/html");
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
 
 
 
index e372cb44ea72cc117c901d5f4a28ec331c48c2af..f23d295edf77c4d39ea9858608b372e9130e2f63 100755 (executable)
@@ -1,5 +1,15 @@
-&htsponse(200, "OK");
-print "Content-type: text/html\r\n\r\n";
+#!/usr/bin/perl
+use HADES::TrbNet;
+use Data::Dumper;
+if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
+  print "HTTP/1.0 200 OK\n";
+  print header("text/html");
+  }
+else {
+  use lib '..';
+  use if (!($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i)), apacheEnv;
+  print "Content-type: text/html\n\n";
+  }
 
 
 
index fa3b5d4530e215efd287ec3f9e51cb612411ee02..9925f91b771ee187a1102011a22fe78062c684b2 100755 (executable)
@@ -5,6 +5,7 @@ if ($ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i) {
   }
 else {
   print "Content-type: text/html\n\n";
+  use if (!$ENV{'SERVER_SOFTWARE'} =~ /HTTPi/i), apacheEnv;
   }