Fedora/centos 7 安装polipo

 •  Filed under centos, linux, proxy

下载
git clone https://github.com/jech/polipo.git
cd polipo
(可选)使用发布的版本
git checkout polipo-1.1.1
安装
make all
su -c 'make install'
建立配置文件
mkdir /opt/polipo
nano /opt/polipo/config

复制http://www.pps.univ-paris-diderot.fr/~jch/software/polipo/config.sample 内容并编辑

建立polipo账户
useradd polipo -r -s /usr/sbin/nologin
新建启动脚本
nano /etc/systemd/system/polipo.service

内容为

[Unit]
Description=polipo web proxy
After=network.target

[Service]
Type=simple
WorkingDirectory=/tmp
User=polipo
Group=polipo
ExecStart=/usr/bin/polipo -c /opt/polipo/config
Restart=always
SyslogIdentifier=Polipo

[Install]
WantedBy=multi-user.target
打开防火墙
firewall-cmd --permanent --add-port=8123/tcp
firewall-cmd --reload
尝试启动服务
systemctl start polipo
查看是否被selinux阻挡
sudo cat /var/log/audit/audit.log | grep polipo | grep denied
配置selinux rule
sudo cat /var/log/audit/audit.log | grep polipo | grep denied | audit2allow -M mypolipo
sudo semodule -i mypolipo.pp
重复以上操作直至selinux不再阻挡
自动启动服务
systemctl enable polipo

 

 

Polipo的其他配置

(转自:http://blog.youkuaiyun.com/xienaoban/article/details/54772942)

Polipo,和shadowsocks的socks5搭配比较不错。

打开配置文件:

sudo vim /etc/polipo/config

修改配置文件:

# This file only needs to list configuration variables that deviate
# from the default values.  See /usr/share/doc/polipo/examples/config.sample
# and "polipo -v" for variables you can tweak and further information.

logSyslog = true
logFile = /var/log/polipo/polipo.log
socksParentProxy = "localhost:1080"
socksProxyType = socks5
logLevel=4

注意:请确保Shadowsocks正常工作。

然后重启polipo:

sudo service polipo stop
sudo service polipo start

Polipo默认的代理地址是 http_proxy=http://localhost:8123
那么每次对于希望over the wall的指令,只需在前面加一句http_proxy=http://localhost:8123 即可。当然每次输入这么一长串这比较麻烦,可以打开~/.bashrc,在最后面添加一句

alias owall="http_proxy=http://localhost:8123"

这样以后只需在需要over the wall的指令前面加一句owall即可了。
先来测试下有没有成功,输入:

owall curl ip.gs
当前 IP:104.238.149.195 来自:日本东京都东京 choopa.com

如果不想每条指令都输入owall,可以

export http_proxy=http://localhost:8123

转载于:https://my.oschina.net/chaenomeles/blog/858336

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值