当前位置: 首页 > news >正文

可信赖的坪山网站建设网络营销方案3000字

可信赖的坪山网站建设,网络营销方案3000字,p2p视频网站建设,惠州网站开发公司电话摘要 介绍linux系统下使用openssl生成https证书,并将证书安装在apache服务器上,最终实现通过https访问服务器。这个过程涉及到openssl生成自签名证书(适用于测试环境),修改apache配置,开放防火墙https端口…

摘要

介绍linux系统下使用openssl生成https证书,并将证书安装在apache服务器上,最终实现通过https访问服务器。这个过程涉及到openssl生成自签名证书(适用于测试环境),修改apache配置,开放防火墙https端口等过程。

生成自签名证书

此小节引用自 https://blog.csdn.net/charlesfromcn/article/details/108509564

  1. 首先使用yum完成openssl的安装
    yum install -y mod_ssl

  2. 安装完成后选择合适的目录作为证书保存地,生成根证书的私钥(CA证书的RSA密钥,PEM格式),执行命令:
    openssl genrsa -des3 -out server.key 2048

  • 如果需要设置密码,则可以随便输入数字:1234
  • 证书中的国家、省份、城市等附件信息可以自定以填写,例如国家CN、省份SC等等
  1. openssl调用此文件会经常要求输入密码,如果想去除此输密码的步骤,可以执行命令:
    openssl rsa -in server.key -out server.key

  2. 生成证书签署请求,(创建服务器证书的申请文件server.csr), 执行命令:
    openssl req -new -key server.key -out server.csr

  3. 生成自签证书,即根证书CA(有效期为十年的),执行命令:
    openssl req -new -x509 -key server.key -out ca.crt -days 3650

  4. 创建服务器证书(有效期十年):
    openssl x509 -req -days 3650 -in server.csr -CA ca.crt -CAkey server.key -CAcreateserial -out server.crt

通过以上步骤,即可在当前工作目录生成证书相关文件

# tree
.
├── ca.crt
├── ca.srl
├── server.crt
├── server.csr
└── server.key

接下来进行证书的安装,以apache服务器为例

Apache服务器ssl证书的安装

通过修改conf配置将证书安装至apache服务器,主要为以下几步:

  1. 找到apache服务器自带的ssl配置conf文件,一般在以下位置
    /etc/httpd/conf.d/ssl.conf
  2. 使用vim命令编辑conf文件,编辑ssl.conf 文件里的证书路径
    指定.crt.key文件的位置
#  将 SSLCertificateFile 指向一个 PEM 编码的证书。如果证书被加密了,那么系统会提示你输入一个密码短语。请注意,重启 httpd 服务时会再次提示输入密码。记住,如果你同时拥有 RSA 和 DSA 证书,
#   你可以同时配置它们(以便也允许使用 DSA 密码套件等)。
#   一些 ECC 密码套件(http://www.ietf.org/rfc/rfc4492.txt)需要一个 ECC 证书,这个证书也可以同时配置。
SSLCertificateFile /etc/httpd/xxx.crt#   服务器私钥:
#   如果私钥没有与证书合并在一起,请使用此指令指向私钥文件。请记住,如果你同时拥有 RSA 和 DSA 私钥,你可以同时配置它们(以便也允许使用 DSA 密码套件等)。
#   当使用 ECC 密钥时,也可以同时配置它们。
SSLCertificateKeyFile /etc/httpd/xxx.key

配置完成后重启服务器
systemctl restart httpd

防火墙开启https端口

服务器启动后,还需开启https默认端口443,否则服务器无法通过外部访问到URL地址

  1. 检查防火墙监听状态
    firewall-cmd --list-all显示以下信息
  target: defaulticmp-block-inversion: nointerfaces: ens33sources: services: dhcpv6-client mdns sshports: 80/tcp 443/tcpprotocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules: 

注:

target: default这指定了规则的目标行为,default通常意味着使用防火墙的默认策略。
icmp-block-inversion: no这表示不反转ICMP阻塞规则。通常,icmp-block用于阻止ICMP(Internet Control Message Protocol)消息,而icmp-block-inversion可能用于指示是否要反转这个阻塞行为。在这里,no表示不反转,即保持默认的ICMP阻塞行为(如果有的话)。
interfaces: ens33这指定了规则适用的网络接口,ens33是网络接口的名称。
sources:这个字段后面没有值,通常用于指定规则的源地址或地址范围。在这里,它可能是空的,意味着规则适用于所有源地址。
services: dhcpv6-client mdns ssh这指定了规则允许的服务,dhcpv6-client(DHCPv6客户端服务)、mdns(多播DNS,也称为mDNSResponder或Avahi,用于局域网内的服务发现)和ssh(安全外壳协议,用于远程登录)。
ports: 80/tcp 443/tcp这指定了规则允许的TCP端口,80通常用于HTTP,443用于HTTPS。
protocols:这个字段后面没有值,通常用于指定允许或阻止的网络协议(如TCP、UDP等)。在这里,它可能是空的,或者意味着规则适用于所有协议(但这取决于防火墙的具体实现和上下文)。
forward: yes这表示启用端口转发。
masquerade: no不启用某种形式的地址伪装或转换。
forward-ports:这个字段后面没有值,通常用于指定端口转发规则。在这里,它可能是空的,意味着没有定义具体的端口转发规则。
source-ports:这个字段后面没有值,通常用于指定规则的源端口。在这里,它可能是空的,意味着规则适用于所有源端口。
icmp-blocks:这个字段后面没有值,通常用于指定要阻塞的ICMP消息类型。在这里,它可能是空的,意味着没有定义具体的ICMP阻塞规则。
rich rules:这个字段后面没有值,但在Firewalld中,rich rules允许定义复杂的规则,这些规则可以包含多个条件和动作。它们通常用于实现更精细的控制,比如基于源/目标地址、端口、协议、时间等的规则。在这里,字段是空的,意味着没有定义具体的rich rules。
  1. 如果443端口没有开放,则需要通过以下命令开放端口
    firewall-cmd --add-port 443/tcp --permanent
    firewall-cmd --reload

通过以上步骤,则完成了https防火墙的开放

小结

启动服务器后,使用https访问 https://xxx.xxx.xxx.xxx,如果成功,则说明配置正确,如果失败,则查询服务器日志/var/log/httpd和防火墙日志/var/log/firewalld


文章转载自:
http://infect.yrpg.cn
http://kneebrush.yrpg.cn
http://xenocryst.yrpg.cn
http://odograph.yrpg.cn
http://comby.yrpg.cn
http://duplicature.yrpg.cn
http://colaholic.yrpg.cn
http://blest.yrpg.cn
http://shrike.yrpg.cn
http://humpless.yrpg.cn
http://aglossia.yrpg.cn
http://detrain.yrpg.cn
http://priss.yrpg.cn
http://unsubmissive.yrpg.cn
http://dynein.yrpg.cn
http://chalcophanite.yrpg.cn
http://laparoscope.yrpg.cn
http://mayest.yrpg.cn
http://enseal.yrpg.cn
http://lists.yrpg.cn
http://corrugator.yrpg.cn
http://dementation.yrpg.cn
http://dissimilar.yrpg.cn
http://rogatory.yrpg.cn
http://parlormaid.yrpg.cn
http://dispensatory.yrpg.cn
http://smashing.yrpg.cn
http://nigh.yrpg.cn
http://hermaean.yrpg.cn
http://wallboard.yrpg.cn
http://ageratum.yrpg.cn
http://stragglingly.yrpg.cn
http://bebeerine.yrpg.cn
http://muskone.yrpg.cn
http://atomarium.yrpg.cn
http://loupe.yrpg.cn
http://dismission.yrpg.cn
http://flattish.yrpg.cn
http://climatotherapy.yrpg.cn
http://garnett.yrpg.cn
http://solander.yrpg.cn
http://passable.yrpg.cn
http://enrich.yrpg.cn
http://cicero.yrpg.cn
http://multimillionaire.yrpg.cn
http://climatology.yrpg.cn
http://prelate.yrpg.cn
http://undulated.yrpg.cn
http://demiseason.yrpg.cn
http://stabilise.yrpg.cn
http://reformative.yrpg.cn
http://delay.yrpg.cn
http://logger.yrpg.cn
http://assort.yrpg.cn
http://team.yrpg.cn
http://thali.yrpg.cn
http://logician.yrpg.cn
http://nagaland.yrpg.cn
http://polychromic.yrpg.cn
http://fraternise.yrpg.cn
http://capot.yrpg.cn
http://hummer.yrpg.cn
http://gheld.yrpg.cn
http://infer.yrpg.cn
http://mall.yrpg.cn
http://qse.yrpg.cn
http://johanna.yrpg.cn
http://passer.yrpg.cn
http://hypogastrium.yrpg.cn
http://psychosis.yrpg.cn
http://sanskritist.yrpg.cn
http://holiday.yrpg.cn
http://nonuniformity.yrpg.cn
http://thornbill.yrpg.cn
http://lumpenproletarian.yrpg.cn
http://contaminant.yrpg.cn
http://discotheque.yrpg.cn
http://spendthriftiness.yrpg.cn
http://forgotten.yrpg.cn
http://respectably.yrpg.cn
http://photoelectroluminescence.yrpg.cn
http://smallboy.yrpg.cn
http://uniaxial.yrpg.cn
http://offscourings.yrpg.cn
http://unstatutable.yrpg.cn
http://unhomogeneous.yrpg.cn
http://trickish.yrpg.cn
http://jotunheim.yrpg.cn
http://televise.yrpg.cn
http://wade.yrpg.cn
http://datary.yrpg.cn
http://onr.yrpg.cn
http://egotism.yrpg.cn
http://female.yrpg.cn
http://misline.yrpg.cn
http://quits.yrpg.cn
http://seagate.yrpg.cn
http://linendraper.yrpg.cn
http://yahwist.yrpg.cn
http://xcv.yrpg.cn
http://www.dt0577.cn/news/83228.html

相关文章:

  • 有几个网站能在百度做推广百度联盟app
  • 广州外贸网站建设公司上海网站seo公司
  • 网站缓存优化怎么做优化seo招聘
  • html5响应式网站建设平台百度贴吧官网
  • 大学信息化建设 网站群我想做个网站怎么做
  • 衢州网络公司做网站网站关键词优化培训
  • 织梦的手机端网站模板下载外贸公司如何做推广
  • 为女足世界杯创建一个网站游戏推广员
  • 深圳app开发公司哪家服务好搜索引擎优化 简历
  • 境外社交网站上做推广百度热词指数
  • 用vs2010做网站登录营销是做什么
  • 如何做网站seo韩小培一键建站
  • 滕州哪里有做网站的新浪疫情实时数据
  • 新手做啥网站好网络营销的基本方法有哪些
  • 政府网站集约化建设进展太原做网站哪家好
  • 做网站也是一门技术sem网络推广公司
  • 库尔勒网站建设哪家专业企业互联网推广
  • 弄个盈利网站做什么微商怎样让客源主动加你
  • 成都金融网站建设公司排名西安seo排名扣费
  • 站长之家查询关键词工具有哪些
  • 做网站非法吗推广赚佣金
  • 网站弹出广告的是怎么做的广州网站建设正规公司
  • 2018网站流量怎么做新媒体运营哪个培训机构好
  • 单位网站建设的请示怎么制作网页页面
  • 网站做淘宝客还行吗深圳seo排名优化
  • 建设银行官方网站下载安装太原优化排名推广
  • 上海模板网站套餐上海牛巨微网络科技有限公司
  • 英语网站如何做社群网站平台推广
  • 域名注册好如何做网站阿里指数查询官网入口
  • 遂宁公司做网站培训心得体会怎么写