I resent spun up a new server with CentOS and installed VirtualMin. I use this primarily for one website with a lot of data.
For the search I have a search.cgi script. Coming from the old server with an older version of CentOS and VirtualMin I imported the backup file and the main portion of the website was up and running.
Except for the Search. When the script is executed I recieve Internal Server Error.
On the error logs it says:
suexec failure: could not open log file
fopen: Permission denied
Premature end of script headers: search.cgi
Which from what I have researched this is showing that suexec is operating correctly
The cgi script is located in \home\USERNAME\cgi-bin\search\search.cgi
search.cgi - Permissions are 755
cgi-bin dir - 755
search dir - 755
Owner and group on search.cgi are USERNAME:USERNAME
I apologize in advance since it has been a few years since I set up a VMin server. I remember having to change “something” when I set up the previous server but am completely stuck now.
I am not familiar with perl but did create a “Hello World” script with the same results
A handful of folks over the years have described seeing this particular issue; but I’ve had a bear of a time trying to determine the cause.
We don’t normally see that, normally CGI scripts work out of the box, and don’t need any tweaking.
For example, I just built a fresh CentOS 6 server to test that, and using the default settings, created a new Virtual server, put a test.pl script into the cgi-bin directory, and printed “Hello World” using it.
You can see this fellow from back in 2011 who had that… we looked at all sorts of stuff back then but just couldn’t nail down the cause:
As for CentOS install this it is very default. The server is running in house on a Hyper-V server.
I did a net base install.
Then followed instructions to install VirtualMin GPL.
I did import a backup from my old VirtualMin server which was running VMin 3.94 gpl on CentOS Linux 6.3 Install was the same there except it is on a physical server instead of virtual.
Current server ins CentOS 6.4
One other note the CGI script is not a perl script. According to the software I generated the search with it is a binary executable. From what I can tell the server is not set to handle all CGI files as Perl but not exactly sure where to look.
Looking at the other post you mentioned I wanted to state that PHP works fine both with CGI and FCGId. Granted the php I am using is VERY simplistic but still it’s php.
It’s just the CGI script i am trying to run doesn’t work.
In response to my last post I thought back through all the Googling I had done and remembered another post.
It turns out I didn’t have glibc installed.
So if you are having trouble getting a CGI script to run find out wether the script is perl or c, or what ever else and make sure you have what is needed to run those scripts CGI.
I spent HOURS on this. I am glad to have it done but also mad that it was something as simple as installing something.