privoxy代理服务器配置

[root@MiWiFi-R1CM-srv ~]# yum install privoxy

[root@MiWiFi-R1CM-srv privoxy]# cd /etc/privoxy/
[root@MiWiFi-R1CM-srv privoxy]# touch pac.action
[root@MiWiFi-R1CM-srv privoxy]# vim pac.action


####pac.action#####

{{alias}}
default = +forward-override{forward .}
pac     = +forward-override{forward 10.0.8.253:8118}

{default}
/

{pac}
10.96.4.187

#########################



[root@MiWiFi-R1CM-srv privoxy]# vim config 


####config#####
# 添加自定义的PAC规则
actionsfile pac.action
# 下面这几行是系统预定义的转发规则,注释掉
# actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
# actionsfile default.action   # Main actions file
# actionsfile user.action      # User customizations

# 下面这几行是系统预定义的过滤规则,注释掉
# filterfile default.filter
# filterfile user.filter      # User customizations

#########################


[root@MiWiFi-R1CM-srv ~]# service privoxy start
Redirecting to /bin/systemctl start privoxy.service
You have new mail in /var/spool/mail/root

[root@MiWiFi-R1CM-srv ~]# service privoxy status
Redirecting to /bin/systemctl status privoxy.service
● privoxy.service - Privoxy Web Proxy With Advanced Filtering Capabilities
   Loaded: loaded (/usr/lib/systemd/system/privoxy.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2021-08-06 09:31:37 CST; 10s ago
  Process: 2556 ExecStart=/usr/sbin/privoxy --pidfile /run/privoxy.pid --user privoxy /etc/privoxy/config (code=exited, status=0/SUCCESS)
 Main PID: 2559 (privoxy)
    Tasks: 1
   CGroup: /system.slice/privoxy.service
           └─2559 /usr/sbin/privoxy --pidfile /run/privoxy.pid --user privoxy...

Aug 06 09:31:36 MiWiFi-R1CM-srv systemd[1]: Starting Privoxy Web Proxy With ....
Aug 06 09:31:37 MiWiFi-R1CM-srv systemd[1]: Started Privoxy Web Proxy With A....
Hint: Some lines were ellipsized, use -l to show in full.
[root@MiWiFi-R1CM-srv ~]# chkconfig privoxy on


[root@MiWiFi-R1CM-srv ~]# vim /etc/profile

####profile#####
MY_PROXY_URL="http://127.0.0.1:8118/"
HTTP_PROXY=$MY_PROXY_URL
HTTPS_PROXY=$MY_PROXY_URL
FTP_PROXY=$MY_PROXY_URL
http_proxy=$MY_PROXY_URL
https_proxy=$MY_PROXY_URL
ftp_proxy=$MY_PROXY_URL
export HTTP_PROXY HTTPS_PROXY FTP_PROXY http_proxy https_proxy ftp_proxy
#########################

[root@MiWiFi-R1CM-srv ~]# source /etc/profile

[root@MiWiFi-R1CM-srv privoxy]# curl 10.96.4.187:19190
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   <title>Welcome to JBoss&trade;</title>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
   <link rel="StyleSheet" href="jboss.css" type="text/css"/>
</head>

<body>
<!-- header begin -->

```

posted on   BionExit  阅读(1085)  评论(0编辑  收藏  举报

编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示