Re: binary cgi mess ( repost )

2003-03-18 Thread Abdul-wahid Paterson
Hi,

This is the config I have for nagios on one of my servers. I also have
mod_perl working so there should be no problem with the two together.

(My directory paths are different to yours but the principle is the
same)

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



Regards,

Abdul-Wahid


On Tue, 2003-03-18 at 09:58, Francesc Guasch wrote:
 I posted this, I received a couple of answers but the problem
 is still unsolved.
 
 I have a mod_perl server and I need to add a cgi application
 outside mod_perl, nagios.
 
 I followed the guide and when I try to use the cgis, the
 binary files are displayed instead of executed.
 I tried the same in another apache server without Mason
 and it worked well. So I think something of my config must
 be messing it.
 
 I made sure the mason handler wasn't in the middle. I added
 a debugging line in the very beginning of it.
 
 I added this to the config file, suggested by Abdul-Wahid
AddHandler cgi-script .cgi
 Then he the binary wasn't displayed in the browser, but
 downloaded. ( A save dialog was showed ).
 
 
 Here is the config for apache:
 
 AddType application/x-httpd-cgi .cgi
 ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi/
 
 Location /nagios/cgi-bin
   Options ExecCGI
 /Location
 
 Directory /usr/lib/nagios/cgi/
  AllowOverride AuthConfig
  Options ExecCGI
  order deny,allow
  deny from all
  allow from ip_removed
 /Directory
 
 Alias /nagios/ /usr/share/nagios/
 Directory /usr/share/nagios/
  AllowOverride AuthConfig
  Options None
  order deny,allow
  deny from all
  allow from ip_removed
 /Directory
 use Apache::AuthDBI;
 
 any hints ? Thank you for your time.


signature.asc
Description: This is a digitally signed message part


Re: binary cgi mess

2003-03-13 Thread Abdul-wahid Paterson
Hi,

Shouldn't it be

AddHandler cgi-script .cgi

Regards,

Abdul-Wahid


On Thu, 2003-03-13 at 10:53, Francesc Guasch wrote:
 I have a mod_perl server and I need to add a cgi application
 outside mod_perl, nagios.
 
 I followed the guide and when I try to use the cgis, the
 binary files are downloaded instead of executed.
 I tried the same in another apache server without Mason
 and it worked well. So I think something of my config must
 be messing it.
 
 I made sure the mason handler wasn't in the middle. I added
 a debugging line in the very beginning of it.
 
 Here is the nagios config for apache:
 
 AddType application/x-httpd-cgi .cgi
 ScriptAlias /nagios/cgi-bin/ /usr/lib/nagios/cgi/
 
 Location /nagios/cgi-bin
  Options ExecCGI
 /Location
 
 Directory /usr/lib/nagios/cgi/
 AllowOverride AuthConfig
 Options ExecCGI
 order deny,allow
 deny from all
 allow from ip_removed
 /Directory
 
 Alias /nagios/ /usr/share/nagios/
 Directory /usr/share/nagios/
 AllowOverride AuthConfig
 Options None
 order deny,allow
 deny from all
 allow from ip_removed
 /Directory
 use Apache::AuthDBI;
 
 any hints ? Thank you for your time.


signature.asc
Description: This is a digitally signed message part


Re: how to make an Alias?

2003-03-13 Thread Abdul-wahid Paterson

Hi,

Alias /cctvimages/ /home/me/images/

Should do it.

Regards,

Abdul-Wahid


On Thu, 2003-03-13 at 18:35, mel awaisi wrote:
 Hi list
 
 How do i make an alias on my webserver?
 
 i have images on my machine located in /home/me/images/. i would like to be 
 able to access them on /home/httpd/htdocs/
 
 i have tried this:
 Alias /home/me/images/ /home/httpd/htdocs/cctvimages/
 
 i have mkdir cctvimages in /home/http/htdocs/cctvimages
 
 Regards,
 
 Mel
 
 P.S. i have Apache 1.3.27
 
 _
 Chat online in real time with MSN Messenger http://messenger.msn.co.uk


signature.asc
Description: This is a digitally signed message part


cookie authenticated caching proxy

2003-03-12 Thread Abdul-wahid Paterson
Hi,

I am still pretty new to mod_perl and have only really dabbled with a
few small applications that I created. I am now looking to build
something quite specific and was wondering if anyones know of anything
similar to what I want to do so or whether they have any pointers as to
mod_perl's suitability for what I want to do.

The scenario:

I have a large web-site that is largely database driven. Many of the
pages are accessed frequently yet are only modified on average once a
day. The site is written in a variety of technologies including PHP and
Perl.

I wanted to develop a caching proxy that will return a cached page
instead of passing control to one of the PHP scripts or Perl scripts
that normally generate the pages. The web site is mainly accessed
through HTTP GET requests rather than POST requests and the resultant
page will be the same each time if given the same GET string. Can I use
mod_perl's proxy capabilities to cache the generated contents of the the
HTML page made by the PHP script?

One extra requirement is that some of the pages need authentication
which is cookie based. I would need to check the cookie against a
database to see if the caller is authenticated to access the particular
page. Has anyone done/seen anything similar implemented in mod_perl?

Thanks for your help,

Abdul-Wahid




signature.asc
Description: This is a digitally signed message part


Re: cookie authenticated caching proxy

2003-03-12 Thread Abdul-wahid Paterson

  One extra requirement is that some of the pages need authentication
  which is cookie based. I would need to check the cookie against a
  database to see if the caller is authenticated to access the particular
  page. Has anyone done/seen anything similar implemented in mod_perl?
 
 That's very easy to do in mod_perl, but you generally do not want to run 
 mod_perl on the proxy server.  The idea is to keep the proxy server 
 really small and light.  There are various auth modules for apache 
 written in C which you might be able to use.  If none of those suit your 
 needs and you don't want to write a C module, you certainly can put 
 mod_perl on the proxy and write what you want in Perl.  The only 
 drawback to this is the additional memory that will be needed for that 
 server.
 

In the docs you cited, it says:

ProxyPass happens before the authentication phase, so you do not have
to worry about authenticating twice.

How does this work? I need to check the clients cookie against a
database to make sure they have sufficient authorisation to access the
cached page. The authentication mechanisms are going to be different
depending on whether the page has already been cached. That is, if the
page is coming from the dynamic webserver then that webserver is going
to create the content and do the authentication/authorisation however
for subsequent visitors I need the caching reverse proxy to do the
authentication. Could you expand on the steps in the apache process
cycle involved here? I can't quite see how this fits together.

I would have thought that I would have to write my own authentication
module as our authentication system is somewhat custom. I would probably
prototype it in mod_perl then if needed re-write it in C.

Thanks,

Abdul-Wahid



signature.asc
Description: This is a digitally signed message part