When I run my cgi app using the url "162.###.###.##/cgi-bin/WTG/webapptest.cgi" I get 500 Internal Server Error

October 9, 2018 494 views
DigitalOcean Apache Ubuntu

Hi,

I have developed a testing CGI web app. After I transferred all the files, including the libraries, under the folder /usr/lib/cgi-bin/WTG/
and try to run it through web browser with the following url:
162.###.###.##/cgi-bin/WTG/webapptest.cgi
I get the error
500 Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Apache/2.4.18 (Ubuntu) Server at 162.243.143.32 Port 80

Can anyone please help me out on this issue?
Thank you in advance.
Nikos

1 comment
  • Hi all,
    I am attaching below the apache2/error.log in case it helps:

    [Tue Oct 09 23:00:10.900063 2018] [cgi:error] [pid 8945] [client 174.7.246.82:51173] AH01215: /usr/lib/cgi-bin/WTG/WebAppTest: error while loading shared libraries: libunwind.so.8: cannot open shared object file: No such file or directory: /usr/lib/cgi-bin/WTG/webapptest.cgi

    [Tue Oct 09 23:00:10.901339 2018] [cgi:error] [pid 8945] [client 174.7.246.82:51173] AH01215: Can't use an undefined value as a symbol reference at /usr/lib/cgi-bin/WTG/webapptest.cgi line 118.: /usr/lib/cgi-bin/WTG/webapptest.cgi

    [Tue Oct 09 23:00:10.901364 2018] [cgi:error] [pid 8945] [client 174.7.246.82:51173] End of script output before headers: webapptest.cgi

1 Answer
sugarakis October 9, 2018
Accepted Answer

Hi all again.

SOLUTION FOUND!!!

After going through the above apache2/error.log and surfing the first line:
error while loading shared libraries: libunwind.so.8: cannot open shared object file

it means that library "libunwind" was missing from my apache2 setup/configuration.
When I executed the command from Terminal (logged in as root):

sudo apt-get install -y libunwind-dev

it installed several files and then my url works perfectly!!!

I hope my case helps others as well.
Take care.
nikos

Have another answer? Share your knowledge.