Note:In some cases, you may need to access FineReport projects deployed on FineOps via domain name/IP address. For details, see Accessing Projects Through IP Address/Domain Name.
Overview
Application Scenario
You want to access the platform, but /webroot/decision does not exist in the access path.
You want to access the Tomcat project via IP address or domain name.
You want the URL for accessing the platform or the address for accessing templates to be shorter.
Function Description
After Tomcat server deployment, you can start the Tomcat server and visit the URL http://localhost:8080/webroot/decision to enter the data decision-making system.
You may want to access the data decision-making system directly through IP address.
You can modify the port number and establish a virtual directory to directly enter the decision-making system through IP address (for example, http://localhost).
Note:Procedure
For example, this document will take the access to http://localhost as an example for introduction.
Modifying the Port Number
If no other network programs occupy port number 80, you can set the port number of the Tomcat server to 80.
Since port 80 is the default port, you do not need to add the port number of the Tomcat server when accessing the report page.
1. Open the server.xml file in Tomcat installation directory\conf\, and modify the port number, as shown in the following figure.

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 decision-making system.
Setting the Welcome Page
Each web server has a default welcome page. You can modify the page to display the platform page.
Create the a.html file in the directory Tomcat installation directory\webapps\webroot as the default home page of the web server.
Setting the Page Displayed on PC and in the DataAnalyst App
You can download and unzip the file a.zip to obtain the a.html file.
The file a.html calls the iframe to integrate the platform product demonstration page. The code is as follows:
<html>
<head>
<title>FineReport Report</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:Restart the Tomcat server and visit http://localhost/webroot/a.html to enter the login page of the decision-making system.
Setting the Page Displayed on the HTML5Terminal
You can download and decompress the file a.zipto obtain the a.html file.
The file a.html calls the iframe to integrate the platform product demonstration page. The code is as follows:
<html>
<head>
<title>FineReport Report</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:Creating a Virtual Directory
Create a virtual directory by modifying the configuration file.
Adjusting the Project Path
The report project webroot is placed in the Tomcat installation directory\webapps directory by default, and will be loaded when the server is started. After you create the virtual directory, the webroot project will be loaded again through the configuration file when you start the Tomcat server. If the webroot project is loaded twice, error messages and server crashes will occur.
Therefore, you need to move the webroot project in Tomcat installation directory\webapps out of the Tomcat deployment directory, and the project needs to be placed onto the disk in the same path as the Tomcat project.
This document moves the folder webroot from Tomcat installation directory\webapps\webroot to the path E:\webroot. The following figure shows the effect.

Note:
You should move (should not copy) the webroot file. After the move, no webroot file is left in the webapps directory in Tomcat installation directory.

Modifying the server.xml File
Modify the server.xml file in Tomcat installation directory\conf, and add code between the host tags in the file server.xml, as shown in the following figure.

The code is as follows:
<Context path="" docBase="D:\webroot" debug="0" reloadable="false" />
The following table describes the code.
| Parameter | Description |
|---|---|
| path | Name of the virtual directory If you want to display the home page after entering the IP address, you can leave this key value empty. |
docBase | Path of the virtual directory The path of webroot set in section "Adjusting the Project Path" is E:\webroot. |
debug | 0 |
reloadable | false |
Modifying the web.xml File
Modify the web.xml file in the path Tomcat installation directory\conf. Add the following code before the tag </web-app> at the end of the web.xml file to display the custom welcome page a.html.
Note:<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>a.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>The following figure shows the effect.

Effect Preview
PC
Restart the Tomcat server, and access http://localhost to enter the a.html page and access the data decision system, as shown in the following figure. (In this document, the device is visited in the local environment, so http://localhost is used, and the actual access address is http://IP address).
Mobile Terminal (HTML5 Terminal)
Restart the Tomcat server and visit http://IP address, as shown in the following figure.

Note:Entering the Server Address
Remote Design
When entering the server address for remote design, you need to omit webroot and keep decision.
| Option | Value |
|---|---|
| Hostname/IP address | Input the content according to the actual situation. |
Port number | 80 |
Web application | Null |
Serverlet | decision |
Username and Password | Input the content according to the actual situation. |
You can configure the working directory as shown in the following figure.

Mobile Terminal
When you enter the server address in App, H5, WeChat, and DingTalk integrated environments, webroot should be omitted, but decision must be retained.
| Option | Value |
|---|---|
| Hostname/IP address | Input the content according to the actual situation. |
Port number | 80 |
Web application | Null |
Serverlet | decision |
Username and Password | Input the content according to the actual situation. |
You can configure the working directory as shown in the following figure.

Notes
Incomplete Page Display in the IE9 Browser
Problem
After you complete the Tomcat deployment according to the previous configuration, the page can not be displayed completely in the IE9 browser.
Solution
You can modify the code in the a.html file in section "Setting the Welcome Page." The code is as follows:
<html>
<head>
<title>FineReport</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge"/>
<link rel="stylesheet" type="text/css" href="/decision/file?path=/com/fr/web/core/css/leaflet.css&type=plain&parser=plain"/>
<style type="text/css">
html, body
{
margin: 0px 0px;
width: 100%;
height: 100%;
}
iframe
{
margin: 0px 0px;
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<iframe id="reportFrame" src="decision" name="itemslist" frameborder="0"></iframe>
</body>
</html>