linux 服务器类型Apache配置https访问

一:查看服务器类型,下载相应的SSL证书

命令:netstat -anp | grep :80

httpd是Apache超文本传输协议(HTTP)服务器的主程序,所以下载Apache证书

二:将证书解压后复制到服务器上

三个文件:xxx.key xxx_public.cert xxx_chain.cert

三:准备工作完成,配置

1.命令: yum -y install mod_ssl 安装 mod_ssl.so 模块,安装完成后

A可以在 /etc/httpd/modules 目录下找到 mod_ssl.so 文件

B可以在 /etc/httpd/conf.d 目录下会出现一个ssl.conf文件

2.打开ssl.conf文件,找到三个配置,修改为你放置的证书路径

SSLCertificateFile /etc/pki/tls/certs/xxx_public.crt

SSLCertificateKeyFile /etc/pki/tls/private/xxx.key

SSLCertificateChainFile /etc/pki/tls/certs/xxx_chain.crt

3.修改443端口的设置

<VirtualHost _default:443>

#设置在这里

ServerName xxx.cn

DocumentRoot "/home/project/"

<Directory "/home/project">

Options +Includes -Indexes

AllowOverride All

Order allow,deny

Allow from all

Require all granted

</Directory>

</VirtualHost>

4.打开/etc/httpd/conf.modules.d/00-ssl.conf文件

#LoadModule ssl_module modules/mod_ssl.so 并将前面的#号去掉

5.在/etc/httpd/conf/httpd.conf文件的最后引入之前配置好的文件

Include /etc/httpd/conf.d/ssl.conf

Include /etc/httpd/conf.modules.d/00-ssl.conf

6.重启Apache然后访问你的域名

命令:systemctl restart httpd

相关推荐
i***486111 分钟前
【漏洞复现】CVE-2019-11043(PHP远程代码执行漏洞)信息安全论文_含漏洞复现完整过程_含Linux环境go语言编译环境安装
linux·golang·php
r***998233 分钟前
使用 Certbot 为 Nginx 自动配置 SSL 证书
运维·nginx·ssl
百***66174 小时前
linux上redis升级
linux·运维·redis
z***56564 小时前
Nginx(搭建高可用集群)
运维·nginx·firefox
小糖学代码5 小时前
网络:4.1加餐 - 进程间关系与守护进程
linux·网络
m***66735 小时前
【Sql Server】sql server 2019设置远程访问,外网服务器需要设置好安全组入方向规则
运维·服务器·安全
天草二十六_简村人5 小时前
docker安装index-tts,实现文本转语音的本地私有化部署
运维·docker·ai·容器·ai编程
xinxinhenmeihao5 小时前
隧道代理和住宅IP有何不同》各有什么优缺点?
服务器·网络·tcp/ip
观望过往5 小时前
Docker 全面技术指南:从基础概念到企业级应用实践
运维·docker·容器
小小测试开发6 小时前
JMeter高级用法全解析:从性能测试到自动化监控,解锁压测工具的隐藏实力
运维·jmeter·自动化