Path to CGI-BIN is lost; CGI's will not fire

I migrated an entire site from CentOS 6.2 over to a cloud server instance at Linode on Ubuntu 14.4, using VirtualMin's back and restore methods... it went almost flawlessly. Thank you! for that!

Actually all our sites were on one dedicated server before, but this time we put most of them onto one Linode instance (also running Ubuntu 14.4) and the www.hinduismtoday.com site on another separate server/ instance, also using Ubuntu 14.4 and the migration methods for both were exactly the same (I think...) the owner and web user for the www.hinduismtoday.com site is "htoday" which I will use in this thread

We use LiveCode server on both instances... this engine is stored in the cgi-bin and set with perms 755 and acts like PHP... using this in the conf directives or .htaccess file

AddHandler livecode-script .lc
Action livecode-script /cgi-bin/livecode-community-server

we can execute any *.lc script

e.g. here is where it is working as expected

http://www.himalayanacademy.com/cgi-bin/echo.lc

and from the public_html also:

http://www.himalayanacademy.com/echo.lc

on the htoday site I have examined everything minutely and cannot see any difference in my .htaccess files or the httpd.conf directives.

BUT

http://www.hinduismtoday.com/echo.lc

fails and I get this in the suexc log:

[2016-02-12 15:05:34]: uid: (1000/htoday) gid: (1000/htoday) cmd: livecode-community-server 
[2016-02-12 15:05:34]: (2)No such file or directory: exec failed (livecode-community-server)

which makes no sense because the livecode-community-server (interpreter) is there... and set to 755. I have examined httpd conf directives on the site where it works

and this:

ScriptAlias /cgi-bin/ /home/htoday/cgi-bin/

<Directory /home/htoday/cgi-bin> 
allow from all 
Require all granted 
</Directory>

is all that is needed and it works on the first server,

The only anamoly is that the SuexecUserGroup on the sites that work have two different numbers

SuexecUserGroup #1011 #1006

whereas, on the htoday site they are both the same:

SuexecUserGroup "#1000" "#1000"

this may be because on the latter site we host 1 and one only virtual server... the first "box" hosts 8 different domains...

FWIW this php also fails but suexec log gives a different reason

http://www.hinduismtoday.com/cat.php # works
but
http://www.hinduismtoday.com/cgi-bin/cat.php # fails :

[2016-02-12 18:01:19]: uid: (1000/htoday) gid: (1000/htoday) cmd: cat.php
[2016-02-12 18:01:19]: (8)Exec format error: exec failed (cat.php)

Status: 
Active

Comments

More info:

If I change my script make a direct call to the interpreter like this:

#!/home/htoday/cgi-bin/livecode-community-server
put the keys of $_SERVER into tCGIVars

    repeat for each line x in tCGIVars
        put x & ": " &  $_SERVER[x] & ("<br />"& cr) after tGlobals
    end repeat

put "Hello, Livecode Server is Up and Running" & "<br />" & tGlobals

we get this error:

[2016-02-12 18:13:54]: (2)No such file or directory: exec failed (echo.lc)
it is almost as if the server does not see the cgi-bin directory at all

FWIW this all seems to be OK:

stat  /home/htoday/cgi-bin/echo.lc
  File: ‘/home/htoday/cgi-bin/echo.lc’
  Size: 281       Blocks: 8          IO Block: 4096   regular file
Device: ca00h/51712d Inode: 43595       Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1000/  htoday)   Gid: ( 1000/  htoday)
Access: 2016-02-12 18:13:05.000000000 -0800
Modify: 2016-02-12 18:13:03.000000000 -0800
Change: 2016-02-12 18:13:05.718661494 -0800
Birth: -

Howdy -- well, let's start here -- what is the output of this command:

ls -la /home/htoday/cgi-bin/

Sorry for delay... these new forums have no way to subscribe to updates? The old one did... I may missed it but I don't see any place to check to be emailed when it a reply is made OK I did this:

ls -la /home/htoday/cgi-bin/

but you won't see any owner/group or permission problems if that is waht you are looking for

I removed a lot of sensitive CGI's from this list... we are only looking at echo.lc

drwxr-x--- 13 htoday htoday 4096 Feb 12 14:51 . drwxr-x--- 18 htoday htoday 4096 Jul 8 2015 .. -rwxr-xr-x 1 htoday htoday 213 Jan 20 2011 check_usage.cgi -rwxr-xr-x 1 htoday htoday 850 Jan 20 2011 comment_flag.cgi drwxrwxr-x 2 htoday htoday 4096 Feb 4 12:45 drivers -rwxr-xr-x 1 htoday htoday 530 Jan 20 2011 echo.cgi,1 -rwxr-xr-x 1 htoday htoday 190 Jan 20 2011 echoip.cgi -rwxr-xr-x 1 htoday htoday 281 Feb 12 18:13 echo.lc -rwxr-xr-x 1 htoday htoday 911 Jan 20 2011 errorpage.cgi drwxrwxr-x 2 htoday htoday 4096 Feb 4 12:45 externals -rwxr-xr-x 1 htoday htoday 5230240 May 14 2015 livecode-community-server -rwxr-xr-x 1 htoday htoday 33 Feb 19 12:49 test-sh.cgi

http://www.hinduisamtoday.com/cgi-bin/test-sh.cgi

also fails: I should get back one line of text:

!/bin/sh

echo "testing bin/sh"

[Fri Feb 19 13:22:50.568952 2016] [cgi:error] [pid 19895] [client 24.43.231.222:52419] malformed header from script 'test-sh.cgi': Bad header: testing bin/sh

but we get something different here:

http://www.hinduisamtoday.com/cgi-bin/echo.lc

[Fri Feb 19 13:23:08.292168 2016] [cgi:error] [pid 19904] [client 24.43.231.222:52422] AH01215: suexec policy violation: see suexec log for more details [Fri Feb 19 13:23:08.292489 2016] [cgi:error] [pid 19904] [client 24.43.231.222:52422] End of script output before headers: echo.lc

/var/log/apache2/suexec.log says:

[2016-02-19 13:15:51]: uid: (1000/htoday) gid: (1000/htoday) cmd: echo.lc [2016-02-19 13:15:51]: (2)No such file or directory: exec failed (echo.lc)

OK I found notifications under my account... testing now....

You can close this "ticket" with further investigation turns out we were missing some libs and so livecode-community-server was "dead in the water"

until:

apt-get install libxext6

After that it worked.

Strange error messages though in suexec_log... tell me that the file was missing when in fact it was not, but was not firing.

Ah, I'm glad to hear you were able to resolve this issue! Thanks for letting us know how you fixed it!

to document the solution here in case it is useful:

One of the LiveCode community wizards taught me about ldd

print shared library dependencies

ldd ./livecode-community-server

and bingo, the rest was obvious: libXext.so.6 was missing;

but the install is not exactly what one expects. it was all lower case with no suffix apt-get install libxext6

I don't usually need to get to this level of sys admin, but it's a good thing: we are learning and the little gray cells are staying bright and shiny