Newbie: How to run CGI scripts outside Zope
Hi, I am trying to install nagios to my site. Nagios requires that the following script alias and alias to be added to the httpd.conf file. ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/ <Directory "/usr/local/nagios/sbin/"> AllowOverride AuthConfig Options ExecCGI Order allow,deny Allow from all </Directory> Alias /nagios/ /usr/local/nagios/share/ <Directory "/usr/local/nagios/share"> Options None AllowOverride AuthConfig Order allow,deny Allow from all </Directory> However, I set my Location like this: <Location /> SetHandler fastcgi-script </Location> Now, when I set my URL to www.mydomain.com/nagios, I get an error. So can anyone tell me how to inform Zope to ignore this path and let Apache handle it? Thanks. AL
On Sat, Jan 11, 2003 at 11:56:13PM +0800, Alfredo P. Ricafort wrote:
Now, when I set my URL to www.mydomain.com/nagios, I get an error. So can anyone tell me how to inform Zope to ignore this path and let Apache handle it?
You don't tell Zope anything. You tell Apache that /nagios should be handled internally, and that other things (perhaps even including everything else under /) should go to Zope. I've got examples of this at http://www.zope.org/Members/mwr/VHosts_With_Zope_Default -- a similar set I use at home including aliased directories and CGIs would be something like: ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman Alias /pipermail/ /var/lib/mailman/archives/public/ <Directory /var/lib/mailman/archives/public> Options FollowSymLinks </Directory> <IfModule mod_rewrite.c> RewriteEngine On RewriteLog "/var/log/apache/rewrite_log" RewriteLogLevel 1 RewriteRule ^/pipermail/ - [L] RewriteRule ^/cgi-bin/ - [L] RewriteRule ^/mailman/ - [L] RewriteCond %{HTTP_HOST} ^.*:80$ RewriteRule ^/(.*) \ http://127.0.0.1:9673/VirtualHostBase/http/%{HTTP_HOST}:80/$1 [L,P] </IfModule> -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
Hi, Thanks for your reply. I try putting this in my httpd.conf file. Alias /nagios/ /usr/local/nagios/share/ <Directory /usr/local/nagios/share/> Options FollowSymLinks </Directory> ScriptAlias /nagios/cgi-bin/ /usr/local/nagios/sbin/ <Directory /usr/local/nagios/sbin/> AllowOverride AuthConfig Options ExecCGI Order allow,deny Allow from all </Directory> RewriteEngine on RewriteLog "/var/log/httpd/rewrite_log" RewriteLogLevel 1 RewriteRule ^/nagios/ - [L] However, when I access nagios(www.mydomain.com/nagios/), I am getting this error message. FastCGI: invalid (dynamic) server "/usr/local/nagios/share/index.html": access for server (uid -1, gid -1) not allowed: execute not allowed Did I miss anything in my config file ? How can tell Apache to stop sending all the request to FastCgi ? AL On Sun, 2003-01-12 at 00:55, Mike Renfro wrote:
On Sat, Jan 11, 2003 at 11:56:13PM +0800, Alfredo P. Ricafort wrote:
Now, when I set my URL to www.mydomain.com/nagios, I get an error. So can anyone tell me how to inform Zope to ignore this path and let Apache handle it?
You don't tell Zope anything. You tell Apache that /nagios should be handled internally, and that other things (perhaps even including everything else under /) should go to Zope.
I've got examples of this at http://www.zope.org/Members/mwr/VHosts_With_Zope_Default -- a similar set I use at home including aliased directories and CGIs would be something like:
ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman Alias /pipermail/ /var/lib/mailman/archives/public/ <Directory /var/lib/mailman/archives/public> Options FollowSymLinks </Directory> <IfModule mod_rewrite.c> RewriteEngine On RewriteLog "/var/log/apache/rewrite_log" RewriteLogLevel 1 RewriteRule ^/pipermail/ - [L] RewriteRule ^/cgi-bin/ - [L] RewriteRule ^/mailman/ - [L] RewriteCond %{HTTP_HOST} ^.*:80$ RewriteRule ^/(.*) \ http://127.0.0.1:9673/VirtualHostBase/http/%{HTTP_HOST}:80/$1 [L,P] </IfModule>
On Sun, Jan 12, 2003 at 07:22:06PM +0800, Alfredo P. Ricafort wrote:
However, when I access nagios(www.mydomain.com/nagios/), I am getting this error message.
FastCGI: invalid (dynamic) server "/usr/local/nagios/share/index.html": access for server (uid -1, gid -1) not allowed: execute not allowed
Never done it, but I'd expect that if you're not using FastCGI at all, I'd comment out any mentions of FastCGI in Apache's config files. I've certainly never needed it for normal CGI usage. If you are using it, and need to keep it for some other reason, then you've gone well beyond my ability to answer. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
participants (2)
-
Alfredo P. Ricafort -
Mike Renfro