架设此服务器,使客户端通过设置代理服务器的squid来浏览网页,通过代理服务器的socks5来使用QQ、MSN、证券等服务,下面简单介绍服务器的架设过程。
一、安装FreeBSD6.0Release
从ftp://ftp.freebsd.org/pub/FreeBSD/torrents/6.0-RELEASE下载最新版本FreeBSD6.0Release刻成光盘并选择最小化安装(安装时开通ftp及ssh服务)。
网络信息:
网段->192.168.10.0/24
fxp0->内网网卡192.168.10.254
em0->外网网卡218.104.52.x/32
1、选择软件包时选择最小化安装。
2、编辑inetd.conf时开通ftp及telnet服务。
其它的都默认安装,具体可参考这,安装完后重启机器。
二、配置freebsd
1、配置/etc/rc.conf:
hostname=“jifangproxy.jscpu.com”
defaultrouter=“218.104.52.x”
ifconfig_em0=“inet218.104.52.xnetmask255.255.255.248”
ifconfig_fxp0=“inet192.168.10.254netmask255.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:
domainjscpu.com
nameserver218.104.48.106
nameserver221.6.4.66
3、将光盘放入光驱中,安装ports和src
#/usr/sbin/sysinstall
然后选择Configure–>Distributions,然后利用空格键选择src和ports两项,点install,安装完成后重启机器。
三、配置内核
#cd/usr/src/sys/i386/conf
#cpGENERICfunpower
#eefunpower
内核根据服务器的不同具体配置。
编辑好funpower后开始编译安装内核:
#/usr/sbin/configfunpower
#cd…/compile/funpower
#makecleandepend
#makedepend
#make
#makeintall
编译安装完成后重启机器。
四、安装squid服务
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
#makeinstall
2、下载并安装squid
从http://www.squid-cache.org/Versions/v2/2.5/下载squid最新版squid-2.5.STABLE12.tar.gz,通过ftp上传至服务器目录中。
<安装>
#cd/home/funpower
#tarzxvfsquid-2.5.STABLE12.tar.gz
#cdsquid-2.5.STABLE7
#./configure–prefix=/usr/local/squid
#make
#makeinstall
<配置squid配置文件>
#cd/usr/local/squid/etc
#eesquid.conf
配置文件中改如下几项:
http_port3128//56行
cache_mem128MB//490行
cache_dirufs/usr/local/squid/cache102416256//705行
cache_access_log/dev/null//712
cache_log/dev/null//720
cache_store流量交易_lognone//730
配置文件中加入以下几项:
aclwebsrc192.168.10.254//在1830行左右aclallsrc0.0.0.0/0.0.0.0这行前加入