[BlueOnyx:25418] Re: CGIWrap Error: Server UserID Mismatch Error FIX

Michael Stauber mstauber at blueonyx.it
Thu May 12 13:59:25 -05 2022


Hi all,

David Hahn wrote two years ago:
> I may of found a way to run perl without errors on the 5210R.
> It's not a safe fix but might help someone in a jam. Like me..
> I have a server full of perl scripts i'm moving from 5106R to 5210R.
I'm intentionally replying to this two year old topic in order to make 
the solution a bit more visible in search engines.

On 5210R we did indeed have intermittent issues with Perl scripts not 
working as intended. Over the years CentOS 8 and AlmaLinux 8 updates 
have repeatedly broken the support for Scripts with the *.pl ending, 
whereas *.cgi kept working.

This has now been fixed for good.

The issue was that /etc/httpd/conf/mime.types and /etc/mime.types both 
have the entry "application/x-perl pl" and as long that is there, Apache 
will ignore any other instructions that we give it for the handling of 
*.pl scripts.

The BlueOnyx installer commented these lines out, but subsequent YUM 
updates of the OS sometimes brought it back.

We now run a periodic check via Swatch that makes sure that the entry 
remains commented out for good. This has just been published as a YUM 
update.


Now some basics about CGI/Perl script handling on 5210R in general:
====================================================================

When "Enable Common Gateway Interface (CGI)" is ticked in the GUI of a 
Vsite, then Perl scripts (*.cgi *and* .pl) *should* work anywhere within 
/web and all sub-directories.

You *can* have a cgi-bin, but don't need to have one. A cgi-bin is 
purely optional. It'll just be treated like any other directory. And 
like said: Perl scripts will work everywhere, provided "Enable Common 
Gateway Interface (CGI)" is ticked for the Vsite in question.

That being said, a Perl script must be:

- A plain text file and hasn't been uploaded in binary format
- Must be executable (chmod 755)
- Must be owned by a siteAdmin and the group of the Vsite
   And that must not be "httpd", "apache" or "nobody", but a user
   *with* siteAdmin privileges!
- Must have a "shebang" in the first line such as:
   #!/usr/bin/perl
- Must not have ^M's at the end of lines

There is no longer the need to throw a .htaccess with special Perl 
related provisions into the /web directory or anywhere else.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list