FreeBSD6.0Release+Squid+Socks5服務(wù)器架設(shè)筆記
更新時間:2007年05月22日 00:00:00 作者:
架設(shè)此服務(wù)器,使客戶端通過設(shè)置代理服務(wù)器的squid來瀏覽網(wǎng)頁,通過代理服務(wù)器的socks5來使用QQ、MSN、證券等服務(wù),下面簡單介紹服務(wù)器的架設(shè)過程。
一、安裝FreeBSD6.0Release
從ftp://ftp.freebsd.org/pub/FreeBSD/torrents/6.0-RELEASE下載最新版本FreeBSD6.0Release刻成光盤并選擇最小化安裝(安裝時開通ftp及ssh服務(wù))。
網(wǎng)絡(luò)信息:
網(wǎng)段 -> 192.168.10.0/24
fxp0 -> 內(nèi)網(wǎng)網(wǎng)卡 192.168.10.254
em0 -> 外網(wǎng)網(wǎng)卡 218.104.52.x/32
1、選擇軟件包時選擇最小化安裝。
2、編輯inetd.conf時開通ftp及telnet服務(wù)。
其它的都默認(rèn)安裝,ifconfig_fxp0="inet 192.168.10.254 netmask 255.255.255.0"
inetd_enable="YES"
kern_securelevel_enable="NO"
linux_enable="YES"
nfs_reserved_port_only="YES"
sendmail_enable="NONE"
sshd_enable="YES"
usbd_enable="NO"
2、配置/etc/resolv.conf:
domain jscpu.com
nameserver 218.104.48.106
nameserver 221.6.4.66
3、將光盤放入光驅(qū)中,安裝ports和src
# /usr/sbin/sysinstall
然后選擇Configure-->Distributions,然后利用空格鍵選擇src和ports兩項(xiàng),點(diǎn)install,安裝完成后重啟機(jī)器。
三、配置內(nèi)核
# cd /usr/src/sys/i386/conf
# cp GENERIC funpower
# ee funpower
內(nèi)核根據(jù)服務(wù)器的不同具體配置。
編輯好funpower后開始編譯安裝內(nèi)核:
#/usr/sbin/config funpower
#cd ../compile/funpower
#make cleandepend
#make depend
#make
#make intall
編譯安裝完成后重啟機(jī)器。
四、安裝squid服務(wù)
1、安裝perl(freebsd5.4以后要先安裝perl后再安裝squid)
從http://www.cpan.org/authors/id/R/RG/RGARCIA/下載perl-5.6.2.tar.gz,然后拷貝到/usr/ports/distfiles中,然后:
# cd /usr/ports/lang/perl5
# make install
2、下載并安裝squid
從http://www.squid-cache.org/Versions/v2/2.5/下載squid最新版squid-2.5.STABLE12.tar.gz,通過ftp上傳至服務(wù)器目錄中。
<安裝>
# cd /home/funpower
# tar zxvf squid-2.5.STABLE12.tar.gz
# cd squid-2.5.STABLE7
# ./configure –prefix=/usr/local/squid
# make
# make install
<配置squid配置文件>
# cd /usr/local/squid/etc
# ee squid.conf
配置文件中改如下幾項(xiàng):
http_port 3128 //56行
cache_mem 128 MB //490行
cache_dir ufs /usr/local/squid/cache 1024 16 256 //705行
cache_access_log /dev/null //712
cache_log /dev/null //720
cache_store_log none //730
配置文件中加入以下幾項(xiàng):
acl web src 192.168.10.254 //在1830行左右acl all src 0.0.0.0/0.0.0.0這行前加入
http_access allow web //在1890行左右的http_access deny all這行前加入
在配置文件開頭加入以下四行:
visible_hostname jifangproxy.jscpu.com
cache_mgr admin@jifangproxy.jscpu.com
cache_effective_user squid
cache_effective_group squid
<添加用戶及組及目錄權(quán)限的修改>
# pw groupadd squid
# pw adduser squid –g squid –s /nonexistent
# mkdir /usr/local/squid/cache
# chown –R squid /usr/local/squid/cache
# chgrp –R squid /usr/local/squid/cache
# chown –R squid /usr/local/squid/var/logs
# chgrp –R squid /usr/local/squid/var/logs
<創(chuàng)建初始cache目錄>
# /usr/local/squid/sbin/squid –Z
運(yùn)行測試squid,如果運(yùn)行后沒有error之類的錯誤,用top命令能看到squid進(jìn)程的話,說明安裝成功:
# cd /usr/local/squid/sbin
# ./squid
<建立squid啟動腳本(隨系統(tǒng)一起啟動)>
# ee /etc/rc.local
加入如下一行,然后保存退出:
/usr/local/squid/sbin/squid
重啟服務(wù)器。
五、安裝socks5服務(wù)
1、下載并安裝socks5
從北大天網(wǎng)上下載socks5-v1.0r11.tar.gz,大小為401.093KB(我提供的這個就是),然后通過FTP拷貝到服務(wù)器上,然后:
# cd /home/funpower
# cp socks5-v1.0r11.tar.gz /usr/ports/distfiles
<查看distinfo>
# cd /usr/ports/net/socks5
#more distinfo
顯示如下:
MD5 (socks5-v1.0r11.tar.gz) = 9d6db7d3c425bbafb8c8d67e128eedfe
SIZE (socks5-v1.0r11.tar.gz) = 401093
查看SIZE的大小是否和剛才下載的大小一樣(401.093KB)
<開始安裝>
# cd /usr/ports/net/socks5
# make install
2、配置socks5
# cd /usr/local/etc
# ee socks5.conf
<內(nèi)容如下>
auth - - -
permit - - 192.168. - - -
set SOCKS5_NOIDENT
set SOCKS5_V4SUPPORT
保存退出,重啟服務(wù)器。
然后通過QQ的測試連接測試你服務(wù)器HTTP的3128端口和SOCKS5的1080端口。
作者:老管 email:funpower@gmail.com
參考文章:在Linux上配置和實(shí)現(xiàn)SOCKS v5 在FreeBSD上安裝Squid
一、安裝FreeBSD6.0Release
從ftp://ftp.freebsd.org/pub/FreeBSD/torrents/6.0-RELEASE下載最新版本FreeBSD6.0Release刻成光盤并選擇最小化安裝(安裝時開通ftp及ssh服務(wù))。
網(wǎng)絡(luò)信息:
網(wǎng)段 -> 192.168.10.0/24
fxp0 -> 內(nèi)網(wǎng)網(wǎng)卡 192.168.10.254
em0 -> 外網(wǎng)網(wǎng)卡 218.104.52.x/32
1、選擇軟件包時選擇最小化安裝。
2、編輯inetd.conf時開通ftp及telnet服務(wù)。
其它的都默認(rèn)安裝,ifconfig_fxp0="inet 192.168.10.254 netmask 255.255.255.0"
inetd_enable="YES"
kern_securelevel_enable="NO"
linux_enable="YES"
nfs_reserved_port_only="YES"
sendmail_enable="NONE"
sshd_enable="YES"
usbd_enable="NO"
2、配置/etc/resolv.conf:
domain jscpu.com
nameserver 218.104.48.106
nameserver 221.6.4.66
3、將光盤放入光驅(qū)中,安裝ports和src
# /usr/sbin/sysinstall
然后選擇Configure-->Distributions,然后利用空格鍵選擇src和ports兩項(xiàng),點(diǎn)install,安裝完成后重啟機(jī)器。
三、配置內(nèi)核
# cd /usr/src/sys/i386/conf
# cp GENERIC funpower
# ee funpower
內(nèi)核根據(jù)服務(wù)器的不同具體配置。
編輯好funpower后開始編譯安裝內(nèi)核:
#/usr/sbin/config funpower
#cd ../compile/funpower
#make cleandepend
#make depend
#make
#make intall
編譯安裝完成后重啟機(jī)器。
四、安裝squid服務(wù)
1、安裝perl(freebsd5.4以后要先安裝perl后再安裝squid)
從http://www.cpan.org/authors/id/R/RG/RGARCIA/下載perl-5.6.2.tar.gz,然后拷貝到/usr/ports/distfiles中,然后:
# cd /usr/ports/lang/perl5
# make install
2、下載并安裝squid
從http://www.squid-cache.org/Versions/v2/2.5/下載squid最新版squid-2.5.STABLE12.tar.gz,通過ftp上傳至服務(wù)器目錄中。
<安裝>
# cd /home/funpower
# tar zxvf squid-2.5.STABLE12.tar.gz
# cd squid-2.5.STABLE7
# ./configure –prefix=/usr/local/squid
# make
# make install
<配置squid配置文件>
# cd /usr/local/squid/etc
# ee squid.conf
配置文件中改如下幾項(xiàng):
http_port 3128 //56行
cache_mem 128 MB //490行
cache_dir ufs /usr/local/squid/cache 1024 16 256 //705行
cache_access_log /dev/null //712
cache_log /dev/null //720
cache_store_log none //730
配置文件中加入以下幾項(xiàng):
acl web src 192.168.10.254 //在1830行左右acl all src 0.0.0.0/0.0.0.0這行前加入
http_access allow web //在1890行左右的http_access deny all這行前加入
在配置文件開頭加入以下四行:
visible_hostname jifangproxy.jscpu.com
cache_mgr admin@jifangproxy.jscpu.com
cache_effective_user squid
cache_effective_group squid
<添加用戶及組及目錄權(quán)限的修改>
# pw groupadd squid
# pw adduser squid –g squid –s /nonexistent
# mkdir /usr/local/squid/cache
# chown –R squid /usr/local/squid/cache
# chgrp –R squid /usr/local/squid/cache
# chown –R squid /usr/local/squid/var/logs
# chgrp –R squid /usr/local/squid/var/logs
<創(chuàng)建初始cache目錄>
# /usr/local/squid/sbin/squid –Z
運(yùn)行測試squid,如果運(yùn)行后沒有error之類的錯誤,用top命令能看到squid進(jìn)程的話,說明安裝成功:
# cd /usr/local/squid/sbin
# ./squid
<建立squid啟動腳本(隨系統(tǒng)一起啟動)>
# ee /etc/rc.local
加入如下一行,然后保存退出:
/usr/local/squid/sbin/squid
重啟服務(wù)器。
五、安裝socks5服務(wù)
1、下載并安裝socks5
從北大天網(wǎng)上下載socks5-v1.0r11.tar.gz,大小為401.093KB(我提供的這個就是),然后通過FTP拷貝到服務(wù)器上,然后:
# cd /home/funpower
# cp socks5-v1.0r11.tar.gz /usr/ports/distfiles
<查看distinfo>
# cd /usr/ports/net/socks5
#more distinfo
顯示如下:
MD5 (socks5-v1.0r11.tar.gz) = 9d6db7d3c425bbafb8c8d67e128eedfe
SIZE (socks5-v1.0r11.tar.gz) = 401093
查看SIZE的大小是否和剛才下載的大小一樣(401.093KB)
<開始安裝>
# cd /usr/ports/net/socks5
# make install
2、配置socks5
# cd /usr/local/etc
# ee socks5.conf
<內(nèi)容如下>
auth - - -
permit - - 192.168. - - -
set SOCKS5_NOIDENT
set SOCKS5_V4SUPPORT
保存退出,重啟服務(wù)器。
然后通過QQ的測試連接測試你服務(wù)器HTTP的3128端口和SOCKS5的1080端口。
作者:老管 email:funpower@gmail.com
參考文章:在Linux上配置和實(shí)現(xiàn)SOCKS v5 在FreeBSD上安裝Squid
相關(guān)文章
詳解Linux實(shí)現(xiàn)U盤自動掛載(圖文教程)
這篇文章主要介紹了Linux實(shí)現(xiàn)U盤自動掛載功能,本文圖文并茂給大家介紹的非常詳細(xì),需要的朋友可以參考下2017-11-11ubuntu 安裝linux 下vmVMware tools 步驟及問題解決方法
這篇文章主要介紹了ubuntu 安裝linux 下vmVMware tools 步驟及問題解決方法,本文圖文并茂給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下2019-04-04Ubuntu 14.04 搭建 apt-get 服務(wù)器的教程
這篇文章主要介紹了Ubuntu 14.04 搭建 apt-get 服務(wù)器的教程,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2017-01-01Linux操作系統(tǒng)下關(guān)于用戶和組的配置管理指南
2008-01-01