❶ linux下squid代理服务器配置 打入ping命令后之后没有了反应怎么解决
squid和ping又没必然联系。你这问题没头没脑的。况且ping用的icmp协议又不支持http代理。
❷ linux下用squid做代理服务器的问题。
可以配置单网卡代理服务器。
安装squid代理服务器之后,需要设置Linux的主机名为FQDN的格式,并且要保证能够解析出来。
首先运行squid -z进行初始化,然后要修改squid的配置文件:/etc/squid/squid.conf
加入如下条目:
acl mynet 192.168.1.0/24
http_access allow mynet
启动服务:service squid start
图形化的工具可以尝试webmin
❸ 请教关于linux代理服务器设置的问题
squid代理和nginx代理(相关配置http://www.360doc.com/content/13/1114/12/7694408_329125489.shtml),这里主要讲squid ,因为现在用的比较多
第一步:安装SQUID软件
从www.squid-cache.org下载SQUID软件,以squid-2.4.STABLE1-src.tar.gz为例。
运行“tar zxf squid-2.4.STABLE1-src.tar.gz”,生成“squid-2.4.STABLE1”目录。因为SQUID的运行需要nobody用户和nobody组,所以先运行Linuxconf命令查看是否有这个用户和组,没有就需要建立。
切换到“squid-2.4.STABLE1”目录,运行“./configure --prefix=/usr/local/squid”,然后运行“make all”,然后运行“make install”安装软件。squid将会被安装到/usr/local/squid目录下。
第二步:配置SQUID
1、“chmod 777 /usr/local/squid/logs”,设置logs权限。这样才能在logs目录才产生access.log、cache.log等文件。
2、“/usr/local/squid/bin/squid -z”,手工建立squid的缓存目录/usr/local/squid/cache。
3、修改SQUID的配置文件squid.conf。SQUID的配置文件,编辑 vi /usr/local/squid/etc/squid.conf文件,找到“http_access deny all”并改为“http_access allow all”。然后SQUID服务就可以启动了。
4、运行 squid -z 初始化
5、netstat -ntl 查看开放端
6、/usr/local/squid/bin/RunCache”,启动squid代理服务。
7、service squid start 启动服务
8、netstat -n |grep "192.168.1" 查看。
第三步、测试代理服务
运行IE浏览器,单击“工具-》Internet选项-》连接-》局域网设置”;在代理服务器下面的小窗口上面打上对勾,然后在地址窗口中填上SQUID服务器的IP地址,在端口处填上“3218”(SQUID软件默认代理端口),确定后退出。然后可以打开浏览器试试或者查看logs下的access.log和cache.log,看看是否代理运行正常。
❹ 在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子目录下。
❺ 如何在linux上用squid搭建代理服务器
1、首先下载:squid-3.2.9.tar.bz2
2、上传到服务器后解压:
解压: tar -vxjf squid-3.2.9.tar.bz2
解压后生成目录:squid-3.2.9
进入目录翻看文档INSTALL:
xxxx> more INSTALL
To build and install the Squid Cache, type:
% ./configure --prefix=/usr/local/squid
% make all
% make install
To run a Cache, you will need to:
1. customize the squid.conf configuration file:
% vi /usr/local/squid/etc/squid.conf
2. Initalise the cache:
% /usr/local/squid/sbin/squid -z
3. start the cache:
% /usr/local/squid/sbin/squid
If you want to use the WWW interface to the Cache Manager,
the cachemgr.cgi program into your httpd server's cgi-bin
directory.
3、安装步骤:
./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/
否则会遭遇:
WARNING: Cannot write log file: /usr/local/squid/var/logs/cache.log
FATAL: Failed to make swap directory /usr/local/squid/var/cache/squid/00: (13) Permission denied
初始化squid.conf里配置的cache目录,就是建立了一堆的目录:
sudo /usr/local/squid/sbin/squid -z
在前台启动squid,并输出启动过程
sudo /usr/local/squid/sbin/squid -N -d1
显示ready to server reques,则启动成功。可以键入ctrl+c,停止squid,并以后台运行的方式启动。
没有在配置文件中配置DNS,而是在 /etc/resolv.conf 中配置:
domain site
nameserver x.x.x.x
所以打印出来的日志中就这样的:
2013/10/12 16:42:13| Adding nameserver x.x.x.x from /etc/resolv.conf
squid从这个配置文件中读取了dns配置来用。
启动squid后台运行
sudo /usr/local/squid/sbin/squid -s
检查一下进程是否存在:ps -ef|grep squid
通过squid客户端查看squid运行状态
/usr/local/squid/bin/squidclient -h 127.0.0.1 -p 3128 mgr:info
那台不能上网的机器配置如下:
export http_proxy=http://192.168.199.235:3128/
可以把这句写到启动文件中,比如什么.profile或者.bashrc,或者/etc/profile等等。
取消:unset http_proxy
最后测试一下能不能上网了。
❻ Linux中怎么设置透明代理
a.客户端的windows PC的网关必须设成Squid代理服务器,因为既然你的browser中没有任何代理设置,你要访问某个站点时,包必须经经过squid代理服务器才能被重定向,故这是最基本的条件。
b.客户端必须正确设置DNS服务器。因为既然现在不用设置任何代理。则DNS必须由browser来解析,也就是要由客户端的PC中TCP/IP中设置的DNS服务器来正确解析出某个站点的IP地址来。
c.服务器端可以安装squid代理服务器,1.x or 2.x版本均可。
3.配置Squid代理,启动透明代理功能
Squid-2
加下面的行到你的/etc/squid/squid.conf中
http_port 8080
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
Squid-1.1
加下面的行到/etc/squid.conf
http_port 8080
httpd_accel virtual 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
4. 重启动squid. 用下面的命令:
#/usr/sbin/squid -k reconfigure
如提示内核不支持透明代理。则你需要重新编译内核,enable 透明代理的支持。
下面是你需要启动的内核项目:
[*] Network firewalls
[ ] Socket Filtering
[*] Unix domain sockets
[*] TCP/IP networking
[ ] IP: multicasting
[ ] IP: advanced router
[ ] IP: kernel level autoconfiguration
[*] IP: firewalling
[ ] IP: firewall packet netlink device
[*] IP: always defragment (required for masquerading)
[*] IP: transparent proxy support
5. 下面的命令针对Linux 2.2.x内核:
# Accept all on lookback
/sbin/ipchains -A input -j ACCEPT -i lo
#Accept my own IP, to prevent loops (repeat for each interface/alias)
/sbin/ipchains -A input -j ACCEPT -p tcp -d 192.168.11.1/32 80
#Send all traffic destined to port 80 to Squid on port 80
/sbin/ipchains -A input -j REDIRECT 8080 -p tcp -s 192.168.11.0/24 -d 0/0 80
下面的命令针对Linux 2.0.x内核:
# Accept all on loopback
ipfwadm -I -a accept -W lo
# Accept my own IP, to prevent loops (repeat for each interface/alias)
ipfwadm -I -a accept -P tcp -D 192.168.11.1/32 80
# Send all traffic destined to port 80 to Squid on port 3128
ipfwadm -I -a accept -P tcp -S 192.168.11.0/24 -D 0/0 80 -r 8080
6.应注意的问题:
a. 这种透明代理只能针对http协议,不能针对FTP协议
b. PC的默认网关应设成squid 代理服务器
c. 防火墙重定向规则在其它的input规则的前面,注意顺序。
如:
/etc/rc.d/rc.firewall:
#!/bin/sh
# rc.firewall Linux kernel firewalling rules
FW=/sbin/ipfwadm
# Flush rules, for testing purposes
for i in I O F # A # If we enabled accounting too
do
${FW} -$i -f
done
# Default policies:
${FW} -I -p rej # Incoming policy: reject (quick error)
${FW} -O -p acc # Output policy: accept
${FW} -F -p den # Forwarding policy: deny
# Input Rules:
# Loopback-interface (local access, eg, to local nameserver):
${FW} -I -a acc -S localhost/32 -D localhost/32
# Local Ethernet-interface:
# Redirect to Squid proxy server:
${FW} -I -a acc -P tcp -D default/0 80 -r 8080
# Accept packets from local network:
${FW} -I -a acc -P all -S localnet/8 -D default/0 -W eth0
# Only required for other types of traffic (FTP, Telnet):
# Forward localnet with masquerading (udp and tcp, no icmp!):
${FW} -F -a m -P tcp -S localnet/8 -D default/0
${FW} -F -a m -P udp -S localnet/8 -D default/0
Here all traffic from the local LAN with any destination gets redirected to the
local port 8080.
需要解决更多linux问题,详情请看 http://www.linuxprobe.com/chapter-00.html
望采纳!
❼ linux下用squid实现代理服务器的问题。
完全可以
在服务器上设置FQDN,squid要求使用FQDN。例如server.linux.com,使用hostname命令即可:
hostname server.linux.com
在/etc/hosts文件中写入上述FQDN的解析条目:
192.168.2.161 server.linux.com
然后运行命令squid -z完成初始化
修改/etc/squid/squid.conf配置文件。该文件绝大部分的配置都不需要修改,只要加入你的访问控制即可。
可以加入两行:
acl mynet src 192.168.2.0/255.255.255.0
http_access allow mynet
最后客户端在浏览器上设置代理地址就可以了
❽ 简述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.
❾ 如何在Linux上用Squid搭建代理服务器
squid是所有服务里面最简单的我觉得
以RHEL7为例,它分成了正向代理和反向代理,正向代理里又分“标准正向代理”,“ACL访问控制”以及“透明正向代理”。下面是标准正向代理
16.3 正向代理
16.3.1 标准正向代理
Squid服务程序软件包在正确安装并启动后默认就已经可以为用户提供标准正向代理模式服务了,而不需要单独再去修改配置文件或者其他操作,咱们可以立即在Windows7系统的客户端主机上面打开任意一款浏览器,然后点击Internet选项标签,如图16-4所示:
[root@linuxprobe ~]# systemctl restart squid
[root@linuxprobe ~]# systemctl enable squid
ln -s '/usr/lib/systemd/system/squid.service' '/etc/systemd/system/multi-user.target.wants/squid.service'
用户要想使用Squid服务程序提供的标准正向代理模式服务就必须在浏览器中填写服务器的IP地址以及端口号信息,因此咱们还需要依次点击连接标签后点击局域网设置选项,如图16-5与图16-6所示填写服务器信息后保存退出配置向导。
用户只需要在浏览器中简单的填写配置信息就可以开始享用Squid服务程序提供的代理服务了,此时作为一个网卡为仅主机模式(Hostonly)的虚拟机,开始也奇迹般的能够上网浏览了,这一切都是托代理服务器转发的功劳哦~
如此公开而没有密码验证的代理服务终归觉得不放心,万一有其他人也来“蹭网”咱们的代理服务怎么办呢?Squid服务程序默认的会占用3128、3401与4827等端口号,咱们可以将默认占用的端口号修改成其他值,这样应该能起到一定的保护作用吧~同学们都知道在Linux系统配置服务程序就是在修改该服务的配置文件,因此直接在/etc目录中找到和squid服务程序同名目录中的配置文件,把其中http_port参数后面原有3128修改为10000,这样即是将Squid服务程序的代理服务端口修改成了新值,当然最后不要忘记再重启下服务程序哦~:
[root@linuxprobe ~]# vim /etc/squid/squid.conf
………………省略部分输出信息………………
45 #
46 # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
47 #
48
49 # Example rule allowing access from your local networks.
50 # Adapt localnet in the ACL section to list your (internal) IP networks
51 # from where browsing should be allowed
52 http_access allow localnet
53 http_access allow localhost
54
55 # And finally deny all other access to this proxy
56 http_access deny all
57
58 # Squid normally listens to port 3128
59 http_port 10000
60
http_port 10000
………………省略部分输出信息………………
[root@linuxprobe ~]# systemctl restart squid
[root@linuxprobe ~]# systemctl enable squid
ln -s '/usr/lib/systemd/system/squid.service' '/etc/systemd/system/multi-user.target.wants/squid.service'
同学们有没有突然觉得这一幕似曾相识?在前面的第十章10.5.3小节咱们学习过基于端口号来部署httpd服务程序的虚拟主机功能,当时在编辑完配置文件后重启服务程序时被直接提示报错了,虽然现在重启服务程序并没有直接报错,但其实客户并不能使用代理服务呢,SElinux安全子系统认为Squid服务程序使用3128端口号是理所应当的,默认策略规则中也是允许的,但现在却在尝试使用新的10000端口号,这是原本并不属于Squid服务程序应该使用的系统资源,因此咱们需要手动把新的端口号添加到squid服务程序在SElinux域的允许列表中即可:
[root@linuxprobe ~]# semanage port -l | grep -w -i squid_port_t
squid_port_t tcp 3128, 3401, 4827
squid_port_t udp 3401, 4827
[root@linuxprobe ~]# semanage port -a -t squid_port_t -p tcp 10000
[root@linuxprobe ~]# semanage port -l | grep -w -i squid_port_t
squid_port_t tcp 10000, 3128, 3401, 4827
squid_port_t udp 3401, 4827
更多的图文信息以及其他的代理方式你可以看下http://www.linuxprobe.com/chapter-16.html#161这篇,讲的非常详细,相信能解决你的问题
❿ LINUX squid是什么意思
代理服务器,功能非常强大 很好用,注意在用的时候要开启转发功能