2019年3月1日金曜日

yum proxy経由で使う。

【プロキシサーバの設定】
# dnf install squid
# vi /etc/squid/squid.conf
# add by takahab for dnf proxy                        ※末尾に追加
shutdown_lifetime 0 seconds
http_port 3128
http_port 0.0.0.0:3128
http_access allow all

# firewall-cmd --add-port=3128/tcp --zone=public --permanent
# firewall-cmd --reload
# systemctl restart squid
# systemctl enable squid

【プロキシサーバの設定】
# yum install squid
# vi /etc/squid/squid.conf
#http_access deny all
#http_port 3128
http_port 3128
acl myacl src 142.1.5.250/255.255.255.255
http_access allow myacl
http_access deny all
header_access X-Forwarded-For deny all
header_access Via deny all
header_access Cache-Control deny all

# systemctl restart squid
# firewall-cmd --add-port=3128/tcp --zone=public --permanent
# firewall-cmd --reload
# systemctl enable squid

【クライアントの設定】
yum のプリキシ設定
# vi /etc/yum.conf
proxy=http://192.168.1.1
#proxy=http://192.168.1.1
#proxy_username=user_name
#proxy_password=password

シャットダウン時の後処理 (shutdown)

# vi /etc/systemd/system/drop.service [Unit] Description= stop httpgwd DefaultDependencies=no Before=shutdown.target RefuseManualStart=true ...