hello, world!
This commit is contained in:
parent
a2ba18672e
commit
95e1e99be5
|
@ -6,7 +6,7 @@ chown www:www /var/www/run
|
|||
install -o www -g www -m 0400 httpd.conf /etc/
|
||||
echo "permit nopass root as www" >> /etc/doas.conf
|
||||
curl -L https://cpanmin.us | perl - App::cpanminus
|
||||
cpanm -l /var/www/perl5 FCGI
|
||||
cpanm -l /var/www/perl5 FCGI Switch
|
||||
perl -I /var/www/perl5/lib/perl5 -MFCGI -M5.010 -e 'say "it works"' # test perl installation
|
||||
install -o www -g www -m 0500 tormon/* /var/www/tormon/
|
||||
echo 'echo "Starting tormon" && doas -u www /var/www/tormon/tormon.fcgi &' >> /etc/rc.local
|
||||
|
|
|
@ -3,6 +3,7 @@ use 5.010;
|
|||
use strict;
|
||||
use warnings;
|
||||
use FCGI;
|
||||
use Switch;
|
||||
|
||||
my $sock = FCGI::OpenSocket(
|
||||
"/var/www/run/tormon.sock",
|
||||
|
@ -19,7 +20,15 @@ my $request = FCGI::Request(
|
|||
);
|
||||
|
||||
while ($request->Accept() <= 0) {
|
||||
say "Content-Type: text/plain\n\n";
|
||||
use Data::Dumper;
|
||||
print Dumper(\%ENV);
|
||||
print "Content-Type: text/html\n\n";
|
||||
|
||||
switch ($ENV{"REQUEST_URI"}) {
|
||||
case "/debug" {
|
||||
use Data::Dumper;
|
||||
print "<textarea>" . Dumper(\%ENV) . "</textarea>";
|
||||
}
|
||||
case "/" {
|
||||
print "Hello, world!";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue