The .htaccess file within this dir is as follows:
<Files "test.pl">
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
</Files>
I'm using another Perl script called test2.pl to call test.pl using the following code:
$ua = LWP::UserAgent->new;
$request = HTTP::Request->new(GET => "test.pl");
$request->header(referer => '127.0.0.1');
$response = $ua->request($request);
Only problem is I get a 403 Error when trying to access test.pl. As you can see above I even tried adding the appropriate HTTP Referer but no luck.
Some help with configuring Perl/Apache to allow local access to Perl scripts using LWP (but denying all outside access) would be handy?
Thanks.
Nasser
>Firstly, setting the referrer doesn't make a whiff of difference to Apache, it's looking at the address of the socket.
That's fine so how do I get it working? What would I need to put in the .htaccess, or is this doomed as the socket address isn't something that can be verified through apache?
>I'd also change "test.pl" to "http://127.0.0.1/cgi-bin/test.pl"
This was example code, I didn't want to include the real code which has the correct syntax.
Nasser
Also, check the error_log file, it should tell you why the 403 was there. It might be that you have to set some options in httpd.conf to allow yourself to use those .htaccess comands.
Sean