Freebsd6.0release + squid + S5 Server SETUP notes

Source: Internet
Author: User
Tags install perl nameserver

Set up this server so that the client can view the web page by setting the squid of the proxy server, and use QQ, MSN, securities, and other services through SOCKS5 of the proxy server. The following describes the server setup process.

1. Install freebsd6.0release

Slave (activate FTP and SSH services during installation ).

Network Information:
Network Segment-> 192.168.10.0/24
Fxp0-> Intranet Nic 192.168.10.254
Em0-> Internet Nic 218.104.52.x/32

1. Minimize installation when selecting a software package.

2. Enable FTP and telnet when editing inetd. conf.
Others are installed by default. For details, refer to this. Restart the machine after installation.

Ii. Configure FreeBSD

1. Configure/etc/rc. conf:
Hostname = "jifangproxy.jscpu.com"
Defaultrouter = "218.104.52.x"
Ifconfig_em0 = "Inet 218.104.52.x netmask 255.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/resolv. conf:
Domain jscpu.com
Nameserver 218.104.48.106
Nameserver 221.6.4.66

3. Add the CD to the optical drive and install ports and SRC.
#/Usr/sbin/sysinstall
Select configure --> distributions, use the space key to select SRC and ports, click Install, and then restart the machine.

3. Configure the kernel

# Cd/usr/src/sys/i386/Conf
# Cp generic funpower
# Ee funpower
The kernel depends on the specific configuration of the server.
After editing funpower, compile and install the kernel:
#/Usr/sbin/config funpower
# CD ../compile/funpower
# Make cleandepend
# Make depend
# Make
# Make intall
After compilation and installation are complete, restart the machine.

4. Install the squid service

1. Install Perl (install Perl before installing squid after freebsd5.4)

Slave:

# Cd/usr/ports/lang/perl5
# Make install

2. Download and install squid

Slave.

<Installation>
# Cd/home/funpower
# Tar zxvf squid-2.5.STABLE12.tar.gz
# Cd squid-2.5.STABLE7
#./Configure-Prefix =/usr/local/squid
# Make
# Make install

<Configure the squid Configuration File>
# Cd/usr/local/squid/etc
# Ee squid. conf
Modify the following items in the configuration file:
Http_port 3128 // 56 rows
Cache_mem 128 MB /// 490 rows
Cache_dir ufs/usr/local/squid/cache 1024 16 256 // 705 rows
Cache_access_log/dev/null // 712
Cache_log/dev/null // 720
Cache_store_log NONE // 730
Add the following items to the configuration file:
ACL web SRC 192.168.10.254 // Add the ACL all SRC 0.0.0.0/0.0.0.0/0.0.0.0 before the first line of ACL
Http_access allow Web // Add http_access deny all in the left and right lines of 1890
Add the following four lines at the beginning of the configuration file:
Visible_hostname jifangproxy.jscpu.com
Cache_mgr admin@jifangproxy.jscpu.com
Cache_inclutive_user squid
Cache_paitive_group squid

<Modify permissions for adding users and groups and directories>
# 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 an initial cache directory>
#/Usr/local/squid/sbin/squid-z
Run the test squid. If there are no errors such as errors after running, use the top command to view the squid process, it indicates that the installation is successful:
# Cd/usr/local/squid/sbin
#./Squid

<Create a squid STARTUP script (started with the System)>
# Ee/etc/rc. Local
Add the following line and save and exit:
/Usr/local/squid/sbin/squid

Restart the server.

5. Install the SOCKS5 Service

1. Download and install SOCKS5

Download socks5-v1.0r11.tar.gz from the north sky network, the size is 401.093kb (this is what I provide), then copy it to the server through FTP, and then:

# Cd/home/funpower
# Cp socks5-v1.0r11.tar.gz/usr/ports/distfiles

<View distinfo>
# Cd/usr/ports/NET/SOCKS5
# More distinfo
Shown as follows:
MD5 (socks5-v1.0r11.tar.gz) = 9d6db7d3cda-bbafb8c8d67e128eedfe
Size (socks5-v1.0r11.tar.gz) = 401093
Check whether the size is the same as the downloaded size (401.093kb)

<Start installation>
# Cd/usr/ports/NET/SOCKS5
# Make install

2. Configure SOCKS5

# Cd/usr/local/etc
# Ee socks5.conf
<Content:>
Auth ---
Permit--192.168 .---
Set socks5_noident
Set socks5_v4support

Save and exit. Restart the server.

Then test your server's http port 3128 and SOCKS5 port 1080 through the QQ test connection.

Author: old tube Email: funpower@gmail.com
ReferenceArticle:Configure and implement socks V5 on Linux Install squid on FreeBSD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.