Installing Squid proxy server running on Windows

简介: 我在WINDOWS2012上安装SQUID 2.8 UPDATE8. 按以下方法,不加认证,几乎不用更改就生效了。 (DOS窗口的操作都是以管理员身份操作的) http://certcollection.

我在WINDOWS2012上安装SQUID 2.8 UPDATE8.

按以下方法,不加认证,几乎不用更改就生效了。

(DOS窗口的操作都是以管理员身份操作的)

http://certcollection.org/forum/topic/98920-installing-squid-proxy-server-running-on-windows/

There are various software that implement a proxy server, some commercial and some free stuff. In this guide we will see how to implement a proxy server in a Windows environment is fully integrated into Active Directory at no cost.

The product concerned is Squid

http://www.squid-cache.org/

, originally developed for the Linux porting is also available on the Windows platform.

Integration with Active Directory, you can if we install on a machine both Linux and Windows, on Linux configuration for authentication in AD is slightly more complex than in the Windows environment.

Squid can be installed on any machine of our network not necessarily with two network adapters, in which case must do also from gateway.

First we must download Squid from

http://squid.acmeconsulting.it/index.html

site, follow the signs for Squid 2.7 for Windows-> Squid Download Page-> mirror mirror 1/ 2-> and here and get the latest version Stable, at the moment is the 2.7. STABLE8.

Once the download unpack the .zip file in the path c:\squid. Copy these three files in the path c:\squid\etc:

以下必作

* squid.conf.default==> squid.conf         
* mime.conf.default==> mime file        
* cachemgr.conf.default==> cachemgr. conf

Open the squid.conf and making some changes required for the first time:

    * Section OPTIONS FOR AUTHENTICATION
          o Remove the comment on these three rows and we complete the first so that you have:

(以下没作)

auth_param ntlm program c:/squid/libexec/mswin_ntlm_auth .exe                         
auth_param ntlm children
5                        
auth_param ntlm keep_alive on

            These parameters indicate to squid to use authentication NTLM, to use the program and mswin_ntlm_auth. xe to authenticate and use 5 concurrent processes for authentication.
    * ACCESS CONTROLS Section
          o Default Squid grants access from local networks that have private ip addresses of 3 standard classes, if our network does not fall into these we must add it to these 3 lines:

(以下没改)
acl localnet src
10.0.0.0/8# RFC1918 possible internal network                        
acl localnet src
172.16.0.0/12# RFC1918 possible internal network                        
acl localnet src
192.168.0.0/16# RFC1918 possible internal network

          o In the basic configuration Squid grants access only to the following ports:

(以下没改)

acl SSL_ports port 443                         
acl
Safe_ports port 80# http                        
acl
Safe_ports port 21# ftp                        
acl
Safe_ports port 443# https                        
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

         Also here if we have other needs we must add the ports you want to be reached.
          o Immediately after the last we must insert an ACL to verify authentication in Active Directory:

                        acl Authenticatedusing proxy_auth ACL REQUIRED

            and set an access rule that denies all unauthenticated sessions:

                        http_access deny!Authenticated

            
            be inserted immediately after the line:

                        # INSERT YOUR OWN RULE (S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS

    * Section DISK CACHE OPTIONS
          o In this section we have to set the configuration parameters of the disk cache, to do this, remove the comment line:

(这步我作了,参数未改,并且手工在VAR下新建了CACHE目录)

  cache_dir ufs c:/squid/var/cache 10016256

            and edit the parameters according to our needs.
            Taking into account that the three parameters have this meaning:
            100 = maximum size in MB of disk cache
            16 = number of subdirectories (1st level)
            256 = number of subdirectory of 2nd level
            Initially we can leave the default these 3 parameters.

    * LOGFILE OPTIONS Section

          o In this section we define the location and the type of access log file that is generated by Squid.
            The path is defined by the following directive:

                        access_log c:/squid/var/logs/squid access.log

            While the type is defined by the line:

                        logformat squid%0% ts.3tu%6tr% a%Ss/>%< st 03Hs%% rm% ru% a%Sh/%<% mt

            in this case we define a log format called squid and use it in the command access_log.

    * ADMINISTRATIVE PARAMETERS Section
          o In case of failure or to access an unauthorized site Squid displays a page with details including an e-mal address of the system administrator. In this regard we can change this address by using the following directive:

                        cache_mgr <indirizzo_email>

    * ERROR PAGE OPTIONS Section

          o The last parameter to change the language in which you want to display the error pages, to achieve this, we use this directive:

                        error_directory c:/squid/share/errors/English

            where instead of English we insert the name of the directory that reflects the language that we use inside the folder c:/squid/share/and rrors, in the case of English we:

                        error_directory c:/squid/share/errors/Italian

At this point, the basic configuration Squid is finished and we can send him running for the first time. Open a dos directory, find the white flashing c:\squid\sbin and launch the command:

(这步必作)

 squid-z

in order to create the cache directory. If we have not made mistakes in the configuration file you should see something like:

C:\squid\sbin>squid -z 2010/04/2411:33:24|CreatingSwapDirectories

We suggest that the creation of the directory is successful, otherwise we will see something like:

C:\squid\sbin>squid -z 2010/04/2411:41:28| parseConfigFile: squid.conf:4257 unrecognized:'error_directoryxxx'2010/04/2411:41:28|CreatingSwapDirectories

in which case we have committed some syntax error. (In this case was wanted!!).


    NOTE: If we install squid in the default directory c:\squid we should never specify the location of the configuration file, if instead we use a different path is necessaroio change all references in the squid.conf file and use the parameter -f configfile every time I launch the command squid.exe.

Now we can install Squid as a service and start to test it. To do this, launch the command:

(这步必作)

C:\squid\sbin>squid -i 
Registry stored HKLM\SOFTWARE\GNU\Squid\2.6\Squid\ConfigFile value c:/squid/etc/squid.conf
SquidCache version 2.7.STABLE8 for i686-pc-winnt installed successfully asSquidWindowsSystemService.
To run, start it from the ServicesApplet of ControlPanel.Don't forget to edit squid.conf before starting it.

If all is successful you will create the service Squid. If we want to call it differently, we need to add the parameter -n servicename. Once you have created the service we need to start it with the command:

(这步必作)

net start Squid

and we will get output like:

TheSquid service is starting.TheSquid service was started successfully.

We verify that Squid is actually listening via the command:

C:\squid\sbin > netstat-na | findstr:31280.0.0.00.0.0.0:3128 TCP:0 LISTENING

As you can see clearly squid is listening on the default port 3128.

Open Internet Explorer on a client and to configure the proxy settings using the menu Tools > Internet Options-> Connections-> LAN Settings and set the proxy server as shown in Figure:


replacing the address and port of the server with those of our configuration.

Let's go back to the browser and try to reach a site any, if everything works you should see the page without any problem.

To verify the actual use of the proxy, we can use one of several test online type

http://www.lagado.com/proxy-test

or check the file access.log in the folder C:\squid\var\logs.

If you see a window like this:



We ask for your login credentials means that the proxy is working but there is some problem with NTLM authentication. In this case we change the LAN Manager authentication level in value:

Send LM and NTLM useNTLMv2 session security if negotiated

For simplicity we can change the Default Domain Policy so you want to configure all machines in the domain. The setting is located in the key:

ComputerConfiguration->Policies->WindowsSettings->SecuritySettings->LocalPolicies->SecurityOptions->Network security: LAN Manager authentication level

Once change expect the policy is applied or forziamola with the command GPUDATE/force, then try again and if everything went well this time the request for username and password should appear.

With the procedures specified so far according to Squid configuration has finished, access is granted to all for any site and a log is generated for each login.

In next part we will see some parameters for optimization of Squid and how to configure the proxy settings in the browser automatically           

目录
相关文章
|
13天前
|
安全 关系型数据库 MySQL
Windows Server 安装 MySQL 8.0 详细指南
安装 MySQL 需要谨慎,特别注意安全配置和权限管理。根据实际业务需求调整配置,确保数据库的性能和安全。
72 9
|
2月前
|
网络安全 Windows
Windows server 2012R2系统安装远程桌面服务后无法多用户同时登录是什么原因?
【11月更文挑战第15天】本文介绍了在Windows Server 2012 R2中遇到的多用户无法同时登录远程桌面的问题及其解决方法,包括许可模式限制、组策略配置问题、远程桌面服务配置错误以及网络和防火墙问题四个方面的原因分析及对应的解决方案。
106 4
|
2月前
|
监控 安全 网络安全
使用EventLog Analyzer日志分析工具监测 Windows Server 安全威胁
Windows服务器面临多重威胁,包括勒索软件、DoS攻击、内部威胁、恶意软件感染、网络钓鱼、暴力破解、漏洞利用、Web应用攻击及配置错误等。这些威胁严重威胁服务器安全与业务连续性。EventLog Analyzer通过日志管理和威胁分析,有效检测并应对上述威胁,提升服务器安全性,确保服务稳定运行。
|
2月前
|
监控 安全 网络安全
Windows Server管理:配置与管理技巧
Windows Server管理:配置与管理技巧
110 3
|
2月前
|
存储 安全 网络安全
Windows Server 本地安全策略
由于广泛使用及历史上存在的漏洞,Windows服务器成为黑客和恶意行为者的主要攻击目标。这些系统通常存储敏感数据并支持关键服务,因此组织需优先缓解风险,保障业务的完整性和连续性。常见的威胁包括勒索软件、拒绝服务攻击、内部威胁、恶意软件感染等。本地安全策略是Windows操作系统中用于管理计算机本地安全性设置的工具,主要包括用户账户策略、安全选项、安全设置等。实施强大的安全措施,如定期补丁更新、网络分段、入侵检测系统、数据加密等,对于加固Windows服务器至关重要。
|
3月前
|
边缘计算 安全 网络安全
|
3月前
|
数据安全/隐私保护 Windows
安装 Windows Server 2019
安装 Windows Server 2019
|
3月前
|
网络协议 Windows
Windows Server 2019 DHCP服务器搭建
Windows Server 2019 DHCP服务器搭建
|
3月前
|
网络协议 定位技术 Windows
Windows Server 2019 DNS服务器搭建
Windows Server 2019 DNS服务器搭建
117 1
|
3月前
|
安全 网络协议 数据安全/隐私保护
Windows Server 2019 搭建并加入域
Windows Server 2019 搭建并加入域