When we introduced nginx, we also used nginx to set up a forward proxy. However, if you want to support https, it is difficult to use nginx directly. It is much simpler to use squid, which specializes in this area. This article is used to record the steps to install and configure squid3.5 on centos7 to implement http and https. Machine Configuration [root@liumiaocn ~]# uname -a Linux mail.163.com 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux [root@liumiaocn ~]# [root@liumiaocn ~]# cat /etc/redhat-release CentOS Linux release 7.3.1611 (Core) [root@liumiaocn ~]# Install Squid
Confirm version
[root@liumiaocn ~]# rpm -qa |grep squid squid-migration-script-3.5.20-12.el7.x86_64 squid-3.5.20-12.el7.x86_64 [root@liumiaocn ~]# Confirm ip_forward ip_forward needs to be set to 1, which is already set by default in centos. The details are as follows: [root@liumiaocn ~]# sysctl -a |grep -w ip_forward net.ipv4.ip_forward = 1 [root@liumiaocn ~]# Modify the settings file Before modification [root@liumiaocn ~]# grep -n 'http_access deny all' /etc/squid/squid.conf 56:http_access deny all [root@liumiaocn ~]# After [root@liumiaocn ~]# grep -n http /etc/squid/squid.conf |grep -w all 56:http_access allow all [root@liumiaocn ~]# Start Squid
Problem 1: libssl error The following error is prompted when starting squid Reason: openssl is not installed
[root@liumiaocn ~]# systemctl start squid [root@liumiaocn ~]# systemctl status squid ● squid.service – Squid caching proxy Loaded: loaded (/usr/lib/systemd/system/squid.service; disabled; vendor preset: disabled) Active: active (running) since Tue 2018-06-05 20:07:56 CST; 8s ago Process: 28548 ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF (code=exited, status=0/SUCCESS) Process: 28540 ExecStartPre=/usr/libexec/squid/cache_swap.sh (code=exited, status=0/SUCCESS) Main PID: 28551 (squid) Memory: 14.3M CGroup: /system.slice/squid.service ├─28551 /usr/sbin/squid -f /etc/squid/squid.conf ├─28553 (squid-1) -f /etc/squid/squid.conf └─28557 (logfile-daemon) /var/log/squid/access.log Jun 05 20:07:56 liumiaocn systemd[1]: Starting Squid caching proxy... Jun 05 20:07:56 liumiaocn squid[28551]: Squid Parent: will start 1 kids Jun 05 20:07:56 liumiaocn squid[28551]: Squid Parent: (squid-1) process 28553 started Jun 05 20:07:56 liumiaocn systemd[1]: Started Squid caching proxy. [root@liumiaocn ~]# Problem 2: Unable to resolve domain name At this time, it is found that the domain name cannot be used and only the IP address can be used to access
[root@liumiaocn ~]# grep nameserver /etc/squid/squid.conf dns_nameservers 8.8.8.8 8.8.4.4 [root@liumiaocn ~]# [root@liumiaocn ~]# systemctl restart squid [root@liumiaocn ~]# Client access The default port of Squid is 3128, which is not modified here. You can access it from the client using the following method: HTTP method
HTTPS method
Summarize The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM. If you want to learn more about this, please check out the following links You may also be interested in:
|
<<: Solution to the failure of remote connection to MySQL database in Linux configuration
>>: Vue resets data to its initial state
Trident core: IE, MaxThon, TT, The World, 360, So...
Table of contents WXS Response Event Plan A Page ...
1. Go to the official website to download the jdk...
Set vim's working mode (temporary) :set (mode...
Although Microsoft has done a lot of research and ...
This article uses examples to illustrate the usag...
Table of contents 1. Basic use of axio 2. How to ...
1. Development environment vue 2. Computer system...
border-radius:10px; /* All corners are rounded wi...
Achieve results Implementation ideas The melting ...
This article mainly introduces the method of conf...
This article shares the specific code of Navicat ...
This article introduces Docker+Jenkins automatic ...
Introduction to influxDB influxDB is a distribute...
Table of contents A JSON is built on two structur...