Squid反向手动编译--Debian10.x

2024-03-24 03:32

本文主要是介绍Squid反向手动编译--Debian10.x,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Squid反向手动编译-Debian10.x

实验环境:

server01:192.168.10.10		//CA证书-DNS服务器
server02:192.168.10.20		//squid服务器-需要做ssl 相同的一个ssl
server03:192.168.10.30		//apache2服务器-需要做ssl 相同的一个ssl
client01:192.168.10.40		//测试端前提:
1.配置好IP地址 /etc/network/interfaces
2.修改好主机名 hostnamectl set-hostname 名称 
3./etc/hosts 	//如图

image.png

步骤:

squid服务器:

第一步:能访问百度-NAT默认-配置公网DNS 
第二步:vim /etc/apt/source.list #打开配置文件源 
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 
deb http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free 
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free 
第三步:apt update #更新 
第四步:apt install libssl-dev -y #安装 
第五步:apt build-dep squid -y 
第六步:tar -xf squid-x.x.tar.gz
#squid软件包从squid官网下载 http://www.squid-cache.org/Versions/v4/

image.png

第七步:cd squid-x.x/ #进入路径
第八步: #开启所需的模块以及配置文件
./configure --prefix=/usr \
--localstatedir=/var \
--libexecdir=${prefix}/lib/squid \
--datadir=${prefix}/share/squid \
--sysconfdir=/etc/squid \
--with-default-user=proxy \
--with-logdir=/var/log/squid \
--with-pidfile=/var/run/squid.pid \
--enable-ssl \
--with-openssl \
--enable-ssl-crtd
第十步:make && make install		//编译
第十一步:cd /etc/squid/ #进入路径
第十二步:vim squid.conf #打开配置文件
http_access allow all
https_port 443 accel defaultsite=www.zt.com cert=/etc/squid/ssl/server.crt key=/etc/squid/ssl/server.key
cache_peer 192.168.10.30 parent 443 0 no-query originserver ssl sslflags=DONT_VERIFY_PEER
http_port 80 accel

image.png

第十三步:chown -R proxy /etc/squid/ #修改拥有者
第十四步:chown -R proxy /var/log/squid/ #修改拥有者
第十五步:netstat -ntpul #查看端口 80、443、3128 是否起来 都是squid
第十六步:vim /etc/resolv.conf 		//修改回dns服务器nameserver 192.168.10.10
第十七步:mkdir /etc/squdi/ssl
第十八步:查看ssl证书是否从apache2服务器复制过来!
第十九步:squid -f /etc/squid/squid.conf  //开启squid服务
第二十步:关闭的方法 squid -k shutdown  /etc/squid/squid.conf  

CA证书-DNS服务器:

CA证书:
第一步:/usr/lib/ssl/misc/CA.pl -newca #生成证书颁发机构
第二步:Apache2 发过来的newreq.pem
第二步:/usr/lib/ssl/misc/CA.pl -sign #签发证书
第三步:scp newcert.pem 192.168.10.30:/etc/apache2/ssl/server.crtDNS服务器:
第一步:apt install bind9 
第二步:cd /etc/bind
第三步:cp db.0 db.zt
第四步:vim db.zt
添加正向区域:	www 	IN	 	A	192.168.10.20
第五步:vim named.conf.default-zones		//添加正向区域zone "zt.com" {type master;file "/etc/bind/db.zt";};
第六步:systemctl restart bind9

Apache2服务器:

第一步:apt install apache2 -y
第二步:cd /etc/apache2/
第三步:mkdir ssl #创建目录
第四步:cd ssl #进入路径
第五步:openssl genrsa -out server.key 2048 #生成key
第六步:openssl req -new -key server.key -out 1.csr #生产csr
第七步:scp 1.csr 192.168.10.10:/root/newreq.pem
第八步:vim sites-available/default-ssl.confSSLCertificateFile	/etc/apache2/ssl/server.crtSSLCertificateKeyFile /etc/apache2/ssl/server.key
第九步:a2enmod ssl
第十步:cd mods-enabled/
第十一步:a2ensite default-ssl.conf
第十二步:systemctl restart apache2
第十三步:scp /etc/apche2/ssl/* 192.168.10.20:/etc/squid/ssl  //把所有的证书发给squid服务器

client01客户端测试:

第一步:apt install curl -y
第二步:curl -Ik https://www.zt.com
第三步:curl -Ik http://www.zt.com
或者浏览器打开访问https://www.zt.com或者http://www.zt.com
第四步:如果需要变成小绿锁 需要从CA证书服务器 发一个 cacert.pem 到客户端服务器去认证到火狐浏览器的证书内

image.png

image.pngimage.png

这篇关于Squid反向手动编译--Debian10.x的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/840339

相关文章

maven 编译构建可以执行的jar包

💝💝💝欢迎莅临我的博客,很高兴能够在这里和您见面!希望您在这里可以感受到一份轻松愉快的氛围,不仅可以获得有趣的内容和知识,也可以畅所欲言、分享您的想法和见解。 推荐:「stormsha的主页」👈,「stormsha的知识库」👈持续学习,不断总结,共同进步,为了踏实,做好当下事儿~ 专栏导航 Python系列: Python面试题合集,剑指大厂Git系列: Git操作技巧GO

Windows环境利用VS2022编译 libvpx 源码教程

libvpx libvpx 是一个开源的视频编码库,由 WebM 项目开发和维护,专门用于 VP8 和 VP9 视频编码格式的编解码处理。它支持高质量的视频压缩,广泛应用于视频会议、在线教育、视频直播服务等多种场景中。libvpx 的特点包括跨平台兼容性、硬件加速支持以及灵活的接口设计,使其可以轻松集成到各种应用程序中。 libvpx 的安装和配置过程相对简单,用户可以从官方网站下载源代码

Golang test编译使用

创建文件my_test.go package testsimport "testing"func TestMy(t *testing.T) {t.Log("TestMy")} 通常用法: $ go test -v -run TestMy my_test.go=== RUN TestMyTestMy: my_test.go:6: TestMy--- PASS: TestMy (0.

C++/《C/C++程序编译流程》

程序的基本流程如图:   1.预处理        预处理相当于根据预处理指令组装新的C/C++程序。经过预处理,会产生一个没有宏定义,没有条件编译指令,没有特殊符号的输出文件,这个文件的含义同原本的文件无异,只是内容上有所不同。 读取C/C++源程序,对其中的伪指令(以#开头的指令)进行处理将所有的“#define”删除,并且展开所有的宏定义处理所有的条件编译指令,如:“#if”、“

编译linux内核出现 arm-eabi-gcc: error: : No such file or directory

external/e2fsprogs/lib/ext2fs/tdb.c:673:29: warning: comparison between : In function 'max2165_set_params': -。。。。。。。。。。。。。。。。。。 。。。。。。。。。。。。。 。。。。。。。。 host asm: libdvm <= dalvik/vm/mterp/out/Inte

QT 编译报错:C3861: ‘tr‘ identifier not found

问题: QT 编译报错:C3861: ‘tr’ identifier not found 原因 使用tr的地方所在的类没有继承自 QObject 类 或者在不在某一类中, 解决方案 就直接用类名引用 :QObject::tr( )

hector_quadrotor编译总结 | ubuntu 16.04 ros-kinetic版本

hector_quadrotor编译总结 | ubuntu 16.04 ros-kinetic版本 基于Ubuntu 16.04 LTS系统所用ROS版本为 Kinetic hector_quadrotor ROS包主要用于四旋翼无人机的建模、控制和仿真。 1.安装依赖库 所需系统及依赖库 Ubuntu 16.04|ros-kinetic|Gazebo|gazebo_ros_pkgs|ge

hector_quadrotor编译总结 | ubuntu 14.04 ros-indigo版本

hector_quadrotor编译总结 | ubuntu 14.04 ros-indigo版本 基于Ubuntu 14.04 LTS系统所用ROS版本为 Indigo hector_quadrotor ROS包主要用于四旋翼无人机的建模、控制和仿真。 备注:两种安装方式可选:install the binary packages | install the source files

编译和链接那点事下

http://www.0xffffff.org/?p=357 上回书我们说到了链接以前,今天我们来研究最后的链接问题。         链接这个话题延伸之后完全可以跑到九霄云外去,为了避免本文牵扯到过多的话题导致言之泛泛,我们先设定本文涉及的范围。我们今天讨论只链接进行的大致步骤及其规则、静态链接库与动态链接库的创建和使用这两大块的问题。至于可执行文件的加载、可执行文件的运行时

编译和链接那点事上

http://www.0xffffff.org/?p=323  有位学弟想让我说说编译和链接的简单过程,我觉得几句话简单说的话也没什么意思,索性写篇博文稍微详细的解释一下吧。其实详细的流程在经典的《Linkers and Loaders》和《深入理解计算机系统》中均有描述,也有国产的诸如《程序员的自我修养——链接、装载与库》等大牛著作。不过,我想大家恐怕很难有足够的时间去研读这些厚如