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>
相关推荐
夜雪一千5 小时前
TCP数据包长什么样?拆解TCP报文头部结构
网络·网络协议·tcp/ip
别催小唐敲代码7 小时前
STM32 I2C协议详解:从原理到实战
stm32·网络协议·协议
10WTW0112 小时前
NTP协议
网络协议·计算机网络·ntp·ntp协议
weixin_7275356214 小时前
HTTP 八股文:从三次握手到浏览器渲染的硬核拆解
网络·网络协议·http
复园电子15 小时前
USB Over IP技术详解:基于USB服务器实现USB设备远程访问、重定向与集中管理
服务器·网络协议·tcp/ip
TlSfoward15 小时前
TLSFoward 能帮你看到什么 TLSFOWARD抓包工具
服务器·爬虫·网络协议·https
2501_9160074715 小时前
Python实现HTTPS爬虫的完整指南:使用requests、BeautifulSoup、Selenium和Scrapy
爬虫·python·ios·小程序·https·uni-app·iphone
kaixin_learn_qt_ing16 小时前
单网卡绑定多个 IP 地址
网络·网络协议·tcp/ip
久久学姐16 小时前
Python开发爬虫的常用技术架构
爬虫·python·http·框架·数据存储
摇曳的精灵17 小时前
HTTP 与 MCP:不是替代,而是分层
网络·网络协议·http·mcp