Sunday, January 13, 2013

Proxy Authentication - Squid

※ Ref. http://blog.faq-book.com/?p=5334
Ref. http://www.babyface2.com/NetAdmin/27200804squid/

1
2
3
4
5
6
7
[root@localhost ~]# rpm -ql squid | grep ncsa
/usr/lib64/squid/ncsa_auth
/usr/share/man/man8/ncsa_auth.8.gz
 
[root@localhost ~]# rpm -ql httpd | grep htpasswd
/usr/bin/htpasswd
/usr/share/man/man1/htpasswd.1.gz


1
[root@localhost ~]# yum install httpd squid


1
2
3
4
5
6
7
[root@localhost ~]# vim /etc/squid/squid.conf
#修改前
#acl password proxy_auth REQUIRED
 
#修改後
acl password proxy_auth REQUIRED
http_access allow password


auth_param basic children 5   
同時接受認證的連線數
auth_param basic realm Squid proxy-caching web server 
使用者在輸入帳密的地方所顯示的說明文字
auth_param basic credentialsttl 2 hours
使用者連線時的連續時間
auth_param basic casesensitive off
使用特殊權限的帳號登入時會直接取消不給登入

1.4 建立帳密
在使用htpasswd建立帳密時第一次要記得加參數-c,之後就不用加了。「derek」和「faq」為要新增的帳號。

Linux Timezone


1 .[root@li420-243 ~]# tzselect


The following information has been given:

        Taiwan

Therefore TZ='Asia/Taipei' will be used.
Local time is now:      Mon Jan 14 08:13:48 CST 2013.
Universal Time is now:  Mon Jan 14 00:13:48 UTC 2013.
Is the above information OK?
1) Yes
2) No
#? 1

You can make this change permanent for yourself by appending the line
        TZ='Asia/Taipei'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Taipei

1. [root@li420-243 ~]# vim /etc/sysconfig/clock

ZONE="Asia/Taipei"
#ZONE="Etc/UTC"


3. [root@li420-243 ~]# tzdata-update
[root@li420-243 ~]# date
Mon Jan 14 08:16:27 CST 2013