Ну вот руки и добрались до логов squid :)
SARG: Генератор отчетов на основании анализа лог-файла прокси сервера Squid. Отчеты позволяют выяснить какой пользователь в какое время обращался к какому сайту.Суммарный отчет может оказать большую помощь в тарификации работающих через Squid пользователей, так как включает в себя суммарный трафик и число коннектов для каждого пользователя за определенный период времени.
http://sarg.sourceforge.net/
ОС: Fedora Core 5
ПО: Squid-2.5.STABLE12-5.1, sarg-2.2.1-1.fc3.rf (http://dag.wieers.com/rpm/packages/sarg/)
Конфиг расположен тут: /etc/sarg/sarg.conf
а вот что у меня в нем получилось в итоге:
ConfigFile.........= /etc/sarg/sarg.conf
AccessLog..........= /var/log/squid/access.log
BgColor............= #ffffff
TxColor............= #000000
TxBgColor..........= lavender
TiColor............= darkblue
Height.............= 45
FontFace...........= Verdana,Tahoma,Arial
HeaderColor........= darkblue
HeaderBgColor......= #dddddd
FontSize...........= 9px
TempDir............= /tmp
OutputDir..........= /var/www/sarg/ONE-SHOT
Ip2Name............= yes
TopuserSortField.........= BYTES
UserSortField.........= BYTES
TopuserSortOrder.........= reverse
UserSortOrder.........= reverse
DateFormat.........= e
ExcludeUsers.......=
PerUserLimitFile...=
PerUserLimit.......=
UserIp.............= yes
MaxElapsed.........= 28800000
четверг, 15 мая 2008 г.
среда, 14 мая 2008 г.
Не загружается explorer.exe и iexplore.exe
Как это обычно бывает, в один хороший день вылезла такая проблема :)
Проблема: Не загружается explorer.exe и iexplore.exe, после проверки антивирусом.
ОС: Windows XP SP2 Professional
Решение: необходимо исправить в реестре
1. Запускаем regedit.exe
2. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\explorer.exe] убираем ключ про Debug.
Проблема: Не загружается explorer.exe и iexplore.exe, после проверки антивирусом.
ОС: Windows XP SP2 Professional
Решение: необходимо исправить в реестре
1. Запускаем regedit.exe
2. [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\explorer.exe] убираем ключ про Debug.
четверг, 8 мая 2008 г.
Проблемы с активацией Windows XP
Сегодня была презабавная проблема :)
Проблема: После включения компьютера ОС предлагает пройти активацию для продолжения работы. После активации работает до первой перезагрузки, потом снова просит произвести активацию.
ОС: Windows XP Professional SP2
Решение: номер KB в базе Microsoft забыл, но решение скопировал
Step 1: Start the computer in safe mode
1. Start the computer.
2. After the computer runs the Power On Self Test (POST), press F8 repeatedly to open the Windows Advanced Options menu.
3. On the Windows Advanced Options menu, use the arrow keys to select Safe Mode, and then press ENTER.
4. Use the arrow keys to select the Windows operating system that you want to start, and then press ENTER.
5. When the computer is running in safe mode, log on by using an account that has administrator rights and permissions. Then, click Yes in the message that states that Windows is running in safe mode.
Step 2: Start Registry Editor
Click Start, click Run, type regedit, and then click OK.
Step 3: Remove the RESETS registry subkey
1. In Registry Editor, expand My Computer, and then expand HKEY_LOCAL_MACHINE.
2. Expand SOFTWARE, and then expand Microsoft.
3. Expand Windows NT, and then expand CurrentVersion.
4. Expand Winlogon, and then expand Notify.
5. Under Notify, right-click RESETS, and then click Delete.
6. Click Yes to confirm the removal of the RESETS subkey.
Note Do not exit Registry Editor. You must use Registry Editor in "Step 4: Modify the registry to deactivate Windows."
Step 4: Modify the registry to deactivate Windows
1. In Registry Editor, expand My Computer, and then expand HKEY_LOCAL_MACHINE.
2. Expand SOFTWARE, and then expand Microsoft.
3. Expand Windows NT, and then expand CurrentVersion.
4. Under CurrentVersion, click WPAEvents.
5. In the right pane (topic area) of Registry Editor, right-click OOBETimer, and then click Modify.
6. Click to put the pointer in the Value data box. Then, modify any character that appears in the Value data box.
7. Click OK.
Note This step deactivates Windows.
8. Exit Registry Editor.
Step 5: Rename the corrupted Windows activation file
1. Click Start, click Run, type cmd, and then click OK.
2. At the command prompt, type the following command, and then press ENTER:
ren %windir%\system32\WPA.dbl wpa.old
This command renames the WPA.dbl file to WPA.old.
Step 6: Determine the CD or DVD drive letter
1. Insert the Windows CD.
2. Click Start, and then click My Computer.
3. Note the CD drive letter or the DVD drive letter that appears under Drives with Removable Storage. You have to use this drive letter in the next step.
Step 7: Replace the corrupted Windows activation file
1. Click Start, click Run, type cmd, and then click OK.
2. At the command prompt, type the following command, and then press ENTER:
expand drive :\i386\wpa.db_ %windir%\system32\wpa.dbl
In this command, replace drive with the letter of the drive that contains the Windows CD.
For example, if the Windows CD is located in drive D, the command appears as follows:
expand d:\i386\wpa.db_ %windir%\system32\wpa.dbl
This command extracts a copy of the Wpa.dbl file from the Windows CD. Then, it puts this file in the System32 folder of the Windows installation.
3. Examine the output that appears at the command prompt. If the command runs successfully, information that resembles the following appears:
Microsoft (R) File Expansion Utility Version 5.1.2600.0 Copyright (C) Microsoft Corp 1990-1999. All rights reserved. Expanding d:\i386\wpa.db_ to c:\windows\system32\wpa.dbl. d:\i386\wpa.db_: 2222 bytes expanded to 2126 bytes, -5% increase.
4. Type exit, and then press ENTER to exit the command prompt.
Step 8: Remove the files that are associated with the script
1. Click Start, and then click Search.
2. Under What do you want to search for, click All files and folders.
3. In the All or part of the file name box, type the following, and then click Search:
reset5.exe; reset5.dll; reset5.dat; reset5.dt*; srvany.exe
This action performs a search for all the following files:
• Reset5.exe
• Reset5.dll
• Reset5.dat
• Reset5.dt*
• Srvany.exe
Note If you use a different search tool such as Windows Desktop Search, use this tool to search for each of these individual files.
4. In the results pane of the Search Results dialog box, right-click each file, and then click Delete.
5. Click Yes to confirm the removal of the file.
6. When you have finished removing these files, exit the Search Results dialog box.
7. Restart the computer and let Windows restart in normal mode.
Step 9: Reactivate Windows
1. Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Activate Windows.
2. If the Windows Product Activation Wizard prompts you to activate Windows, follow the instructions in the wizard to activate Windows.
3. Restart the computer, and then repeat step 1 of "Step 9: Reactivate Windows" to start the Windows Product Activation Wizard again. You take this step to verify that the wizard does not prompt you to activate Windows again.
4. If the Windows Product Activation Wizard displays a "Windows is already activated" message, click OK to exit the wizard.
Проблема: После включения компьютера ОС предлагает пройти активацию для продолжения работы. После активации работает до первой перезагрузки, потом снова просит произвести активацию.
ОС: Windows XP Professional SP2
Решение: номер KB в базе Microsoft забыл, но решение скопировал
Step 1: Start the computer in safe mode
1. Start the computer.
2. After the computer runs the Power On Self Test (POST), press F8 repeatedly to open the Windows Advanced Options menu.
3. On the Windows Advanced Options menu, use the arrow keys to select Safe Mode, and then press ENTER.
4. Use the arrow keys to select the Windows operating system that you want to start, and then press ENTER.
5. When the computer is running in safe mode, log on by using an account that has administrator rights and permissions. Then, click Yes in the message that states that Windows is running in safe mode.
Step 2: Start Registry Editor
Click Start, click Run, type regedit, and then click OK.
Step 3: Remove the RESETS registry subkey
1. In Registry Editor, expand My Computer, and then expand HKEY_LOCAL_MACHINE.
2. Expand SOFTWARE, and then expand Microsoft.
3. Expand Windows NT, and then expand CurrentVersion.
4. Expand Winlogon, and then expand Notify.
5. Under Notify, right-click RESETS, and then click Delete.
6. Click Yes to confirm the removal of the RESETS subkey.
Note Do not exit Registry Editor. You must use Registry Editor in "Step 4: Modify the registry to deactivate Windows."
Step 4: Modify the registry to deactivate Windows
1. In Registry Editor, expand My Computer, and then expand HKEY_LOCAL_MACHINE.
2. Expand SOFTWARE, and then expand Microsoft.
3. Expand Windows NT, and then expand CurrentVersion.
4. Under CurrentVersion, click WPAEvents.
5. In the right pane (topic area) of Registry Editor, right-click OOBETimer, and then click Modify.
6. Click to put the pointer in the Value data box. Then, modify any character that appears in the Value data box.
7. Click OK.
Note This step deactivates Windows.
8. Exit Registry Editor.
Step 5: Rename the corrupted Windows activation file
1. Click Start, click Run, type cmd, and then click OK.
2. At the command prompt, type the following command, and then press ENTER:
ren %windir%\system32\WPA.dbl wpa.old
This command renames the WPA.dbl file to WPA.old.
Step 6: Determine the CD or DVD drive letter
1. Insert the Windows CD.
2. Click Start, and then click My Computer.
3. Note the CD drive letter or the DVD drive letter that appears under Drives with Removable Storage. You have to use this drive letter in the next step.
Step 7: Replace the corrupted Windows activation file
1. Click Start, click Run, type cmd, and then click OK.
2. At the command prompt, type the following command, and then press ENTER:
expand drive :\i386\wpa.db_ %windir%\system32\wpa.dbl
In this command, replace drive with the letter of the drive that contains the Windows CD.
For example, if the Windows CD is located in drive D, the command appears as follows:
expand d:\i386\wpa.db_ %windir%\system32\wpa.dbl
This command extracts a copy of the Wpa.dbl file from the Windows CD. Then, it puts this file in the System32 folder of the Windows installation.
3. Examine the output that appears at the command prompt. If the command runs successfully, information that resembles the following appears:
Microsoft (R) File Expansion Utility Version 5.1.2600.0 Copyright (C) Microsoft Corp 1990-1999. All rights reserved. Expanding d:\i386\wpa.db_ to c:\windows\system32\wpa.dbl. d:\i386\wpa.db_: 2222 bytes expanded to 2126 bytes, -5% increase.
4. Type exit, and then press ENTER to exit the command prompt.
Step 8: Remove the files that are associated with the script
1. Click Start, and then click Search.
2. Under What do you want to search for, click All files and folders.
3. In the All or part of the file name box, type the following, and then click Search:
reset5.exe; reset5.dll; reset5.dat; reset5.dt*; srvany.exe
This action performs a search for all the following files:
• Reset5.exe
• Reset5.dll
• Reset5.dat
• Reset5.dt*
• Srvany.exe
Note If you use a different search tool such as Windows Desktop Search, use this tool to search for each of these individual files.
4. In the results pane of the Search Results dialog box, right-click each file, and then click Delete.
5. Click Yes to confirm the removal of the file.
6. When you have finished removing these files, exit the Search Results dialog box.
7. Restart the computer and let Windows restart in normal mode.
Step 9: Reactivate Windows
1. Click Start, point to All Programs, point to Accessories, point to System Tools, and then click Activate Windows.
2. If the Windows Product Activation Wizard prompts you to activate Windows, follow the instructions in the wizard to activate Windows.
3. Restart the computer, and then repeat step 1 of "Step 9: Reactivate Windows" to start the Windows Product Activation Wizard again. You take this step to verify that the wizard does not prompt you to activate Windows again.
4. If the Windows Product Activation Wizard displays a "Windows is already activated" message, click OK to exit the wizard.
вторник, 6 мая 2008 г.
Проблемы с обновлением Symantec Endpoint Protection
Проблема: сервер управления Symantec Endpoint Protection перестал раздавать обновления клиентам. В последствие выяснилось, что обновления он видел, но установить не мог. В процессе обновления появлялись следующие записи в логах: "LU1825: This update was
corrupted so LiveUpdate was unable to process it..."
ОС: Windows Server 2003 EE
ПО: Symantec Endpoint Protection
Решение: искал долго и почти отчаявшись наткнулся на вот эту утилиту: ftp://ftp.symantec.com/public/english_us_canada/linked_files/nav/SymKBFix.EXE
После запуска этой утилиты от Symantec и перезагрузки сервера... обновления радостно установились :)
corrupted so LiveUpdate was unable to process it..."
ОС: Windows Server 2003 EE
ПО: Symantec Endpoint Protection
Решение: искал долго и почти отчаявшись наткнулся на вот эту утилиту: ftp://ftp.symantec.com/public/english_us_canada/linked_files/nav/SymKBFix.EXE
После запуска этой утилиты от Symantec и перезагрузки сервера... обновления радостно установились :)
суббота, 26 апреля 2008 г.
Postfix: transport_maps
Postfix: transport_maps
Задача: Необходимо организовать работу двух почтовых серверов в разных офисах. Для них зарезервировано одно доменное имя. Запись MX указывает на srv1.
На srv1
в main.cf вносим изминения:
transport_maps = hash:/etc/postfix/transport_maps
создаем файл transport_maps
вносим туда:
user_srv2_1@company.ru smtp:[srv2]
user_srv2_2@company.ru smtp:[srv2]
...
user_srv2_100@company.ru smtp:[srv2]
# postmap /etc/postfix/transport_maps
# service postfix reload
суббота, 19 апреля 2008 г.
Почтовый сервер Postfix на базе Fedora Core 8
Почтовый сервер Postfix на базе Fedora Core 8
OS: Fedora Core 8Почтовый сервер (MTA): Postfix
Доставщик: dovecot ( с поддержкой IMAP и POP3)
Web-интерфейс: Squirrelmail
SMTP-авторизация: cyrus-sasl
Устанавливаем Postfix
yum install postfix
Настроим алиасы, чтобы вся почта для пользователя root пересылалась нашему пользователю admin
для этого в /etc/aliaces в самый конец добавим строку
root admin
В конфиге /etc/postfix/mail.cf вносим необходимые изменения:
myhostname = srvmail.company.ru
mydomain = company.ru
inet_interfaces = all
mynetworks = 192.168.254.0/28, 192.168.42.0/28, 127.0.0.0/8
Теперь нужно перезапустить сервис:
service postfix restart
Все, остальное можно оставить по умолчанию.
Для проверки отправим себе письмо:
[root@post sysconfig]# telnet 192.168.254.48 25
Trying 192.168.254.48...
Connected to srvmail.company.ru (192.168.254.48).
Escape character is '^]'.
220 srvmail.company.ru ESMTP Postfix
HELO srvmail.company.ru
250 srvmail.company.ru
mail from:fromer@from.info
*(здесь все равно что писать, если в mail.cf не включена проверка отправителя)
250 Ok
rcpt to:root@srvmail.company.ru
250 Ok
data
354 End data with
!!!Test!!!
.
250 Ok: queued as BC1332BC5A
quit
221 Bye
Connection closed by foreign host.
Все нормально, письмо отправилось, теперь посмотрим, пришло ли оно.
Т.к. postfix хранит все почту в /var/mail/имя_пользователя, а в нашем случае письмо писалось для root, но в соответствии с настроенными алиасами было перенаправлено пользователю admin, там и смотрим:
[root@post sysconfig]# cat /var/mail/admin
Видим, что письмо доставлено и все в порядке..
Теперь сделаем, чтобы postfix запускался при старте системы:
# /sbin/chkconfig --level 35 postfix on
Устанавливаем Dovecot.
Dovecot – IMAP-сервер, рассчитанный на максимальную безопасность и надежность, способный обслуживать клиентов по протоколам imap, imaps, pop3, pop3s.
yum install dovecot
для того чтобы он заработал, достаточно в /etc/dovecot.conf найти секцию
# Protocols we want to be serving:
# imap imaps pop3 pop3s
и здесь раскомментировать и поправить строку protocols таким образом.
protocols = imap imap pop3
Перезапускаем postfix и dovecot.
И сделаем, чтобы dovecot запускался при старте системы:
# /sbin/chkconfig --level 35 dovecot on
Все, теперь пользователи могут получать почту с нашего сервера.
Настройка Postfix для поддержки аутенификации SMTP.
Постфикс может быть сконфигурирован на релей почты от пользователей, находящихся в "чужих" сетях, у которых валидны логин и пароль.
Добавим следующие строки в файл /etc/postfix/main.cf
# Эта строка информирует постфикс о том, что необходимо
# использовать SMTP AUTH когда пользователь находится
# не в 'mynetwork' и пытается отправить почту на "чужие" домены
smtpd_sasl_auth_enable = yes
# Эта опция выключает выключает "anonymous style" для SMTP AUTH.
# Без этой опции любой может использовать postfix как "open relay"
smtpd_sasl_security_options = noanonymous
# Эта опция устанавливает ограничения для клиентов,
# пытающихся релееить почту через ваш почтовый сервер
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
Поправим файл /etc/sysconfig/saslauthd
# эта опция указывает на то, что демону saslauthd необходимо
# использовать механизм PAM (подключаемые модули аутентификации)
# для проверки каждого имени и пароля
MECH=pam
Теперь удостоверимся что демон saslauthd запускается при старте системы, выполнив от рута команду:
# /sbin/chkconfig --level 35 saslauthd on
Теперь запускаем saslauthd и postfix:
# service saslauthd restart
# service postfix restart
Постфикс стартовал и теперь он разрешает релееить почту аутентифицированным клиентам.
Устанавливаем Web-интерфейс для работы с почтой
SquirrelMail – вэб интерфейс для работы с электронной почтой.
yum install squirrelmail
Посмотрим куда он установился:
[root@srvmail etc]# whereis squirrelmail
squirrelmail: /etc/squirrelmail /usr/share/squirrelmail
/etc/squirrelmail – содержит файлы конфигурации.
/usr/share/squirrelmail – это основная директория программы
запустим файл конфигурации программы /usr/share/squirrelmail/config/conf.pl
Заполняем свои данные и незабываем указать в качестве imap севера dovecot.
Сохраняем изменения и выходим. Теперь можно попробовать постучаться на вэб интерфейс.
http://192.168.254.48/webmail/
Теперь сделаем, чтобы httpd запускался при старте системы:
# /sbin/chkconfig --level 35 httpd on
Теперь пользователи могут прямо из интернета работать со своими почтовыми ящиками.
Средства борьбы со спамом (spamassassin, postgrey)
SpamAssassin - это расширяемый почтовый фильтр, используемый для идентификации спама. Полученные почтовые сообщения могут быть выборочно помечены как спам для фильтрации в будущем аналогичных сообщенний.
Postgrey – сервер политики Postfix, который осуществляет greylisting. Когда запрос о поставке почты получен, Postfix проверяет связку CLIENT_IP / ОТПРАВИТЕЛЬ / ПОЛУЧАТЕЛЬ. Если это - первый раз, когда эта связка замечена, или если она замечена меньше чем 10 минут назад, то почта отклоняется с временной ошибкой. Правильный сервер через время повторит письмо.
Spamassassin
Т.к. в нашей системе уже установлен Amavis, spamassassin, входит в список его зависимостей и уже был установлен yum-ом. Для того чтобы он заработал, достаточно закомментировать в файле /etc/amavisd.conf строку:
# @bypass_spam_checks_maps = (1); # uncomment to DISABLE anti-spam code
И запустить саму службу: service spamassassin restart
Postgrey
yum install postgrey
В файле /etc/init.d/postgrey исправим секцию OPTIONS
OPTIONS="--inet=127.0.0.1:10023 --delay=1000 --retry-window=22h --greylist-text='Greylisted for 1000 seconds, see http://b-formula.ru/greylisted/index.html'"
*--greylist-text='Greylisted for 1000 seconds, see http://b-formula.ru/greylisted/index.html' дает возможность выводить свою html страницу с ошибкой, вместо стандартной.
Теперь нужно перезапустить сервисы:
service greylist restart
service postfix restart
И сделаем, чтобы обе сервиса запускались при старте системы:
# /sbin/chkconfig --level 35 spamassassin on
# /sbin/chkconfig --level 35 postgrey on
Пример функций /etc/postfix/mail.cf
# Размер почтового ящика устанавливаем 100Мб
mailbox_size_limit = 104857600
# Размер письма 15M
message_size_limit = 25360000
# Эта строка информирует Postfix о том, что необходимо использовать SMTP AUTH когда
# пользователь находится не в 'mynetwork' и пытается отправить почту на "чужие" домены
smtpd_sasl_auth_enable = yes
# Эта опция выключает "anonymous style" для SMTP AUTH.
# Без этой опции любой может использовать postfix как "open relay"
smtpd_sasl_security_options = noanonymous
# Требовать от клиента в начале smtp-сессии слать команду HELO/EHLO.
# До сих пор многие программы для спам рассылок не включают в себя набор этих команд.
smtpd_require_helo = yes
# Запрещаем использовать команду vrfy для определения пользователя на сервере.
disable_vrfy_command = yes
# Использовать бузу данных открытых релеев relays.ordb.org
maps_rbl_domains = relays.ordb.org
# The broken_sasl_auth_clients parameter controls interoperability with SMTP clients
# that do not recognize that Postfix supports RFC 2554 (AUTH command). Examples of
# such clients are Microsoft Outlook Express version 4 and Microsoft Exchange version 5.0.
#При использовании нестандартных клиентов, имеющих свои методы аутентификации
broken_sasl_auth_clients = yes
# Не отключать поиск доменного имени у IP адреса.
disable_dns_lookups = no
# Проверка клиента при ХЕЛО:
# клиентов в "своей" сети не проверяем
# прошедших аутентификацию не проверяем
# остальных проверяем на неправильное доменное имя
# остальных проверяем на неполное доменное имя
# остальных проверяем на наличие A и MX записей
smtpd_helo_restrictions =
#vip senders check_sender_access hash:$config_directory/vipsenders
permit_mynetworks
permit_sasl_authenticated
reject_invalid_hostname
reject_non_fqdn_hostname
reject_unknown_hostname
# ??? Эта опция устанавливает ограничения для клиентов, пытающихся релееить почту через ваш почтовый сервер
# пропускаем клиентов, описанных в файле "access_vip_sender"
# пропускаем клиентов "своей" сети
# пропускаем прошедших аутентификацию
# пропускаем если получатель в нашем (домене)??
# отклоняем клиентов с неверными имененм хоста
# отклоняем клиентов с неизвестным доменом отправителя
# отклоняем клиентов с неизвестным доменом получателя
# отклоняем клиентов если получатель не в нашем (домене)??
# отклоняем клиентов если он есть в списке relays.ordb.org
# грейлистинг
# отклоняем клиентов если он есть в списке sbl.spamhaus.org
# отклоняем клиентов если он есть в списке sbl.spamhaus.org
smtpd_recipient_restrictions =
#Включение постгрэя// обязательно перед permit_auth_destination
check_policy_service inet:127.0.0.1:10023
permit_auth_destination
permit_mynetworks
permit_sasl_authenticated
reject_invalid_hostname
reject_unknown_sender_domain
reject_unknown_recipient_domain
reject_unauth_destination
reject_rbl_client relays.ordb.org
reject_rbl_client sbl.spamhaus.org
Подписаться на:
Сообщения (Atom)