This is a very simple Perl script.
URL
https://edge.a1z.us/cgi-bin/edge.edge.cgi
Here is the source:
#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "Edge.Edge\n";
Error:
[Sat Jun 06 15:47:15.259790 2020] [cgid:error] [pid 9326:tid 139686729721600] [client 162.*:63763] End of script output before headers: edge.edge.cgi
Works on CMDLINE
[edge@edge cgi-bin]$ ./edge.edge.cgi
Content-Type: text/html
Edge.Edge
[edge@edge cgi-bin]$
but not on browser
some more details
[edge@edge cgi-bin]$ perl -v
This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
(with 51 registered patches, see perl -V for more detail)
Copyright 1987-2018, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.
Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.
[edge@edge cgi-bin]$ uname -a
Linux edge.a1z.us 4.18.0-147.8.1.el8_1.x86_64 #1 SMP Thu Apr 9 13:49:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
[edge@edge cgi-bin]$
[edge@edge cgi-bin]$ file /usr/bin/perl
/usr/bin/perl: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=7c8590186d4c0265b355cd02c291b129879680f8, stripped
[edge@edge cgi-bin]$
Status:
Active
Comments
Submitted by JamieCameron on Sat, 06/06/2020 - 13:24 Comment #1
Is the script owned by the domain owner, and not world-writable?
it is 755
But Perl/Hypnotoad/Mojolicious works.
mojo generate
edge.conf
hypnotoad
URL:
http://edge.a1z.us:5000/
Submitted by JamieCameron on Sat, 06/06/2020 - 19:22 Comment #5
Also check the log file /var/log/httpd/suexec_log, if it exists.
suexec_log does not exist
It will not be possible to run scripts like that, as by default, SuexecUserGroup is defined but suexec is pre-compiled, hardcoded path points to /var/www.
There is a work-around though, which I thought would work theoretically, as of now, I tested it practically and here is how it can be done:
sed -i 's/\/var\/www\/html/\/var\/www\/default/g' /etc/httpd/conf/httpd.conf
mkdir /home/default
mount -o bind /home /var/www
Edit and change current <VirtualHost> directives' values from /home to /var/www
Restart Apache by running systemctl restart httpd command.
Enjoy running scripts (other than PHP), as server owner, without re-building Apache.
Jamie, do you think we could do it on Virtualmin side automatically? :--)
Thanks Ilia. I know it has been a while since you answered this question .. but i tried it today ... it worked.
Answer to your question: If you reload the left menu, do you see all domain names listed as expected?
Yes.
List Virtual Domains
lists all domains on the machine.Also, recheck config did not show any errors.