Squid - прокси сервер Сравнение версий

Различия

Здесь показаны различия между двумя версиями данной страницы.

Ссылка на это сравнение

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
wiki:руководство_по_ubuntu_server:web_сервера:squid_proxy_server [2012/07/08 19:33]
[Установка]
wiki:руководство_по_ubuntu_server:web_сервера:squid_proxy_server [2012/07/08 20:40] (текущий)
[Ссылки]
Строка 19: Строка 19:
 ====Настройка==== ====Настройка====
  
-Squid is configured by editing the directives contained within the /​etc/​squid/​squid.conf ​configuration fileThe following examples illustrate some of the directives which may be modified to affect the behavior of the Squid serverFor more in-depth configuration of Squid, see the References section.+Squid настраивается редактированием директив,​ содержащихся в конфигурационном файле ​/​etc/​squid/​squid.conf. ​Следующие примеры иллюстрируют некоторые директивы,​ которые могут быть изменены для воздействие на поведение сервера ​Squid. ​Для более глубокой настройки ​Squid смотрите раздел [[#​ссылки|Ссылки]].
  
-Prior to editing the configuration fileyou should make a copy of the original file and protect it from writing so you will have the original settings as a referenceand to re-use as necessary. +<note tip>​Преждечем редактировать конфигурационный файлвам стоит сделать копию оригинального файла и защитить ее от перезаписи,​ чтобы у вас всегда оставались оригинальные настройки в качестве справочника и для повторного использования при необходимости.
- +
-Copy the /​etc/​squid/​squid.conf file and protect it from writing with the following commands entered at a terminal prompt:+
  
 +Скопируйте файл /​etc/​squid/​squid.conf и защитите его от записи следующими командами в терминале:​
 +<​code>​
 sudo cp /​etc/​squid/​squid.conf /​etc/​squid/​squid.conf.original sudo cp /​etc/​squid/​squid.conf /​etc/​squid/​squid.conf.original
 sudo chmod a-w /​etc/​squid/​squid.conf.original sudo chmod a-w /​etc/​squid/​squid.conf.original
 +</​code>​
 +</​note>​
  
-    To set your Squid server to listen on TCP port 8888 instead of the default TCP port 3128, change the http_port ​directive as such:+ 1. Для настройки вашего сервера ​Squid на прослушивание порта ​8888 вместо стандартного ​3128, измените директиву **http_port** как показано здесь:​ 
 +<​code>​http_port 8888</​code>​ 
 + 2. Измените директиву **visible_hostname** для того, чтобы присвоить серверу Squid определенное имя хоста (hostname). Это имя необязательно должно быть именем хоста компьютера. В примере оно определено как weezie: 
 +<​code>​visible_hostname weezie</​code>​ 
 + 3. Используя контроль доступа Squid, вы можете настроить,​ чтобы использование интернет сервиса прокси было доступно только пользователям с определенных IP адресов. Например,​ мы проиллюстрируем доступ пользователей только из подсети 192.168.42.0/​24:
  
-    http_port 8888+Добавьте следующее в конец секции **ACL** вашего файла /​etc/​squid/​squid.conf:​ 
 +<​code>​acl fortytwo_network src 192.168.42.0/​24</​code>​ 
 +Затем добавьте следующее в начало секции **http_access** вашего файла /​etc/​squid/​squid.conf:​ 
 +<​code>​http_access allow fortytwo_network</​code>​ 
 + 4. Используя великолепные возможности контроля доступа Squid, вы можете настроить возможность использования интернет сервиса прокси только в обычные рабочие часы. Например,​ мы покажем как настроить доступ сотрудников,​ которые работают с 9:00 до 17:00 с понедельника по пятницу из подсети 10.1.42.0/​24:​
  
-    Change the visible_hostname directive in order to give the Squid server a specific hostnameThis hostname does not necessarily need to be the computer'​s hostnameIn this example it is set to weezie+Добавьте следующее в конец секции **ACL** вашего файла /​etc/​squid/​squid.conf: 
 +<​code>​ 
 +acl biz_network src 10.1.42.0/24 
 +acl biz_hours time M T W T F 9:​00-17:​00 
 +</​code>​ 
 +Затем добавьте следующее в начало секции **http_access** вашего файла /​etc/​squid/​squid.conf:​ 
 +<​code>​http_access allow biz_network biz_hours</​code>​
  
-    visible_hostname weezie +<​note>​После внесения изменений в файл ​/​etc/​squid/​squid.conf ​сохраните его и перегрузите приложение сервера ​squid, ​чтобы изменения вступили в силуследующей командой в терминале
- +<​code>​sudo /​etc/​init.d/​squid restart</​code>​ 
-    Using Squid'​s access control, you may configure use of Internet services proxied by Squid to be available only users with certain Internet Protocol (IP) addresses. For example, we will illustrate access by users of the 192.168.42.0/​24 subnetwork only: +</​note>​
- +
-    Add the following to the bottom of the ACL section of your /​etc/​squid/​squid.conf ​file: +
- +
-    acl fortytwo_network src 192.168.42.0/​24 +
- +
-    Then, add the following to the top of the http_access section of your /etc/squid/squid.conf file: +
- +
-    http_access allow fortytwo_network +
- +
-    Using the excellent access control features of Squidyou may configure use of Internet services proxied by Squid to be available only during normal business hours. For examplewe'll illustrate access by employees of a business which is operating between 9:00AM and 5:00PM, Monday through Friday, and which uses the 10.1.42.0/​42 subnetwork+
- +
-    Add the following to the bottom of the ACL section of your /​etc/​squid/​squid.conf file: +
- +
-    acl biz_network src 10.1.42.0/​24 +
-    acl biz_hours time M T W T F 9:​00-17:​00 +
- +
-    Then, add the following to the top of the http_access section of your /​etc/​squid/​squid.conf file: +
- +
-    http_access allow biz_network biz_hours +
- +
-After making changes to the /​etc/​squid/​squid.conf file, save the file and restart the squid server application to effect the changes using the following command entered at a terminal prompt: +
- +
-sudo /​etc/​init.d/​squid restart+
  
 ====Ссылки=== ====Ссылки===
  
-Squid Website +  -- [[http://​www.squid-cache.org/​|Интернет сайт ​Squid]]. 
- +  -- Страница [[https://​help.ubuntu.com/​community/​Squid|Ubuntu Wiki Squid]].
-Ubuntu Wiki Squid page.+
  
 ---- ----