linuxsquid代理
A. 如何在linux下配置socks5代理
.采用Danted最新稳定版本1.4.0编译安装。
2.自动识别系统IP(默认排除192.168.0.*,
10.0.0.*,127.0.0.*),检测多Ip时,进行交互式选择Ip配置(直接回车则全部配置)。
3.
采用Pam用户认证,认证不需要添加系统用户(默认添加进程用户sock),删除、添加用户方便,安全。
4.sock5运行状态查看。
5.
系统启动后自动加载。
6.认证方式可选:无用户名密码,系统用户名密码,Pam用户名密码
7.
完美支持Centos/Debian,自动识别系统进行安装配置。
8.
自定义对连接客户端认证方式,支持设置某些IP/IP段无需认证即可连接。
******安装用说明
1.下载
wget--no-check-certificate
https://raw.github.com/Lozy/danted/master/install.sh-O
install.sh
2.[可选]修改
默认参数,DEFAULT_PORT为默认端口,DEFAULT_USERPAM用户名,DEFAULT_PAWDPAM用户对应密码MASTER_IP
为免认证白名单(域名,IP可选:如默认的buyvm.info或者具体Ip8.8.8.8/32)
3.修改后,执行
bashinstall.sh
4.若运行结束后显示DanteServer
InstallSuccessfuly!则表明成功。
若显示DanteServerInstallFailed!
则表明安装失败,求留言反馈操作系统+具体问题。
******安装后使用说明
1.命令参数/etc/init.d/danted
{start|stop|restart|status|add|del}
2.重启sock5/etc/init.d/dantedrestart或者
servicedantedrestart
3.关闭sock5/etc/init.d/dantedstop或者servicedanted
stop
4.开启sock5/etc/init.d/dantedstart或者servicedantedstart
5.
查看sock5状态/etc/init.d/dantedstatus或者servicedantedstatus
6.添加SOCK5
PAM用户/修改密码/etc/init.d/dantedadd用户名密码
7.删除SOCK5PAM用户/etc/init.d/danted
del用户名
8.配置文件路径/etc/danted/conf/
9.日志记录路径/var/log/danted.*.log
10.
danted帮助命令danted--help
******使用注意事项
1.
绝大部分浏览器(除了Opera)都不支持带密码认证的Socks5,所以使用电脑需要安装proxifier/proxycap等软件做验证处理。
2.
如果是固定IP/Ip段可以修改配置文件,设置白名单访问。
进入/etc/danted/conf/找到配置文件
修改第一个client
pass{}模块下的from:Master_IP/32to:0.0.0.0/0.把Master_IP/32
修改为需要使用代理的Ip段/IP地址如114.114.114.0/24或者5.5.5.5/32.多个访问源,请复制多个clientpass{}
模块。重启Danted进程servicedantedrestart
更详细WIKI说明
https://github.com/Lozy/danted/blob/master/README.md
项目托管地址
https://github.com/Lozy/danted
说明下,这个支持TCP及UDP的代理服务器,一键安装,简单方便……
B. 在Linux中可以实现代理服务器功能的软件是什么
Linux中实现代理服务器功能最常用的软件为squid,下面是源代码包安装步骤:
1.从http://www.squid-cache.org下载squid-2.2.STABLE4-src.tar.gz
2.将该文件拷贝到/usr/local目录
cpsquid-2.2.STABLE4-src.tar.gz/usr/local
3.解开该文件
tarxvzf
squid-2.2.STABLE4-src.tar.gz
#为了方便使用将目录更名为squid
mvsquid-2.2.STABLE4squid
4.进入squid目录
cdsquid
5.执行编译
./configure
#系统默认安装目录为/usr/local/squid
/configure-prefix=/directory/you/want
#指定安装目录
6.执行
makeall
7.执行安装
makeinstall
8.安装结束后,Squid的可执行文件在安装目录的bin子目录下,配置文件在etc子目录下。
C. 关于linux下有哪些代理服务器
Linux中实现代理服务器功能最常用的软件为squid,下面是源代码包安装步骤: 1.从http://www.squid-cache.org下载squid-2.2.STABLE4-src.tar.gz 2.将该文件拷贝到/usr/local目录
D. 简述Linux Squid代理服务器的主要作用
squid is a high-performance proxy caching server for web clients, supporting FTP, gopher, and HTTP data objects. Unlike traditional caching software, squid handles all requests in a single, non-blocking, I/O-driven process.
squid keeps meta data and especially hot objects cached in RAM, caches DNS lookups, supports non-blocking DNS lookups, and implements negative caching of failed requests.
squid supports SSL, extensive access controls, and full request logging. By using the lightweight Internet Cache Protocol, squid caches can be arranged in a hierarchy or mesh for additional bandwidth savings.
squid consists of a main server program squid, a Domain Name System lookup program dnsserver, some optional programs for rewriting requests and performing authentication, and some management and client tools. When squid starts up, it spawns a configurable number of dnsserver processes, each of which can perform a single, blocking Domain Name System (DNS) lookup. This reces the amount of time the cache waits for DNS lookups.
E. linux下开启防火墙后使用squid反向代理访问不了,关闭防火墙则可以正常访问。
1、在squid.conf里面查看端口号,如http_port 3128
2、打开防火墙相应的端口
1)# vi /etc/sysconfig/iptables ← 编辑防火墙配置文件
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3128 -j ACCEPT ← 添加这一行,开放3128号端口,允许squid
2)# /etc/rc.d/init.d/iptables restart ← 重新启动防火墙,使设置生效
F. 如何在Linux上用Squid搭建代理服务器
安装步骤:
./configure --prefix=/usr/local/squid
make all
sudo make install(因为要拷贝到系统目录,需要root权限,所以sudo了,你也可以root登录执行,我是Ubuntu的系统,所以用sudo,有root权限就行)
检查配置文件:
sudo vi /usr/local/squid/etc/squid.conf
配置项1:
# Squid normally listens to port 3128
http_port 3128
配置项2:
acl localnet src 192.168.0.0/16
http_access allow localnet
配置项3:
# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /usr/local/squid/var/cache/squid 100 16 128
cache_mem 32 MB (这一条必须配置)
否则你就会遭遇报错: 2013/10/12 16:16:55 kid1| WARNING cache_mem is larger than total disk cache space!
安装好了以后,系统中新建了一个用户squid,在组中一查,发现属于nobody组的:
cat /etc/passwd|grep squid
cat /etc/group|grep 65534
安装squid的所在目录是:/usr/local/squid
我闲得没事干,直接改了所属用户为squid:nobody
sudo chown -Rf squid:nobody /usr/local/squid
建立cache的时候,对下面目录需要nobody用户权限,这个是网上没有说的很清楚的地方,折腾了我半天:
sudo chown -Rf nobody /usr/local/squid/var/cache/
sudo chown -Rf nobody /usr/local/squid/var/logs/
