Apace配置+http重定向到https

一、配置APache

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

<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 配置以下内容


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

</VirtualHost>

相关推荐

  1. Apace配置+http定向https

    2024-04-24 08:08:03       54 阅读
  2. 使用 Nginx 将 HTTP 定向 HTTPS

    2024-04-24 08:08:03       26 阅读
  3. 在 Nginx 中将 HTTP 定向 HTTPS

    2024-04-24 08:08:03       18 阅读
  4. http请求定向

    2024-04-24 08:08:03       22 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-24 08:08:03       18 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-24 08:08:03       19 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-24 08:08:03       18 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-24 08:08:03       20 阅读

热门阅读

  1. MODBUS

    2024-04-24 08:08:03       16 阅读
  2. SecretFlow之SCQL部署(P2P方案)避雷纯享版

    2024-04-24 08:08:03       58 阅读
  3. 抖音视频笔记

    2024-04-24 08:08:03       15 阅读
  4. 拦截pytorch算子,dump输入输出

    2024-04-24 08:08:03       22 阅读
  5. 我是一名程序员而且我很蠢

    2024-04-24 08:08:03       14 阅读
  6. Spring Boot实现接口签名验证

    2024-04-24 08:08:03       17 阅读
  7. PHP 与 MySQL 数据库集成教程

    2024-04-24 08:08:03       58 阅读
  8. StorCli工具学习记录

    2024-04-24 08:08:03       14 阅读
  9. 机器学习之sklearn基础教程

    2024-04-24 08:08:03       19 阅读
  10. 前端技巧——webgl快速上手

    2024-04-24 08:08:03       18 阅读