Zabbix-Web启用安全链接ssl
前端设置
- 安装mod_ssl
sudo yum install mod_ssl -y
- 创建ssl-keys
# mkdir for private key
sudo mkdir -p /etc/httpd/ssl/private
# change mod 700
sudo chmod 700 /etc/httpd/ssl/private
# create ssl key
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/httpd/ssl/private/zabbix-web.key -out /etc/httpd/ssl/zabbix-web.crt
- 配置Apache ssl
cd /etc/httpd/conf.d/ && sudo cp ssl.conf ssl.conf.old
sudo vi ssl.conf
# change
SSLCertificateFile /etc/httpd/ssl/zabbix-web.crt
SSLCertificateKeyFile /etc/httpd/ssl/private/zabbix-web.key
# restart apache service
sudo systemctl restart httpd
启用ssl
cd /etc/httpd/conf && sudo cp httpd.conf httpd.conf.old
# add replace server_address use your server_name
<VirtualHost *:*>
ServerName server_address
Redirect permanent / http://server_address
</VirtualHost>
# restart apache service
sudo systemctl restart httpd
禁用显示Web服务器信息
sudo vi /etc/httpd/conf/httpd.conf
# add
ServerSignature Off
ServerTokens Prod
添加防火墙策略
如果启用了防火墙,还需要同时开放80和443端口号
firewall-cmd --zone=public --add-rich-rule='rule family=ipv4 source address=192.168.0.1/24 port port=443 protocol=tcp accept' --permanent
使用https打开web
我们使用的是自己创建的密钥和证书,未经过证书机构,打开的时候会提示Your connection is not private,点击继续访问即可
ssl_web
网友评论