CA证书(网络建设与运维)

下载openssl*软件包

yum install -y openssl*

之后cd到/etc/pki/CA/文件夹中创建证书

cd /etc/pki/CA

openssl genrsa -out private/cakey.pem 2048

openssl req -new -x509 -key private/cakey.pem -out cacert.pem -days 3650

根据题目输入证书信息

在创造申请证书

openssl genrsa -out skills.key 2048

openssl req -new -key skills.key -out skills.csr

根据题目填写申请证书信息

创造一个文件

vim sign.cnf

subjectAltName=DNS:*skills.com,DNS=skills.com

openssl ca -in skills.csr -out skills.crt -days 1825 -extfile sign.cnf

配置http服务

yum install -y httpd* mod_ssl*

vim /etc/httpd/conf/httpd.conf

在最后一行编辑80端口的http

<VirtualHost*:80> 定义http 80 网站 疑问:http每个选项的用意以及用法

DocumentRoot "/var/www/html"

ServerName linux1.skills.com

RewriteEngine On

RewriteRule ^/(.*) https://www.skills.com/1 [R=301] 自动跳转域名www.skills.com

<Directory "/">

Requrie all granted

</Directory>

</VirtualHost>

<VirtualHost *:80> http 80端口ip禁止访问代码

ServerName 10.4.220.101

Redirect 403/

</VirtualHost>

配置https服务

vim /etc/httpd/conf.d/ssl.conf

将开头defualt_改成*

定义目录和域名

然后定义证书和私钥

在最后一行编辑

<VirtualHost *:443> https 443端口ip禁止访问代码

ServerName 10.4.220.101

sslengine on

sslcertificatefile /etc/ssl/skills.crt

sslcertificatekeyfile /etc/ssl/skills.key

redirect 403 /

</VirtualHost>

openssl pkcs12 -export -inkey skills.key -in skills.crt -out skills.pfx

openssl pkcs12 -in skills.pfx -out skills.pem -nodes

openssl rsa -in skills.pem -out apache.key

openssl x509 -in skills.pem -out apahce.crt

将cacert.pem和skills.pfx导入到桌面当中,把cacert.pem的后缀改成cer然后安装证书,安装到受信任根证书

pfx证书导入到浏览器的个人证书里面.

tomcat服务以及nginx服务的http,https,反向代理

{虚拟机3和4安装

yum install -y java-17-openjdk* tomcat*

然后再3和4上编辑在最后一行

vim /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-17

export PATH=JAVA(下划线)Home/bin:PATH

source /etc/profile #资源加载

vim /usr/lib/systemd/system/tomcat.service #3和4虚拟机的tomcat配置文件将tomcat改成root用户

vim /etc/tomcat/server.xml} ; #详细内容去word文档查看

相关推荐
网络空间小黑4 小时前
TCP/IP 知识体系
网络·网络协议·tcp/ip·计算机网络·5g·wireshark·信息与通信
Dotrust东信创智5 小时前
面向SDV的在环测试深度解析——仿真中间件SIL KIT应用篇
网络·中间件·汽车
leoufung6 小时前
ECPF 简介
linux·网络·kernel
救救孩子把8 小时前
MCP本地高效与云端实时:stdio 与 HTTP+SSE 传输机制深度对比
网络·网络协议·http·sse·mcp·stdio
hao_wujing8 小时前
衡量 5G 和未来网络的安全性
网络·5g
哞哞不熬夜9 小时前
JavaEE--初识网络
java·网络·java-ee
什么半岛铁盒9 小时前
Linux信号的保存
linux·运维·网络
百锦再9 小时前
大数据技术的主要方向及其应用详解
大数据·linux·网络·python·django·pygame
小疆智控12 小时前
数字化工厂升级引擎:Modbus TCP转Profinet网关助力打造柔性生产系统
服务器·网络·tcp/ip
xiao--xin13 小时前
计算机网络笔记(二十七)——4.9多协议标签交换MPLS
网络·笔记·计算机网络·mpls