{"id":293021,"date":"2024-09-17T04:02:42","date_gmt":"2024-09-16T20:02:42","guid":{"rendered":"https:\/\/lrxjmw.cn\/rhrgsijfnwfw.html"},"modified":"2024-09-17T04:02:42","modified_gmt":"2024-09-16T20:02:42","slug":"rhrgsijfnwfw","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/rhrgsijfnwfw.html","title":{"rendered":"\u5982\u4f55\u8ba9\u516c\u53f8 IDC \u673a\u623f\u5185\u7f51\u670d\u52a1\u5668\u5b9e\u73b0\u5bf9\u5916\u8bbf\u95ee\u5e76\u652f\u6301 http \u548c https \u8bf7\u6c42"},"content":{"rendered":"
<\/p>\n
\u9700\u6c42\u8bf4\u660e\uff1a\u516c\u53f8IDC\u673a\u623f\u6709\u4e00\u53f0\u670d\u52a1\u5668A\uff0c\u53ea\u6709\u5916\u7f51\u73af\u5883\uff1a192.168.1.150\u73b0\u4eca\u987b\u8981\u8ba9\u8fd9\u53f0\u670d\u52a1\u5668\u80fd\u5bf9\u5916\u8bbf\u95ee\uff0c\u80fd\u6b63\u5e38\u8bbf\u95eehttp\u548chttps\u6073\u6c42\uff08\u537380\u7aef\u53e3\u548c443\u7aef\u53e3\uff09<\/p>\n
<\/p>\n
\u64cd\u4f5c\u601d\u8def\uff1a\u5728IDC\u673a\u623f\u91cc\u53e6\u627e\u5176\u4ed6\u4e24\u53f0\u6709\u7f51\u6bb5\u73af\u5883\u7684\u670d\u52a1\u5668B\uff0858.68.250.8\/192.168.1.8\uff09\u548c\u670d\u52a1\u5668C\uff0858.68.250.5\/192.168.1.5\uff09ubuntu \u4ee3\u7406\u4e0a\u7f51<\/strong>\uff0c\u4e14\u8fd9\u4e24\u53f0\u670d\u52a1\u5668\u548c\u5916\u7f51\u73af\u5883\u7684\u670d\u52a1\u5668A\u80fd\u4e92\u76f8ping\u901a\u3002\uff08\u5176\u5b9e\u4e5f\u53ef\u4ee5\u5c06\u4e0b\u8fb9B\u7684http\u548cC\u673a\u5668\u7684https\u4ee3\u7406\u73af\u5883\u7f6e\u4e8e\u4e00\u53f0\u673a\u5668\u4e0a\u5e03\u7f72\uff09\u5176\u4e2d\uff1a<\/p>\n \u5728\u670d\u52a1\u5668B\u4e0a\u5e03\u7f72squid\u7684http\u4ee3\u7406linux\u5220\u9664\u547d\u4ee4\uff0c\u8ba9\u670d\u52a1\u5668C\u901a\u8fc7\u5b83\u7684squid\u4ee3\u7406\u4e0a\u7f51ubuntu \u4ee3\u7406\u4e0a\u7f51<\/strong>\uff0c\u80fd\u6210\u529f\u8bbf\u95eehttp<\/p>\n <\/p>\n \u5728\u670d\u52a1\u5668C\u4e0a\u5e03\u7f72squid\u7684https\u4ee3\u7406LINUX \u5220\u9664\u76ee\u5f55\uff0c\u8ba9\u670d\u52a1\u5668C\u901a\u8fc7\u5b83\u7684squid\u4ee3\u7406\u4e0a\u7f51\uff0c\u80fd\u6210\u529f\u8bbf\u95eehttps[\u987b\u8981\u5728\u987e\u5ba2\u7aef\u5b89\u88c5stunnel]<\/p>\n \u4e00\u3001\u670d\u52a1\u5668B\u4e0a\u7684\u64cd\u4f5c\u8bb0\u5f55\uff08http\u4ee3\u7406\uff09<\/p>\n <\/p>\n \n \u4e8c\u3001\u670d\u52a1\u5668C\u4e0a\u7684\u7684\u64cd\u4f5c\u8bb0\u5f55\uff08https\u4ee3\u7406\uff09<\/p>\n \n1<\/span>\uff09\u5b89\u88c5squid<\/span><\/code>
yum\u547d\u4ee4\u76f4\u63a5\u5728\u7ebf\u5b89\u88c5squid<\/span><\/code>
[root@openstack ~]# yum install -y gcc openssl openssl-devel #\u4f9d\u8d56\u8f6f\u4ef6\u8981\u5148\u63d0\u524d\u5b89\u88c5<\/span><\/span><\/code>
[root@openstack ~]# yum install squid<\/span><\/span><\/code>
<\/span><\/code>
\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u4fee\u6539squid.conf \u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\uff0c\u4fee\u6539\u4e4b\u524d\u53ef\u4ee5\u5148\u5907\u4efd\u8be5\u6587\u4ef6<\/span><\/code>
[root@openstack ~]# cd \/etc\/squid\/<\/span><\/span><\/code>
[root@openstack squid]# cp squid.conf squid.conf_bak<\/span><\/span><\/code>
[root@openstack squid]# vim squid.conf<\/span><\/span><\/code>
http_access allow all #\u4fee\u6539deny\u4e3aallow<\/span><\/span><\/code>
http_port 192.168<\/span>.1.8<\/span>:3128<\/span><\/span><\/code>
cache_dir ufs \/var\/spool\/squid 100<\/span> 16<\/span> 256<\/span> #\u6253\u5f00\u8fd9\u4e2a\u6ce8\u91ca\uff0c\u4fdd\u8bc1\/var\/spool\/squid\u8fd9\u4e2a\u7f13\u5b58\u76ee\u5f55\u5b58\u5728<\/span><\/span><\/code>
<\/span><\/code>
2<\/span>\uff09\u542f\u52a8squid\uff0c\u542f\u52a8\u524d\u8fdb\u884c\u6d4b\u8bd5\u548c\u521d\u59cb\u5316<\/span><\/code>
[root@openstack squid]# squid -k parse #\u6d4b\u8bd5<\/span><\/span><\/code>
2016<\/span>\/08\/09 13<\/span>:35<\/span>:04<\/span>| Processing Configuration File: \/etc\/squid<\/span>\/squid.conf (depth 0)<\/span><\/span><\/code>
2016\/<\/span>08\/09 13<\/span>:35<\/span>:04<\/span>| Processing: acl manager proto cache_object<\/span><\/code>
..............<\/span><\/code>
..............<\/span><\/code>
2016<\/span>\/08\/09 13<\/span>:35<\/span>:04<\/span>| Processing: refresh_pattern . 0<\/span> 20<\/span>% 4320<\/span><\/span><\/code>
2016<\/span>\/08\/09 13<\/span>:35<\/span>:04<\/span>| Initializing https proxy context<\/span><\/code>
<\/span><\/code>
[root@openstack squid]# squid -z #\u521d\u59cb\u5316<\/span><\/span><\/code>
2016<\/span>\/08\/09 13<\/span>:35<\/span>:12<\/span>| Creating Swap Directories<\/span><\/code>
<\/span><\/code>
[root@openstack squid]# \/etc\/init.d\/squid start<\/span><\/span><\/code>
Starting squid: . [ OK ]<\/span><\/code>
<\/span><\/code>
-------------------------------------------------------------------------------------------<\/span><\/code>
\u5982\u679c\u5f00\u542f\u4e86\u9632\u706b\u5899iptables\u89c4\u5219\uff0c\u5219\u8fd8\u9700\u8981\u5728\/etc\/sysconfig\/iptables\u91cc\u6dfb\u52a0\u4e0b\u9762\u4e00\u884c\uff0c\u5373\u5141\u8bb83128<\/span>\u7aef\u53e3\u8bbf\u95ee\uff1a<\/span><\/code>
-A INPUT -s<\/span> 192.168<\/span>.1.0<\/span>\/24<\/span> -p tcp -m<\/span> state<\/span> --state<\/span> NEW -m<\/span> tcp --dport 3128<\/span> -j ACCEPT<\/span><\/code>
--------------------------------------------------------------------------------------------<\/span><\/code>
<\/span><\/code>
\u7136\u540e\u91cd\u542fiptables\u670d\u52a1<\/span><\/code>
<\/span><\/code>[root@openstack squid]# \/etc\/init.d\/iptables restart<\/span><\/span><\/code><\/pre>\n<\/p>\n
1\uff09\u5b89\u88c5squid<\/span><\/code>
yum\u547d\u4ee4\u76f4\u63a5\u5728\u7ebf\u5b89\u88c5squid<\/span><\/code>
[root@openstack ~]# yum install -y gcc openssl openssl-devel #\u4f9d\u8d56\u8f6f\u4ef6\u8981\u5148\u63d0\u524d\u5b89\u88c5<\/span><\/span><\/code>
[root@openstack ~]# yum install squid<\/span><\/span><\/code>
[root@openstack ~]# cd \/etc\/squid\/<\/span><\/span><\/code>
[root@openstack squid]# cp squid.conf squid.conf_bak<\/span><\/span><\/code>
<\/span><\/code>
2\uff09\u73b0\u5728\u5f00\u59cb\u751f\u6210\u52a0\u5bc6\u4ee3\u7406\u8bc1\u4e66:<\/span><\/code>
[root@bastion-IDC squid]# pwd<\/span><\/span><\/code>
\/etc\/squid<\/span><\/code>
[root@bastion-IDC squid]# openssl req -new > lidongbest5.csr<\/span><\/span><\/code>
Generating a 2048 bit RSA private key<\/span><\/code>
..........................................................................+++<\/span><\/code>
.........................................................................................................+++<\/span><\/code>
writing new private key to 'privkey.pem'<\/span><\/code>
Enter PEM pass phrase: #\u8f93\u5165\u5bc6\u7801\uff0c\u540e\u9762\u4f1a\u7528\u5230\uff0c\u6bd4\u5982\u8fd9\u91cc\u8f93\u5165123456<\/span><\/span><\/code>
Verifying - Enter PEM pass phrase:<\/span><\/code>
-----<\/span><\/span><\/code>
You are about to be asked to enter information that will be incorporated<\/span><\/code>
into your certificate request.<\/span><\/code>
What you are about to enter is what is called a Distinguished Name or a DN.<\/span><\/code>
There are quite a few fields but you can leave some blank<\/span><\/code>
For some fields there will be a default value,<\/span><\/code>
If you enter '.', the field will be left blank.<\/span><\/code>
-----<\/span><\/span><\/code>
Country Name (2 letter code) [XX]:cn #\u56fd\u5bb6<\/span><\/span><\/code>
State or Province Name (full name) []:beijing #\u7701\u4efd<\/span><\/span><\/code>
Locality Name (eg, city) [Default City]:beijing #\u5730\u533a\u540d\u5b57<\/span><\/span><\/code>
Organization Name (eg, company) [Default Company Ltd]:huanqiu #\u516c\u53f8\u540d<\/span><\/span><\/code>
Organizational Unit Name (eg, section) []:Technology #\u90e8\u95e8<\/span><\/span><\/code>
Common Name (eg, your name or your server's hostname) []:huanqiu #CA\u4e3b\u673a\u540d<\/span><\/span><\/code>
Email Address []:wangshibo@xqshijie.cn #\u90ae\u7bb1<\/span><\/span><\/code>
<\/span><\/code>
Please enter the following 'extra' attributes<\/span><\/code>
to be sent with<\/span> your certificate request<\/span><\/code>
A challenge password<\/span> []:123456<\/span> #\u8bc1\u4e66\u8bf7\u6c42\u5bc6\u94a5\uff0cCA\u8bfb\u53d6\u8bc1\u4e66\u7684\u65f6\u5019\u9700\u8981\u8f93\u5165\u5bc6\u7801<\/span><\/span><\/code>
An optional company name<\/span> []:huanqiu #-\u516c\u53f8\u540d\u79f0\uff0cCA\u8bfb\u53d6\u8bc1\u4e66\u7684\u65f6\u5019\u9700\u8981\u8f93\u5165\u540d\u79f0<\/span><\/span><\/code>
<\/span><\/code>
[root@bastion-IDC squid]# openssl rsa -in privkey.pem -out lidongbest5.key<\/span><\/span><\/code>
Enter pass phrase for<\/span> privkey.pem: #\u8f93\u5165\u4e0a\u9762\u8bbe\u7f6e\u7684\u5bc6\u7801123456<\/span><\/span><\/code>
writing RSA key<\/span><\/span><\/code>
<\/span><\/code>
[root@bastion-IDC squid]# openssl x509 -in lidongbest5.csr -out lidongbest5.crt -req -signkey lidongbest5.key -days 3650<\/span><\/span><\/code>
Signature ok<\/span><\/code>
subject=\/C=cn\/ST=beijing\/L=beijing\/O=huanqiu\/OU=Technology\/CN=huanqiu\/emailAddress=wangshibo@xqshijie.cn<\/span><\/code>
Getting Private<\/span> key<\/span><\/span><\/code>
<\/span><\/code>