Skip to main content
deleted 8 characters in body
Source Link
telcoM
  • 114k
  • 4
  • 162
  • 311

You seem to have a Debian-style configuration directory tree for Apache. Different distributions will lay out Apache configuration files differently, and so it would be useful to mention the name of the operating system or Linux distribution you're using.

Which MPM and CGI modules are you using? Please edit your question to show the results of ls /etc/apache2/mods-enabled/mpm* /etc/apache2/mods-enabled/cgi*.

The Apache web server documentation has this to say on the mod_cgi module:

When using a multi-threaded MPM under unix, the module mod_cgid should be used in place of this module.

So, if you're using the classic mpm_prefork, then mod_cgi is fine. But if you are using mpm_worker or mpm_event (for performance and/or for HTTP/2 support), you should be using mod_cgid instead.

If you have neither mod_cgi nor mod_cgid enabled (with a2enmod mod_cgicgi or a2enmod mod_cgidcgid respectively), that might explain why your CGI scripts won't work.

Note: a2enmod and a2dismod commands are specific to Debian and related distributions, and to this specific Apache configuration file layout. They won't be present in other distributions that will use a more plain Apache default configuration.

The message AH01630: client denied by server configuration: /usr/www suggests your /var/www might actually be a symlink to /usr/www. Any <Directory> blocks in Apache configuration must reference the actual path, not a path that goes through a symlink. So if realpath /var/www/html/add.cgi returns /usr/www/html/add.cgi for you, then your <Directory /var/www/> won't be correct and should be replaced with <Directory /usr/www/>.

Source: http://httpd.apache.org/docs/2.4/mod/core.html#directory

Be careful with the directory-path arguments: They have to literally match the filesystem path which Apache httpd uses to access the files. Directives applied to a particular <Directory> will not apply to files accessed from that same directory via a different path, such as via different symbolic links.

You seem to have a Debian-style configuration directory tree for Apache. Different distributions will lay out Apache configuration files differently, and so it would be useful to mention the name of the operating system or Linux distribution you're using.

Which MPM and CGI modules are you using? Please edit your question to show the results of ls /etc/apache2/mods-enabled/mpm* /etc/apache2/mods-enabled/cgi*.

The Apache web server documentation has this to say on the mod_cgi module:

When using a multi-threaded MPM under unix, the module mod_cgid should be used in place of this module.

So, if you're using the classic mpm_prefork, then mod_cgi is fine. But if you are using mpm_worker or mpm_event (for performance and/or for HTTP/2 support), you should be using mod_cgid instead.

If you have neither mod_cgi nor mod_cgid enabled (with a2enmod mod_cgi or a2enmod mod_cgid respectively), that might explain why your CGI scripts won't work.

Note: a2enmod and a2dismod commands are specific to Debian and related distributions, and to this specific Apache configuration file layout. They won't be present in other distributions that will use a more plain Apache default configuration.

The message AH01630: client denied by server configuration: /usr/www suggests your /var/www might actually be a symlink to /usr/www. Any <Directory> blocks in Apache configuration must reference the actual path, not a path that goes through a symlink. So if realpath /var/www/html/add.cgi returns /usr/www/html/add.cgi for you, then your <Directory /var/www/> won't be correct and should be replaced with <Directory /usr/www/>.

Source: http://httpd.apache.org/docs/2.4/mod/core.html#directory

Be careful with the directory-path arguments: They have to literally match the filesystem path which Apache httpd uses to access the files. Directives applied to a particular <Directory> will not apply to files accessed from that same directory via a different path, such as via different symbolic links.

You seem to have a Debian-style configuration directory tree for Apache. Different distributions will lay out Apache configuration files differently, and so it would be useful to mention the name of the operating system or Linux distribution you're using.

Which MPM and CGI modules are you using? Please edit your question to show the results of ls /etc/apache2/mods-enabled/mpm* /etc/apache2/mods-enabled/cgi*.

The Apache web server documentation has this to say on the mod_cgi module:

When using a multi-threaded MPM under unix, the module mod_cgid should be used in place of this module.

So, if you're using the classic mpm_prefork, then mod_cgi is fine. But if you are using mpm_worker or mpm_event (for performance and/or for HTTP/2 support), you should be using mod_cgid instead.

If you have neither mod_cgi nor mod_cgid enabled (with a2enmod cgi or a2enmod cgid respectively), that might explain why your CGI scripts won't work.

Note: a2enmod and a2dismod commands are specific to Debian and related distributions, and to this specific Apache configuration file layout. They won't be present in other distributions that will use a more plain Apache default configuration.

The message AH01630: client denied by server configuration: /usr/www suggests your /var/www might actually be a symlink to /usr/www. Any <Directory> blocks in Apache configuration must reference the actual path, not a path that goes through a symlink. So if realpath /var/www/html/add.cgi returns /usr/www/html/add.cgi for you, then your <Directory /var/www/> won't be correct and should be replaced with <Directory /usr/www/>.

Source: http://httpd.apache.org/docs/2.4/mod/core.html#directory

Be careful with the directory-path arguments: They have to literally match the filesystem path which Apache httpd uses to access the files. Directives applied to a particular <Directory> will not apply to files accessed from that same directory via a different path, such as via different symbolic links.

Source Link
telcoM
  • 114k
  • 4
  • 162
  • 311

You seem to have a Debian-style configuration directory tree for Apache. Different distributions will lay out Apache configuration files differently, and so it would be useful to mention the name of the operating system or Linux distribution you're using.

Which MPM and CGI modules are you using? Please edit your question to show the results of ls /etc/apache2/mods-enabled/mpm* /etc/apache2/mods-enabled/cgi*.

The Apache web server documentation has this to say on the mod_cgi module:

When using a multi-threaded MPM under unix, the module mod_cgid should be used in place of this module.

So, if you're using the classic mpm_prefork, then mod_cgi is fine. But if you are using mpm_worker or mpm_event (for performance and/or for HTTP/2 support), you should be using mod_cgid instead.

If you have neither mod_cgi nor mod_cgid enabled (with a2enmod mod_cgi or a2enmod mod_cgid respectively), that might explain why your CGI scripts won't work.

Note: a2enmod and a2dismod commands are specific to Debian and related distributions, and to this specific Apache configuration file layout. They won't be present in other distributions that will use a more plain Apache default configuration.

The message AH01630: client denied by server configuration: /usr/www suggests your /var/www might actually be a symlink to /usr/www. Any <Directory> blocks in Apache configuration must reference the actual path, not a path that goes through a symlink. So if realpath /var/www/html/add.cgi returns /usr/www/html/add.cgi for you, then your <Directory /var/www/> won't be correct and should be replaced with <Directory /usr/www/>.

Source: http://httpd.apache.org/docs/2.4/mod/core.html#directory

Be careful with the directory-path arguments: They have to literally match the filesystem path which Apache httpd uses to access the files. Directives applied to a particular <Directory> will not apply to files accessed from that same directory via a different path, such as via different symbolic links.