CentOS 6 Proxy server無法架起,麻煩幫忙 - Linux

By Agatha
at 2012-11-13T21:27
at 2012-11-13T21:27
Table of Contents
還是另開一篇回覆好了
本機 debug 的話 我意思是你在 telnet 到 squid 以後裡面打字送 GET
rellik@mercury(09:23:54)[~]$ telnet localhost 3128
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET http://www.google.com/
正常的話應該會有東西出來,底下是我機器上的資訊
HTTP/1.0 302 Moved Temporarily
Location: http://www.google.com.tw/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=da45352ce2b0833d:FF=0:TM=1352813059:LM=1352813059:S=sKV1DIn9a9aq4ZAO; expires=Thu, 13-Nov-2014
13:24:19 GMT; path=/; domain=.google.com
Set-Cookie: NID=65=d9wAgrpxHUUy9AGynifJo2buKTvpCSHEcHmdyzOHXBKPaO6G_YjE-FCofe15k79GjONCCdOt3szSXrBtQO-sVHeTbRbNMCF
vwuEOtlJ_xaDn9jR8AVxli6YToy6aqqo_; expires=Wed, 15-May-2013 13:24:19 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 fo
r more info."
Date: Tue, 13 Nov 2012 13:24:19 GMT
Server: gws
Content-Length: 222
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Cache: MISS from localhost
X-Cache-Lookup: MISS from localhost:3128
Proxy-Connection: close
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com.tw/">here</A>.
</BODY></HTML>
Connection closed by foreign host.
本機 ok 的話請檢查一下 squid.conf acl 設定是不是還需要開啟哪裡
我本機的 squid.conf 在這裡可以參考修改 .. http://fpaste.org/RWOj/
你要拿過去用的話要把你的 lan 端加入 http_access 裡面
※ 引述《yonkX (yonkX)》之銘言:
: Linux 系統是Centos 6.0
: 很久很久以前有架過Proxy,記憶中不需要加入太多設定就能使用.但最近架設完後發現不
: work.爬文爬了二天,找不到錯誤,麻煩大家幫忙.
: 環境:
: 1. 用VM架起.
: 2. 網路類型設定bridge
: 3. IP是用DHCP取得,其它無特別設定什麼網路環境..
: 網路是10.17.15.19, netmask:255.255.255.0
: 目前squid.conf設定狀況:
: 1. 已經用YUM 安裝squid, 指令:yum install squid*
: 2. 加入acl test src 10.17.15.0/24 <==允許其它10.17.15.X IP能使用這個proxy
: 3. 加入http_access allow test <==允許test
: 4. 加入visible hostname www.test.com.tw <==網路爬文看到要加這段
: 5. 其餘設定不改變.
: 另外因為剛剛squid.config設定了第四個visible指令.
: 所以我在/etc/sysconfig/network加入下面設定
: 1. HOSTNAME=www.test.com.tw
: 測試方式.
: 1. 下service network restart跟service squid restart. 確認服務都有起來
: 2. 下netstat -tnl |grep :3128 確認http request port有起來.
: 3. 在實體PC上IE瀏覽器上設定Proxy為10.17.15.19 port設定80或3128都試過.
: (指令http_port 3128設成3128時,我IE就設3128)
: (指令http_port 80 設成80 時,我IE就設80 )
: 4. 在實體PC 或VM下的Centos 都能互相ping的到.
: 5. 開啟網頁.
: 想請問大家是那裡我還沒有設定到嗎?
: 目前我有試過清掉iptables跟把selinux關掉,結果依然無法使用.
: 指令:
: 1. iptables -F 和iptables save
: 2. vim /etc/sysconfig/selinux修改SELINUX=disable
: ~~~~~~~~~~~~~下面是剛剛又再測試出來的資訊,不知道提供了有沒有幫助~~~~~~~~~~~~~~
: 1. 下面有試過測試telent (感覺服務好像怪怪的?)
: [root@www Desktop]# telnet localhost 3128
: Trying 127.0.0.1...
: Connected to localhost.
: Escape character is '^]'. <===不知道為什麼卡在這裡.
: 2. 另外在下restart network ,有出現一些訊息. (不過感覺不影響)
: [root@www Desktop]# service network restart
: Shutting down loopback interface: [ OK ]
: Bringing up loopback interface: [ OK ]
: Bringing up interface eth0: Active connection state: activating
: Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
: state: activated
: Connection activated
: → rellik:請問既然squid跑3128 port , 為何 IE 瀏覽器指定是 80 port 11/13 09:45
: 我看config有二行.
: acl Safe_ports port 80 <---這行用80,
: http_port 3128 <---我看這是listen port, 我曾經也有試著把這個設成80.
: 並且在browser上也是用80,但還是不行.
: 所以我當初在IE上才會也設80.不過預設的3128我有試過
: 也是不行.
: → rellik:1是正常的, GET http://www.google.com/ 看有沒網頁.. 11/13 09:46
: 我使用GET或get都沒有這個指令.先輸入ge在按Tab鍵也是沒有
: (我印像中以前架server時有)
: 想請問架設Proxy前是是還有要設定什麼.Proxy才能被架設起來?
: ※ 編輯: yonkX 來自: 118.233.64.60 (11/13 10:43)
: ※ 編輯: yonkX 來自: 118.233.64.60 (11/13 10:46)
--
本機 debug 的話 我意思是你在 telnet 到 squid 以後裡面打字送 GET
rellik@mercury(09:23:54)[~]$ telnet localhost 3128
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET http://www.google.com/
正常的話應該會有東西出來,底下是我機器上的資訊
HTTP/1.0 302 Moved Temporarily
Location: http://www.google.com.tw/
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Set-Cookie: PREF=ID=da45352ce2b0833d:FF=0:TM=1352813059:LM=1352813059:S=sKV1DIn9a9aq4ZAO; expires=Thu, 13-Nov-2014
13:24:19 GMT; path=/; domain=.google.com
Set-Cookie: NID=65=d9wAgrpxHUUy9AGynifJo2buKTvpCSHEcHmdyzOHXBKPaO6G_YjE-FCofe15k79GjONCCdOt3szSXrBtQO-sVHeTbRbNMCF
vwuEOtlJ_xaDn9jR8AVxli6YToy6aqqo_; expires=Wed, 15-May-2013 13:24:19 GMT; path=/; domain=.google.com; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 fo
r more info."
Date: Tue, 13 Nov 2012 13:24:19 GMT
Server: gws
Content-Length: 222
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Cache: MISS from localhost
X-Cache-Lookup: MISS from localhost:3128
Proxy-Connection: close
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com.tw/">here</A>.
</BODY></HTML>
Connection closed by foreign host.
本機 ok 的話請檢查一下 squid.conf acl 設定是不是還需要開啟哪裡
我本機的 squid.conf 在這裡可以參考修改 .. http://fpaste.org/RWOj/
你要拿過去用的話要把你的 lan 端加入 http_access 裡面
※ 引述《yonkX (yonkX)》之銘言:
: Linux 系統是Centos 6.0
: 很久很久以前有架過Proxy,記憶中不需要加入太多設定就能使用.但最近架設完後發現不
: work.爬文爬了二天,找不到錯誤,麻煩大家幫忙.
: 環境:
: 1. 用VM架起.
: 2. 網路類型設定bridge
: 3. IP是用DHCP取得,其它無特別設定什麼網路環境..
: 網路是10.17.15.19, netmask:255.255.255.0
: 目前squid.conf設定狀況:
: 1. 已經用YUM 安裝squid, 指令:yum install squid*
: 2. 加入acl test src 10.17.15.0/24 <==允許其它10.17.15.X IP能使用這個proxy
: 3. 加入http_access allow test <==允許test
: 4. 加入visible hostname www.test.com.tw <==網路爬文看到要加這段
: 5. 其餘設定不改變.
: 另外因為剛剛squid.config設定了第四個visible指令.
: 所以我在/etc/sysconfig/network加入下面設定
: 1. HOSTNAME=www.test.com.tw
: 測試方式.
: 1. 下service network restart跟service squid restart. 確認服務都有起來
: 2. 下netstat -tnl |grep :3128 確認http request port有起來.
: 3. 在實體PC上IE瀏覽器上設定Proxy為10.17.15.19 port設定80或3128都試過.
: (指令http_port 3128設成3128時,我IE就設3128)
: (指令http_port 80 設成80 時,我IE就設80 )
: 4. 在實體PC 或VM下的Centos 都能互相ping的到.
: 5. 開啟網頁.
: 想請問大家是那裡我還沒有設定到嗎?
: 目前我有試過清掉iptables跟把selinux關掉,結果依然無法使用.
: 指令:
: 1. iptables -F 和iptables save
: 2. vim /etc/sysconfig/selinux修改SELINUX=disable
: ~~~~~~~~~~~~~下面是剛剛又再測試出來的資訊,不知道提供了有沒有幫助~~~~~~~~~~~~~~
: 1. 下面有試過測試telent (感覺服務好像怪怪的?)
: [root@www Desktop]# telnet localhost 3128
: Trying 127.0.0.1...
: Connected to localhost.
: Escape character is '^]'. <===不知道為什麼卡在這裡.
: 2. 另外在下restart network ,有出現一些訊息. (不過感覺不影響)
: [root@www Desktop]# service network restart
: Shutting down loopback interface: [ OK ]
: Bringing up loopback interface: [ OK ]
: Bringing up interface eth0: Active connection state: activating
: Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2
: state: activated
: Connection activated
: → rellik:請問既然squid跑3128 port , 為何 IE 瀏覽器指定是 80 port 11/13 09:45
: 我看config有二行.
: acl Safe_ports port 80 <---這行用80,
: http_port 3128 <---我看這是listen port, 我曾經也有試著把這個設成80.
: 並且在browser上也是用80,但還是不行.
: 所以我當初在IE上才會也設80.不過預設的3128我有試過
: 也是不行.
: → rellik:1是正常的, GET http://www.google.com/ 看有沒網頁.. 11/13 09:46
: 我使用GET或get都沒有這個指令.先輸入ge在按Tab鍵也是沒有
: (我印像中以前架server時有)
: 想請問架設Proxy前是是還有要設定什麼.Proxy才能被架設起來?
: ※ 編輯: yonkX 來自: 118.233.64.60 (11/13 10:43)
: ※ 編輯: yonkX 來自: 118.233.64.60 (11/13 10:46)
--
Tags:
Linux
All Comments

By Andy
at 2012-11-15T20:07
at 2012-11-15T20:07

By Isabella
at 2012-11-17T01:20
at 2012-11-17T01:20

By Dora
at 2012-11-17T14:56
at 2012-11-17T14:56

By Skylar Davis
at 2012-11-19T13:27
at 2012-11-19T13:27

By Leila
at 2012-11-20T07:27
at 2012-11-20T07:27

By Una
at 2012-11-20T20:13
at 2012-11-20T20:13

By Ursula
at 2012-11-25T04:19
at 2012-11-25T04:19

By Daph Bay
at 2012-11-28T10:02
at 2012-11-28T10:02

By Oscar
at 2012-12-02T09:22
at 2012-12-02T09:22

By Carol
at 2012-12-05T09:45
at 2012-12-05T09:45

By Tracy
at 2012-12-08T10:06
at 2012-12-08T10:06

By Kristin
at 2012-12-09T19:48
at 2012-12-09T19:48

By Brianna
at 2012-12-12T22:25
at 2012-12-12T22:25

By Eden
at 2012-12-15T16:29
at 2012-12-15T16:29

By Emma
at 2012-12-16T19:01
at 2012-12-16T19:01

By Bennie
at 2012-12-17T16:11
at 2012-12-17T16:11

By Kelly
at 2012-12-20T10:18
at 2012-12-20T10:18

By Elvira
at 2012-12-24T08:08
at 2012-12-24T08:08

By Candice
at 2012-12-29T02:19
at 2012-12-29T02:19

By Edwina
at 2013-01-01T05:52
at 2013-01-01T05:52

By Tristan Cohan
at 2013-01-06T05:03
at 2013-01-06T05:03

By Daph Bay
at 2013-01-06T06:12
at 2013-01-06T06:12

By Poppy
at 2013-01-10T14:23
at 2013-01-10T14:23

By Daph Bay
at 2013-01-14T17:40
at 2013-01-14T17:40

By Skylar Davis
at 2013-01-18T05:59
at 2013-01-18T05:59

By Heather
at 2013-01-19T17:40
at 2013-01-19T17:40

By Mason
at 2013-01-20T21:22
at 2013-01-20T21:22

By Rae
at 2013-01-21T12:53
at 2013-01-21T12:53
Related Posts
Ubuntu會有雜音/爆音

By Damian
at 2012-11-13T15:32
at 2012-11-13T15:32
Makefile的error list

By John
at 2012-11-13T07:20
at 2012-11-13T07:20
CentOS 6 Proxy server無法架起,麻煩幫忙

By Edward Lewis
at 2012-11-13T00:43
at 2012-11-13T00:43
Madwifi : No such device

By Isla
at 2012-11-13T00:26
at 2012-11-13T00:26
ubuntu跟mint掛載外接硬碟

By Thomas
at 2012-11-13T00:07
at 2012-11-13T00:07