Direct Access to FineBI Through IP in Tomcat

  • Last update:  2023-03-31
  • Overview

    Description

    When starting the Tomcat server after Tomcat Server Deployment, you often need to visit the URL: http://{IP}:{port}/webroot/decision to enter the data decision-making system. You want to access the data decision-making system directly through IP.

    Solution

    Modify the port number and establish a virtual directory to directly enter the data decision-making system through IP (for example: http://localhost).

    Procedure

    For example, this article will introduce how to access http://localhost.

    Modifying Port Number

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

    Set Port 80 as the default port, you do not need to add the port number of the Tomcat server when accessing the report page.

    1. Open the file server.xml in the directory %Tomcat_Home%\conf, and modify the port number 8080 to 80.

    The code is as follows:

    <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-making system.

    Setting the Welcome Interface

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

    Create a new file a.jsp in the directory %Tomcat_Home%\webapps\webroot as the default home page of the Web server.

    Setting Interface of PC and App

    For downloading files, see:

    a.jsp.rar

    Use a.jsp to call the iframe integrated 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 of abnormal map display after the chart toolbar in the decision-making system goes full-screen.

    Restart the Tomcat server and visit http://localhost/webroot/a.jsp, then you can see the login page of the data decision-making system.

    Settings Interface of HTML5 Client

    For downloading files, see:

    a.jsp.rar

    The code is as follows:

    <%@ 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: When setting the HTML5 Client, you need to install a plugin. For details, see Access FineBI on HTML5 Client.

    Creating a Virtual Directory

    Modify the configuration file to create a virtual directory.

    Adjusting the Project Path

    The report project webroot is placed in the directory %Tomcat_home%\webapps by default, and will be loaded when you start the server. After you create the virtual directory, when starting the Tomcat server, the webroot project will be loaded again through the configuration file. If the webroot project is loaded twice, it will prompt error messages, cause server crashes, etc.

    Therefore, you need to move the webroot project in the directory %Tomcat_Home%\webapps out of the Tomcat deployment directory, and it needs to be placed under the same path as the Tomcat project.

    This article moves the folder webroot in the directory %Tomcat_home%\webapps to the path D:.

    Modifying the server.xml File

    Modify the file server.xml in the directory %Tomcat_Home%\conf, and add code between the host tags in the file server.xml.

    The code is as follows:

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

    Explanation:

    Parameter

    Description

    path

    Name of the virtual directory.

    If you want to display the home page after entering the IP address, leave this key value empty.

    docBase

    Path of the virtual directory.

    The webroot path is D:\webroot.

    debug

    0

    reloadable

    false

    Modifying the web.xml File

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

    If there is a file web.xml, edit the file directly. Add the following code in front of the tag </web-app> at the end of the file to display the custom welcome page a.jsp.

    <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 file web.xml, you need to create a new file web.xml in the directory webroot\WEB-INF.

    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>

    Preview

    On PC

    Restart the Tomcat server and visit http://localhost, you can enter the a.jsp page to access the data decision-making system.

    Note: In this article, this device is visited in the local environment, so http://localhost is used. The actual access address is http://{IP}.

    On Mobile (HTML5)

    Restart the Tomcat server and visit http://{IP}.

    Entering the Server Address

    Remote Design

    When using the report Remote Design to enter the server address, you need to omit webroot and keep decision.

    Option

    Value

    Hostname/IP

    Fill in as needed.

    Port number

    80

    Web application

    Null

    Servlet

    decision

    Username and Password

    Fill in as needed.

    Here’s an example of configuring the working directory.

    If the IP is demo.finebi.com, port number is 80, Servlet is decision, so the server location is http://demo.finebi.com:80/decision.

    On App

    When entering the server address on mobile, you need to omit webroot and keep decision.

    Option

    Value

    Hostname/IP

    Fill in as needed.

    Port number

    80

    Web application

    Null

    Servlet

    decision

    Username and Password

    Fill in as needed.

    Here's an example of configuring the working directory.

    Notes

    Error 404 reported on the Homepage After Successful Login

    Description

    After you successfully access the data decision-making system through IP, the error message 404 appears on the home page.

    Solution

    Modify the home page path in Directory, and change /webroot/Demo.html to /Demo.html.

    附件列表


    主题: Deployment and Integration
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy