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

(solved) mpm-itk "Permission denied: unable to connect to cgi daemon after multiple tries:"




This is more for google than anything else.

Based on Russell Coker's helpful post, we've been using mpm-itk to set UID/GID per apache web site for a while.

Recently I setup a new debian etch / apache 2 server and the error logs filled with:

  Permission denied: unable to connect to cgi daemon
  after multiple tries:

By default debian apache2 seems to come w/ cgid enabled:

	http://httpd.apache.org/docs/2.0/mod/mod_cgid.html

cgid's purpose is:

  On certain unix operating systems, forking a process
  from a multi-threaded server is a very expensive operation
  because the new process will replicate all the threads of
  the parent process. In order to avoid incurring this expense
  on each CGI invocation, mod_cgid creates an external daemon
  that is responsible for forking child processes to run CGI
  scripts. The main server communicates with this daemon using
  a unix domain socket.

If I understand correctly, mpm-itk does forks not threads, so mod_cgid does nothing for it.

I can imagine that it would be problematic for various mpm-itk processes to attempt to write to

   /var/run/apache2/cgisock.$PROCESS_ID_OF_APACHE_CGID_DAEMON

The solution was to disable cgid by removing the symlinks to /etc/apache2/mods-available/

	rm /etc/apache2/mods-enabled/cgid.conf
	rm /etc/apache2/mods-enabled/cgid.load

and reloading apache:

	/etc/init.d/apach2/

I did the symlink removal by hand because a2dismod couldn't seem to separate mod_cgi (which we need for cgi scripts) from mod_cgid


Reply to: