>>
>>Спасибо за ответ:)
>>
>>Это c:/squid/libexec/ncsa_auth.exe c:/squid/etc/htpasswd точно есть htpasswd взял от "индейца" под win. К
>>стати не подскажиш где можно почитать каким макаром работает ncsa_auth.exe возможно
>>и мне будет проще написть скрипт, а то уже две недели
>>долбаюсь с этим.
>
>
>ncsa_auth.exe - все это мутно.. забей на него.
>В конфиг ляпаешь такую строку:
>auth_param basic program c:/winnt/system32/cscript.exe //B //h:cscript //nologo C:/Squid/libexec/auth.vbs C:/Squid/etc/auth.conf
>
>auth.vbs:
>
>Set Arg=WScript.Arguments
>Set FSO=CreateObject("Scripting.FileSystemObject")
>FileName=Arg(0)
>I=0
>While I=0
> StringPass=WScript.StdIn.ReadLine
> Reply="ERR"
> Set File=FSO.OpenTextFile(FileName,1)
> Stoped=0
> While File.AtEndOfStream=False And Stoped=0
> StringFile=File.ReadLine
> If MID(StringFile,1,1)<>"#" Then
> If StringFile=StringPass Then
> Reply="OK"
> Stoped=1
> End If
> End If
> Wend
> WScript.StdOut.WriteLine Reply
> File.Close
>Wend
>
>--
>auth.conf:
>
># test
>admin govno
>#e-lina
>e-lina dura
>
>--
>и все в шоколаде... Здравствуйте, недавно поставил SquidNT26 на windows server 2003 sp1. Долго промучился и Вот наконец-то заставил его включаться\выключаться когда я захочу... Проблема в авторизации...Посидев на форуме увидел сообщение выше и захотел сделать аналогично в Delphi (потому как Basic скрипты не знаю) получилось вот что:
program my_auth;
{$APPTYPE CONSOLE}
uses
SysUtils;
var
f,g:text;
stop:integer;
s,Passw,auth:string;
begin
{ TODO -oUser -cConsole Main : Insert code here }
//ParamCount() - ÷èñëî ïàðàìåòðîâ.
//ParamStr(0) - ïîëíîå èìÿ çàïóùåíîé ïðîãðàììû ñ ïóòåì.
//ParamStr(1 - ParamCount()) - ðàñïàðñåíûå ïàðàìåòðû.
while 1=1 do begin
assign(f,ParamStr(ParamCount()));
readln(Passw);
stop:=0;
auth:='ERR';
reset(f);
while not(EOF(f)) and (stop<>1) do begin
readln(f,s);
if not(s[1]='#') then
begin
if s=Passw then
begin
auth:='OK';
stop:=1;
end;
end;
end;
close(f);
write(auth);
end;
end.
Но, зараза, не как не хочет работать (браузер клиента долго что-то открывает(больше 15 мин больше я не ждал)) может, быть вы сможете мне помочь чем-нибудь?
Вот squid.conf:
http_port 8081
icp_port 0
htcp_port 0
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache
cache_mem 80 MB
cache_dir ufs C:/squid/var/cache 128 16 256
maximum_object_size 1024 KB
access_log c:/squid/var/logs/access.log squid
unlinkd_program C:\squid\libexec\unlinkd.exe
authenticate_ttl 0 hour
auth_param basic program C:\\squid\\etc\\conf\\my_auth.exe C:\\squid\\etc\\conf\\psd.conf
auth_param basic children 2
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
acl allowed_hosts src 192.168.3.0/255.255.255.0
acl all src 0.0.0.0/0.0.0.0
# Users
acl allowed_users proxy_auth iliya
acl allowed_users proxy_auth admin
acl allowed_users proxy_auth lena
# zakon4ili delaTb
acl pass proxy_auth REQUIRED
#Pa3peIILaem
http_access allow allowed_users pass
acl PorNo url_regex -i c:/squid/etc/conf/porn.txt
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
acl SSL_ports port 443 563 # SSL -- https??
acl Safe_ports port 443 # https
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access deny all
http_reply_access allow all
icp_access allow all
cache_effective_user Servak
visible_hostname serverint
unique_hostname serverint
NEED HHHEELLPP!!!