ofbiz总结——关于https=false配置使得项目可以项目可以通过http协议访问

来源:互联网 发布:linux怎么帮编写脚本 编辑:程序博客网 时间:2024/06/06 01:09

因为使用https协议访问项目,浏览器经常提示证书不安全什么的,有些用户小白就不知道点击继续访问,而是直接点击关闭页面了。之后就反馈系统用不了。

所以对项目进行配置,使项目支持http协议访问。

<request-map uri="main"><security https="false" auth="true"/><response name="success" type="view" value="main"/></request-map>
主要是上面配置的security标签,这个必须要配置,不然http就访问不了。配置为https="false",那么就可以使用http访问了。具体端口配置需要修改下面2个文件

apache-ofbiz-16.11.02\framework\webapp\config\url.properties

# If you want to use HTTP then set no.http=N. Else all requests will use HTTPS (also enforced by a HSTS header) except if put in the http.request-map.list  no.http=Nhttp.request-map.list=SOAPService,xmlrpc# HTTPS Port (Secure port)port.https.enabled=Y# empty by default see OFBIZ-9206port.https=8089force.https.host=# HTTP Port (Not Secure port)port.http=8088force.http.host=

apache-ofbiz-16.11.02\framework\catalina

<property name="http-connector" value="connector">            <!-- see http://tomcat.apache.org/tomcat-8.0-doc/config/http.html for reference -->            <!--<property name="address" value=""/>-->            <property name="port" value="8088"/>            <property name="protocol" value="HTTP/1.1"/>
<property name="https-connector" value="connector">            <!-- see http://tomcat.apache.org/tomcat-8.0-doc/config/http.html for reference -->            <!--<property name="address" value=""/>-->            <property name="port" value="8089"/>            <property name="protocol" value="HTTP/1.1"/>            <property name="scheme" value="https"/>

注意:因为我知道security标签的https属性默认值是false,刚好有个页面不需要登录权限。所以我就吧security标签去掉了,然后去测试http方式访问,结果总是报404错误.

这个security标签必须的要,才会将https值默认为false,否则只能使用https访问。



在v16.11版本的【web.xml】中,有如下配置,注意【secure】的配置
    <session-config>
        <session-timeout>60</session-timeout><!-- in minutes -->
        <cookie-config>
          <http-only>true</http-only>
          <!--<secure>true</secure>-->
        </cookie-config>
        <tracking-mode>COOKIE</tracking-mode>
    </session-config>

现象
此配置会导致当前模块页面访问一直要求使用https模式,
若在【url.properties】文件设置了【port.https.enabled=N】,页面将一直要求登录,频繁登录


解决
注释掉【secure】标签的配置即可。
=========================================================================================================================
ofbiz v16.11 版本启动后日志打印一次,控制台显示日志太少了,看不到debug.info或是error类错误
java 启动:正常按【log4j2.xml】配置打印日志到控制台,同时输出到日志文件
gradlew 启动:只打印出默认的日志,没有任何多余的日志出现。

阅读全文
0 0
原创粉丝点击