1

I recently migrated to a new hosting company. I am pretty new to linux and apache as far as configuration is involved. I can't execute a binary CGI script on the new server. I get a 500 server misconfiguration when trying to execute the script and in the erro log i get: "End of script output before headers" Our old server used the programming language HTML OS by aestiva which uses binary compiled CGI scripts to operate. Things I have tried:

  1. Permissions - all permissions are set to 755, other simple cgi scripts run fine with the same permissions
  2. writing a simple GCI sript - executes just fine even in the same directory
  3. disabling and enabling selinux
  4. running the script from command line i get this error "Unrecognized character \x7F in column 1 at asetup476.cgi line 1"

Anyways, here are the specs:

OLD SERVER
easy Apache 3 2.4.25(Unix) perl v5.10.1

NEW SERVER
easy Apache 4 2.4.29(cPanel) perl v5.10.1

the file structures are completely different between easy Apache 3 and 4 so are the httpd.conf files so copying over the conf files probably wont work. My hosting provider asks me to make sure the files are uploaded with ASCII but this is a binary compiled file so that will render it unusable. I am new to this so I am sorry if there is not enough info, I will provide whatever you need if you are attempting to help. Any help is very much appreciated! here is the cgi script I am trying to run: file

EDIT possible cause, I have found out that my old server supports 32 bit CGI executable and my new server possibly does not. command line test:

readelf -h $(which init) | grep "Class"

returned:

Class:                             ELF64

I hope this sheds some light, anyone know how to add 32 bit support to CentOS linux?

SOLVED enabling 32 bit support for centOS linux did the trick:

yum install glibc-devel.i686
Justin Duncan
  • 128
  • 1
  • 10
  • First, try `use CGI::Carp qw(fatalsToBrowser);` in scripts. – PinkTux Feb 14 '18 at 14:23
  • 1
    If it's a compiled file, what does Perl have to do with it? – simbabque Feb 14 '18 at 14:26
  • You'll probably need to recompile any binaries for the OS on the new servers – Chris Turner Feb 14 '18 at 14:27
  • @PinkTux - if this a binary compiled file, can I add that without messing up the script? – Justin Duncan Feb 14 '18 at 14:32
  • 1
    @ChrisTurner I am using a recompiled binary installation script to try and install HTML OS on the new server, so it's most likely something with the configuration – Justin Duncan Feb 14 '18 at 14:35
  • @simbabque I don't know, are compiled scripts not executed with perl? I am new to all of this, so I am trying – Justin Duncan Feb 14 '18 at 14:39
  • No, that's why it's compiled. It might be that it was a Perl script that was compiled using PAR, but we don't know. Can you try to find more information? – simbabque Feb 14 '18 at 15:38
  • 2
    I'm voting to reopen this question, as it's about a binary, not about a Perl script with CGI.pm. – simbabque Feb 14 '18 at 15:38
  • 1
    @simbabque I am not sure what it was compiled with, it is an old programming language called HTML OS. the link i put will take you right to the file and the install instructions – Justin Duncan Feb 14 '18 at 15:51
  • this one: http://www.htmlos.org/pages/htmlos/website/index.html? – simbabque Feb 14 '18 at 15:52
  • @simbabque yes that site has the linux script – Justin Duncan Feb 14 '18 at 15:54
  • It seems to be proprietary and paid. I've found a few questions on here about it, but they don't have their own tag. There seem to be a few people who are familiar with it around, but you'll have to attract them. I would start by renaming the question to something more useful. – simbabque Feb 14 '18 at 15:55
  • Can't put the solution in here anymore, so a comment will have to do. Interesting I didn't get notified, because I use Aestiva's HTML OS a lot and have dealt with this issue many times. As the OP already pointed out, this has to do with the fact that HTMLOS is 32-bit. So if you want this to work on a new server, you need to make sure to install the 32-bit library. This may be different between OS-es.. there's another command for non-CENTOS machines, just FYI. Oh, and the question does NOT have the answers in that link in the blue box at the top... – Malachi Sep 29 '20 at 16:14

0 Answers0