htaccess files
Is it possible to configure an htaccess file to call a script using apache registry and use it in the PerlAccessHandler. I have written one pretty large perl script in mod-perl using the apache registry to serve out picture gallery pages. I would like to do some validation of my own on a per directory type basis. also I was trying to run this code to do some test and could only get it to work with the #pound signs in from of the files directives. It works like this. #Files * PerlAccessHandler 'sub {return Apache::Constants::FORBIDDEN;}' \ #/Files but I get this error in the log file. I could not get it to work any other way. [Fri May 30 00:22:52 2003] [warn] Apache does not support line-end comments. Consider using quotes around argument: "#/Files" Thanks in advance John Michael
Re: htaccess files
John Michael wrote: Is it possible to configure an htaccess file to call a script using apache registry and use it in the PerlAccessHandler. I have written one pretty large perl script in mod-perl using the apache registry to serve out picture gallery pages. I would like to do some validation of my own on a per directory type basis. Certainly. Both the eagle and the modperl cookbook provide plenty of examples. .htaccess is not any different from a normal httpd.conf for this purpose. I was trying to run this code to do some test and could only get it to work with the #pound signs in from of the files directives. It works like this. #Files * PerlAccessHandler 'sub {return Apache::Constants::FORBIDDEN;}' \ #/Files but I get this error in the log file. I could not get it to work any other way. [Fri May 30 00:22:52 2003] [warn] Apache does not support line-end comments. Consider using quotes around argument: #/Files drop \ from the end of previous line since if you have it Apache reads it as: PerlAccessHandler 'sub {return Apache::Constants::FORBIDDEN;}' #/Files __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
htaccess files and modules
I am having difficulty reading configuration commands from a .htaccess file. I've modified Apache::RefererBlock so that it no longer shows a forbidden error, but rather redirects a default URL. I need this to apply to specific directories, but do not want the hassle of having to modify the configuration for every directory. My goal is to place the configuration information into the .htaccess files within said directories. However, when I do this, I get the following error: /www/test/.htaccess: RefBlockMimeTypes not allowed here I'm not 100% sure how Apache::ModuleConfig works, but I'm guessing that it simply iterates through all the configuration parameters and checks to see if a sub by that name exists in the caller package. If so, it calls that sub. Perhaps this is not the correct module to use. I've read through the Eagle book and have found obscure references to DIR_MERGE and DIR_CREATE, but I don't understand the purposes behind these entirly. I've also read about Apache::CmdParms, but I don't know how that differs from Apache::ModuleConfig. If someone could point me to a doc explaining how to permit custom config params in .htaccess files, I would greatly appreciate it. Thanks, Robert Landrum -- "Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former." --Albert Einstein
RE: htaccess files and modules
Apache::RefererBlock is forbidding all of its configuration directive from being in .htaccess files with this: req_override = 'RSRC_CONF' take a look at Makefile.PL to see it. you will want to change this to something that enables you to call it from .htaccess files, like ACCESS_CONF. Keep in mind, though, that you'll probably have to add DIR_CREATE and DIR_MERGE sections as well so that things will merge properly if you plan on placing them within directory-esque directives. Apache::Dispatch has examples of all these to use as a guide, if it helps... HTH --Geoff -Original Message- From: Robert Landrum To: [EMAIL PROTECTED] Sent: 2/20/01 7:05 PM Subject: htaccess files and modules I am having difficulty reading configuration commands from a .htaccess file. I've modified Apache::RefererBlock so that it no longer shows a forbidden error, but rather redirects a default URL. I need this to apply to specific directories, but do not want the hassle of having to modify the configuration for every directory. My goal is to place the configuration information into the .htaccess files within said directories. However, when I do this, I get the following error: /www/test/.htaccess: RefBlockMimeTypes not allowed here I'm not 100% sure how Apache::ModuleConfig works, but I'm guessing that it simply iterates through all the configuration parameters and checks to see if a sub by that name exists in the caller package. If so, it calls that sub. Perhaps this is not the correct module to use. I've read through the Eagle book and have found obscure references to DIR_MERGE and DIR_CREATE, but I don't understand the purposes behind these entirly. I've also read about Apache::CmdParms, but I don't know how that differs from Apache::ModuleConfig. If someone could point me to a doc explaining how to permit custom config params in .htaccess files, I would greatly appreciate it. Thanks, Robert Landrum -- "Only two things are infinite: The universe, and human stupidity. And I'm not sure about the former." --Albert Einstein
RE: Use of .htaccess files
You will need to use StatINC. mod_perl does not re-read modules that it has already loaded. -Original Message- From: Kevin Beckford [mailto:[EMAIL PROTECTED]] Sent: Friday, November 17, 2000 11:06 PM To: [EMAIL PROTECTED] Subject: Use of .htaccess files Hello all, I'm a newbie to mod_perl, and I have a question. We have mod_perl on our server, but it is a standard out of the box install (Only PerlHandler is enabled.) Now, I'd like to use .htaccess files to test some stuff out (no dev server either) and I don't want to be constantly restarting the server. Am I correct in thinking that since .htaccess files are read by the server every request, I do not need to use techniques like Apache::StatINC to ensure that the libs get read every request. What Perl directives can I not put in .htaccess? I plan on testing this stuff in a directory, and if it works, moving it into the main server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Use of .htaccess files
Hello all, I'm a newbie to mod_perl, and I have a question. We have mod_perl on our server, but it is a standard out of the box install (Only PerlHandler is enabled.) Now, I'd like to use .htaccess files to test some stuff out (no dev server either) and I don't want to be constantly restarting the server. Am I correct in thinking that since .htaccess files are read by the server every request, I do not need to use techniques like Apache::StatINC to ensure that the libs get read every request. What Perl directives can I not put in .htaccess? I plan on testing this stuff in a directory, and if it works, moving it into the main server. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]