On Wed, 2002-01-30 at 18:46, Mark Carey wrote:
> I am currently 'playing' with apache, does anyone here ever get tired of;

<snip>

Try this (if you have php installed)

alter your httpd.conf 

AddType application/x-httpd-php .ida
AddType application/x-httpd-php .exe

and then make {root.exe,default.ida...} look like this.....
<?
$hostsDenyFile = "/var/www/.hta";

$fp = fopen($hostsDenyFile, "r");

# then check to file to make sure this host is not already in it

$contents = fread($fp, filesize($hostsDenyFile));
if(!ereg("$REMOTE_ADDR",$contents))
        {
        echo "Permission Denied";
        $fp = fopen($hostsDenyFile, "a");
        fwrite($fp, "deny from $REMOTE_ADDR \n");
        }
# close the file
fclose($fp);
system( "/bin/cp /var/www/.hta /var/www/.htaccess" );
system( "echo '</Limit>' >> /var/www/.htaccess" );
?>

and /var/www/.hta should initially look like

AuthName "TLD access"
AuthType Basic
<Limit GET POST>
order allow,deny
allow from all

Cheers, Rex




Reply via email to