0

I have just installed Apache 2.4 on Windows Server 2016 Datacenter (AWS EC2 instance). Web server seems to be working fine, I can access 'http://localhost/' and get the 'It Works!' page.

Location: C:\Apache24\

I then installed LiveCode Community Server by unzipping contents to Location: C:\LiveCode

The executable in this folder is 'livecode-community-server.exe'

My site folder is Location: C:\MySite

I then modified the httpd file as follows

Change DocumentRoot to

DocumentRoot "c:/mysite"

Change Directory directive to

<Directory "c:/mysite">

Add the following into the Directory directive

Order allow,deny
Allow from all
AddHandler livecode-script .lc
Action livecode-script "/livecode-cgi/livecode-community-server.exe"

Add the following new Directory directive

<Directory "c:/livecode">
    Options ExecCGI
    Order allow,deny
    Require all granted
    Allow from all
</Directory>

Add the following into "IfModule alias_module"

ScriptAlias /livecode-cgi/ "c:/livecode/"

After saving httpd and then restarting Apache, I open a browser and go to the URL "http://localhost/test.lc"

The response from the browser is simply the 2 characters "MZ" - (when viewing source just those 2 characters are sent back)

In this case 'test.lc' is a file in C:\MySite. This response is given for any .lc file in this folder. Any .html file in this folder works as expected.

There is no entry the Apache error.log. The access.log has the following entry

::1 - - [23/Mar/2017:14:27:01 +0000] "GET /test.lc HTTP/1.1" 200 3

Googling this reveals absolutely nothing so I can only assume it is some obvious thing I've missed. Any help or hints as to what might be going on would be hugely appreciated.

*Edit: I forgot to mention that the following line is live (not commented out) in the httpd, I presume this is all I need for the CGI module to load?

LoadModule cgi_module modules/mod_cgi.so

*Edit: I have also tried with the following ScriptAlias, and got the exact same result (MZ returned and 200 success code in the access.log)

ScriptAlias /livecode-cgi/livecode-community-server.exe "c:/livecode/livecode-community-server.exe"

*Edit: This post seems to be about the same problem (albeit with perl instead of LiveCode) https://stackoverflow.com/questions/14792978/perl-apache-perl-script-displayed-as-plain-text

The problem seems to be that in Apache 2.4 some radical changes were made that has caused a few problems. Does the linked post help? Thanks again for your time

1

After speaking with LiveCode tech support they confirmed that version 8.1.3 had a few problems and will be withdrawing it from their site.

I downloaded 8.1.2 and it works as expected.

1

The characters MZ are the magic number for the exe file format, your webserver is likely returning the contents of the livecode-community-server.exe file.

I'm not familiar with the livecode server but looking at this page suggests that your ScriptAlias may be incorrect

ScriptAlias /livecode-cgi/livecode-server.exe "<path to LiveCode Server folder>/livecode-server.exe"

  • Hi, thanks for the suggestion. I had tried that, and just double-checked it again now, but I got exactly the same response. I had read about the 4D-5A signature of executables and I suspect you're correct, that Apache is simply returning the .exe as a text string. I just can't understand why it isn't treating it as a normal CGI script. Thanks again for taking the time to reply – Matt Haughton Mar 23 '17 at 20:19
  • That was my first thought, but the access log entry is showing only 3 bytes returned, which is too short to be an executable program. – Michael Hampton Mar 23 '17 at 21:43
  • The 3rd and 4th bytes of the exe header are the size of the last block so it could easily be something that httpd determines to be EOF or similar. – user9517 supports GoFundMonica Mar 23 '17 at 21:52
  • Hi Michael, you're correct that the entire executable isn't being returned (the exe is 12,154,800 bytes). But it seems the characters following MZ could have stopped Apache returning the rest of the file as itEw mentioned – Matt Haughton Mar 24 '17 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.