Re: Ubuntu 22.04/Apache 2.4.58 can enable cgid, but not cgi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On Sat, May 17, 2025 at 4:00 PM EML <sa212+apache@xxxxxxxxxxx> wrote:

This combination (22.04.2/2.4.58) defaults to mpm_prefork. I have a previous (working) Apache config which uses mod_cgid, and which sets 'CGIDScriptTimeout'. Since this is a non-threading prefork system, I've attempted to change 'CGIDScriptTimeout' to 'CGIScriptTimeout'. However, this doesn't work: 'apachectl -M' reports a syntax error at 'CGIScriptTimeout', and Apache doesn't start.

In more detail, I've:

  1. Commented out the 'CGIScriptTimeout' line
  2. Run 'a2enmod cgi'
  3. Run 'lsof /usr/lib/apache2/modules/mod_cgi.so'. This confirms that the mod_cgi file is used by 7 processes; each process has the PID of an Apache2 instance
  4. Run 'lsof /usr/lib/apache2/modules/mod_cgid.so'. This confirms that mod_cgid is unused
  5. Uncommented the CGIScriptTimeout line
  6. Run 'apachectl -M'. This reports a syntax error  on the 'CGIScriptTimeout' line

I've also done the reverse: enabled mod_cgid, and replaced the 'CGIScriptTimeout' with 'CGIDScriptTimeout', and confirmed that Apache runs and no syntax errors are reported. In this state, 'lsof' also confirms that mod_cgid.so is being used.

Questions:

  1. Does anyone know what's going on here? Can I use plain mod_cgi with Ubuntu 22.04.2 and 2.4.58?
  2. Is there actually a problem with running mod_cgid with mpm_prefork? I suspect not, but I haven't tested it yet
  3. I'm not entirely sure why this setup defaults to mpm_prefork. I'm running legacy C++ which requires plain CGI, and php, with mod_php (libphp8.3.so).  Does libphp actually use mod_cgi[d], or is it using its own comms mechanism? Should I actually care if php is thread-safe or not?

Thanks.

First, you are free to change the mpm to event by commenting out the LoadModule directive for prefork, and uncommenting the LoadModule directive for event.  You will want to stop using the mod_php DSO if you change to the event mpm, mind you.

As for your other questions, mod_cgi is to be used with prefork, and mod_cgid for worker/event.  They don't mix.

 

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux