redis/client-install.sh

raw link view readme
1 yum install firewalld -y
2 systemctl start firewalld
3 systemctl enable firewalld
4 firewall-cmd --permanent --zone=public --add-interface=eth0
5 firewall-cmd --reload
6
7 yum install stunnel -y
8
9 cat > /etc/stunnel/stunnel.conf << EOF
10 cert = /etc/pki/tls/certs/stunnel.pem
11 ; Allow only TLS, thus avoiding SSL
12 sslVersion = TLSv1
13 chroot = /var/run/stunnel
14 setuid = stunnel
15 setgid = stunnel
16 pid = /stunnel.pid
17 socket = l:TCP_NODELAY=1
18 socket = r:TCP_NODELAY=1
19
20 [redis]
21 client = yes
22 accept = 127.0.0.0.1:6379
23 connect = 10.1.100.1:6379
24 TIMEOUTclose = 0
25 EOF
26
27 cat > /etc/systemd/system/stunnel.service << EOF
28 [Unit]
29 Description=SSL tunnel
30 After=syslog.target
31
32 [Service]
33 ExecStart=/usr/bin/stunnel /etc/stunnel/stunnel.conf
34 ExecStop=/bin/kill -9
35 ExecStatus=pgrep stunnel
36 Type=forking
37
38 [Install]
39 WantedBy=multi-user.target
40 EOF
41
42 systemctl start stunnel
43 systemctl enable stunnel
44