Linux下安装Apache并启用SSL

本文将指导您在Linux环境中安装Apache web服务器,并详细说明如何启用SSL/TLS,以实现网站的安全加密通信。首先,您需要更新系统包,然后安装Apache。接着,您需要获取SSL证书并配置Apache配置文件以启用HTTPS。最后,重启Apache服务以应用更改。通过这些步骤,您的Linux服务器将能够提供安全的HTTPS服务。
摘要由CSDN通过智能技术生成
//系统
# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core)
# uname -r
3.10.0-957.el7.x86_64
# openssl version
OpenSSL 1.0.2k-fips  26 Jan 2017
//关闭SELinux
//关闭firewall或按需打开对应端口
# firewall-cmd --permanent --zone=public --add-service=http
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload
//Apache在默认的CentOS仓库中可用,安装非常简单
# yum -y install httpd
# systemctl enable httpd
# systemctl start httpd
# apachectl -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Apr 24 2019 13:45:48
# whereis httpd
httpd: /usr/sbin/httpd /usr/lib64/httpd /etc/httpd /usr/share/httpd /usr/share/man/man8/httpd.8.gz
//浏览器输入ip或域名测试服务
 http://localhost 
//启用SSL
[在Apache服务器上安装SSL证书](https://help.aliyun.com/document_detail/98727.html?spm=a2c4g.11186623.2.16.66f02242dKtV2j#concept-zsp-d1x-yfb)
//cp申请到的SSL证书到 cert目录
# mkdir /etc/httpd/cert
# tree -N cert/
cert/
├── webb.hgtop.xyz_chain.c
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值