Apace配置+http重定向到https

一、配置APache

  1. 打开apache安装目录下的 ssl.conf 配置以下内容
java 复制代码
<VirtualHost *:443>

# General setup for the virtual host, inherited from global configuration
#DocumentRoot "/var/www/html"
ServerName www.pwx.com
# 古籍检索系统 ,重定向到tomcat 中古籍检索系统项目
ProxyPass /record http://127.0.0.1:8080/record
ProxyPassReverse /record http://127.0.0.1:8080/record


ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn

SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite DEFAULT:!EXP:!SSLv2:!DES:!IDEA:!SEED:+3DES
SSLCertificateFile /etc/httpd/conf/cert/www.pwxvr.com_public.crt
SSLCertificateKeyFile /etc/httpd/conf/cert/www.pwxvr.com.key
SSLCertificateChainFile /etc/httpd/conf/cert/www.pwxvr.com_chain.crt


</VirtualHost>                  

2.打开apache安装目录下的 httpd.conf 配置以下内容

java 复制代码
<VirtualHost *:8081>
  
    DocumentRoot   /var/www/html
   
	RewriteEngine on
    RewriteCond %{SERVER_PORT} !^443$
    RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]

</VirtualHost>
相关推荐
IpdataCloud13 小时前
IP查询高精度怎么选?8个指标判断是否适合你
网络·网络协议·tcp/ip
聊点儿技术13 小时前
IP风险等级评估是什么?跨境电商业务场景全解析
网络·网络协议·tcp/ip
路溪非溪14 小时前
网络运输层:TCP协议详解(一)
网络·网络协议·tcp/ip
困惑阿三16 小时前
Nginx 域名绑定与 HTTPS 配置指南
运维·nginx·https·ssl
凯勒姆16 小时前
主流网络协议
网络·网络协议
郝学胜-神的一滴16 小时前
Linux 高并发基石:epoll 核心原理 + LT/ET 触发模式深度剖析
linux·运维·服务器·开发语言·c++·网络协议
treesforest17 小时前
Ipdatacloud IP 地址查询方案适合哪些场景?
大数据·网络·数据库·网络协议·tcp/ip·ip
追兮兮17 小时前
基于 GD32 与 LwIP 的 TCP OTA 固件升级实现
网络·网络协议·tcp/ip·tcp·gd32·ota
Hello_Embed18 小时前
嵌入式上位机开发入门(二十八):JSON 与 JsonRPC 入门
网络·笔记·网络协议·tcp/ip·嵌入式
东北甜妹18 小时前
TCP/IP和VLAN
网络协议·tcp/ip·面试