SoFunction
Updated on 2025-03-09

FreeBSD6.0Release+Squid+Socks5 server setup notes

Set up this server so that the client can set up a proxy serversquidCome to browse the web page, through the proxy serversocks5To use QQ, MSN, securities and other services, the server installation process is briefly introduced below.

1. InstallationFreeBSD6.0Release

Download the latest version from ftp:///pub/FreeBSD/torrents/6.0-RELEASEFreeBSD6.0ReleaseEngrave it into a CD and select the minimized installation (activate the ftp and ssh services during installation).

Network information:
Network segment -> 192.168.10.0/24
fxp0 -> Intranet network card 192.168.10.254
em0 -> External network card 218.104./32

1. Select Minimize installation when selecting a software package.

2. Activate ftp and telnet services during editing.
The others are installed by default.For details, please refer to this, restart the machine after installation.

2. Configure freebsd

1. Configure /etc/:
hostname=""
defaultrouter="218.104."
ifconfig_em0="inet 218.104. netmask 255.255.255.248"
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. Configure /etc/:
domain
nameserver 218.104.48.106
nameserver 221.6.4.66

3. Put the CD into the optical drive and install ports and src
# /usr/sbin/sysinstall
Then select Configure-->Distributions, then use the space bar to select src and ports, click install, and restart the machine after the installation is completed.

3. Configure the kernel

# cd /usr/src/sys/i386/conf
# cp GENERIC funpower
# ee funpower
The kernel is configured according to the specific configuration of the server.
After editing funpower, start compiling and installing the kernel:
#/usr/sbin/config funpower
#cd ../compile/funpower
#make cleandepend
#make depend
#make
#make intall
Restart the machine after the compilation and installation is completed.

4. Install squid service

1. Installationperl(Freebsd5.4, you must first install perl and then install squid)

from/authors/id/R/RG/RGARCIA/Download perl-5.6., and copy it to /usr/ports/distfiles, and then:

# cd /usr/ports/lang/perl5
# make install

2. Download and install squid

from/Versions/v2/2.5/Download the latest version of squid squid-2.5. and upload it to the server directory through ftp.

<Installation>
# cd /home/funpower
# tar zxvf squid-2.5.
# cd squid-2.5.STABLE7
# ./configure –prefix=/usr/local/squid
# make
# make install

<Configure Squid Configuration File>
# cd /usr/local/squid/etc
# ee
The following items are changed in the configuration file:
http_port 3128          //Line 56
cache_mem 128 MB //490 lines
cache_dir ufs /usr/local/squid/cache 1024 16 256      //705 line
cache_access_log /dev/null              //712
cache_log /dev/null                    //720
cache_store_log none                  //730
The following items are added to the configuration file:
acl web src 192.168.10.254
http_access allows web                                                                                                                            �
Add the following four lines at the beginning of the configuration file:
visible_hostname
cache_mgr admin@
cache_effective_user squid
cache_effective_group squid

<Add user, group and directory permission modification>
# 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

<Create initial cache directory>
# /usr/local/squid/sbin/squid –Z
Run the test squid. If there is no error or other error after running, and you can see the squid process with the top command, it means that the installation is successful:
# cd /usr/local/squid/sbin
# ./squid

<Create a squid startup script (start with the system)>
# ee /etc/
Add the following line, and save and exit:
/usr/local/squid/sbin/squid

Restart the server.

V. Installationsocks5Serve

1. Download and installsocks5

Download from Peking Universitysocks5-v1., size is 401.093KB (this is what I provide), then copy it to the server via FTP, and then:

# cd /home/funpower
# cp socks5-v1. /usr/ports/distfiles

<View distinfo>
# cd /usr/ports/net/socks5
#more distinfo
Shown as follows:
MD5 (socks5-v1.) = 9d6db7d3c425bbafb8c8d67e128eedfe
SIZE (socks5-v1.) = 401093
Check whether the size of SIZE is the same as the size you just downloaded (401.093KB)

<Start Installation>
# cd /usr/ports/net/socks5
# make install

2. Configure socks5

# cd /usr/local/etc
# ee
<Content as follows>
auth - - -
permit - - 192.168. - - -
set SOCKS5_NOIDENT
set SOCKS5_V4SUPPORT

Save and exit, restart the server.

Then passQQTest connections for your server HTTP port 3128 and SOCKS5 port 1080.

Author: Lao Guan email: funpower@
Reference article:Configuring and implementing SOCKS v5 on Linux    Install Squid on FreeBSD