反馈已提交

网络繁忙

You are viewing 5.1 help doc. More details are displayed in the latest help doc.

Access FineBI via IP Address with Tomcat

  • Recent Updates: August 25, 2022
  • Ⅰ. Overview

    1. Problem description

    Usually after finishing Tomcat Server Deployment , start the server, the user needs to Access URL: http://IP:port/webroot/decision to enter the data decision system. Sometimes users want to be able to access the data decision system directly through IP.

    2. Solutions

    By modifying the port number and establishing a virtual directory to access IP (for example: http://localhost), you can directly enter the data decision system.

    Ⅱ. Operation steps

    Take visiting http://localhost as an example for introduction.

    1. Modify the port number

    If there are no other network programs occupying port number 80, you can set the port number of the Tomcat server to 80.

    Port 80 is the default port, and users do not need to add the port number of the Tomcat server when accessing the report page.

    1) Open the %Tomcat_Home%\conf\server.xml file and modify the port number 8080 to 80, as shown in the following figure:

    1575268863332711.png

    The code looks like this:

    <Connector port="80" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />

    2) Restart the Tomcat server and visit http://localhost/webroot/decision to enter the data decision system.

    2. Setting the welcome screen

    Each web server has a default welcome screen, which can be modified to display the platform page.

    Create a new a.jsp file in the %Tomcat_Home%\webapps\webroot directory as the default home page of the web server, as shown in the following figure Show:

    1) PC-side and App-side setting interface

    For file download, please refer to: a.zip

    a.jsp calls the iframe integration interface, the code is as follows:

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <html>
      <head>
        <title>FineBI商業智能</title>
        <link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/>
      </head>
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
        <iframe id="reportFrame" src="decision" allowfullscreen="true"
          name="itemslist" frameborder="0" width="100%" height="100%"></iframe>
      </body>
    </html>

    Note: <link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/> this line of code  is used to solve the problem that the map is displayed abnormally after the full screen of the chart toolbar in the decision-making system.

    Restart the Tomcat server and visit http://localhost/webroot/a.jsp to display the data decision system login page.

    2) HTML5 side setting interface

    Please refer to the file download:  ab.zip

    The code looks like this:

    <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
    <html>
      <head>
        <title>FineReport報表</title>
        <link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/>
         <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1, maximum-scale=1.0, user-scalable=no">
      </head>
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
        <iframe id="reportFrame" src="decision" allowfullscreen="true"
          name="itemslist" frameborder="0" width="100%" height="100%"></iframe>
      </body>
    </html>

    Note: HTML5 side settings need to be installed HTML5 side access Dashboard/Project 

    3. Create a virtual directory

    Create a virtual directory by modifying the configuration file.

    1) Adjust the project path

    Report Engineering webroot is placed in the %Tomcat_home%\webapps directory by default, and the project will be loaded when the server is started. After the virtual directory is created, when the Tomcat server is started, the webroot  project will be loaded again through the configuration file. The webroot project is loaded twice, and there will be errors, server crashes, etc.

    Therefore, users need to move the webroot project in the %Tomcat_Home%\webapps directory to a location other than the Tomcat deployment directory, and it needs to be in the same location as the Tomcat project. path under the disk.

    This article moves the %Tomcat_home%\webapps\webroot folder to the D:\webroot path. As shown below:

    2) Modify the server.xml file

    Modify the %Tomcat_Home%\conf\server.xml file and add the code between the host tags in the server.xml file, as follows As shown in the figure:

    1593760547493543.png

    The code looks like this:

    <Context path="" docBase="D:\webroot" debug="0" reloadable="true" />

     Description:

    parameterillustrate
    path

    the name of the virtual directory

    Leave this key blank if you want to display the home page after entering an IP address

    docBase

    the path to the virtual directory

    The webroot path set in step 2.3.1 in this article, this article is D:\webroot

    debug0
    reloadabletrue

    3) Modify the web.xml file

    First check whether there is a web.xml file in the %tomcat_home%\conf\web.xml path.

    If there is a web.xml file, edit the file directly, add a piece of code before the </web-app> tag at the end of the file to display the custom welcome interface a.jsp, the code is as follows:

    <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>a.jsp</welcome-file>
      <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    If there is no web.xml file, you need to create a new web.xml file in the webroot\WEB-INF directory. The code is as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app 
       xmlns="http://java.sun.com/xml/ns/j2ee" 
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" 
       version="2.4"> 
      <display-name>Template WebApp</display-name>
      
        <mime-mapping>
      <extension>msi</extension>
      <mime-type>application/x-msi</mime-type>
      </mime-mapping>
      
      <welcome-file-list>  
        <welcome-file>index.html</welcome-file>  
        <welcome-file>index.htm</welcome-file>  
        <welcome-file>a.jsp</welcome-file>  
        <welcome-file>index.jsp</welcome-file>  
      </welcome-file-list>  
    </web-app>

    4. Effect preview

    1) PC side

    Restart the Tomcat server, visit http://localhost, to enter a. jsp page, you can access the data decision system, as shown below:

    Note: This article accesses this machine, so use http://localhost, and the actual access address is  http://IP .

    2) Mobile terminal (HTML5 access)

    Restart the Tomcat server and visit http://IP , as shown below:

    Note: For App-side access, please refer to Section 3.2 of this article.

    Ⅲ. Enter the server address

    1. Remote Design

    When using the report Remote Design  when entering the server address, webroot requires If omitted, the decision should be reserved, as follows:

    Options  Value  
    hostname/IP  Fill in according to the actual situation
    The port number  80
    web application null
    Serverlet decision
    Username Password Fill in according to the actual situation

    An example of configuring the working directory is shown in the following figure:

    2. App side

    When entering the server address on the mobile terminal, the webroot needs to be omitted, and the decision needs to be retained. 

    As follows:

    Options  Value  
      hostname/IP  Fill in according to the actual situation
      port number  80
      Web Apps  Empty
     Serverlet decision
     username\password Fill in according to the actual situation

    An example of configuring the working directory is shown in the following figure:

    Ⅳ. Notes

    After successful login, the homepage will report an error 404.

    Problem description

    After successfully accessing the data decision system through IP, an error 404 is reported on the home page, as shown in the following figure:

    Solution

    Modify the homepage path in the "Manage > Directory" node, change /webroot/Demo.htmlModified to/Demo.html, as shown below:

    Attachment List


    Theme: Deployment Integration
    Already the First
    Already the Last
    • Helpful
    • Not helpful
    • Only read

    售前咨询电话

    400-811-8890转1

    在线技术支持

    在线QQ:800049425

    热线电话:400-811-8890转2

    总裁办24H投诉

    热线电话:173-1278-1526

    文 档反 馈

    鼠标选中内容,快速反馈问题

    鼠标选中存在疑惑的内容,即可快速反馈问题,我们将会跟进处理。

    不再提示

    10s后关闭