Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This page is for

...

administrators who need to link the Tomcat webserver to files stored on the PhixFlow Server.

Administrator setting up softlinks

Understanding the Soft Link Between Tomcat and PhixFlow

When you want to reference a file saved on the PhixFlow server, you need to use a path that the PhixFlow Webapp can understand. The PhixFlow webapp runs within Tomcat, so only knows about files below  /opt/tomcat/webapps/phixflow 

...

Overview

Application designers use images and files in their applications. You can add a soft link (also

...

called datalink or symlink) to the Tomcat webserver so that it can access files when serving application pages. The soft link acts as a shortcut between the two directories and lets the

...

Tomcat webserver "see" the files

...

/opt/phixflow/data/phixflow/datalink/

Where has the above come from? This will only exist if someone has already configured it?

- You may not want to save files under the datalink directory on the PhixFlow server. For example, you could have a directory for each project, and the files belong to a specific project. In this case, you can add a second soft link.

...

/opt/phixflow/data/phixflow/datalink/MyProject/

...

To ensure soft links from Tomcat to PhixFlow directories are secure, configure context.xml as follows:

  1. Edit /opt/tomcat/conf/context.xml
  2. Find the line: <Resources cachingAllowed="true" cacheMaxSize="1000000" />
  3. Replace it with: <Resources allowLinking="true" cachingAllowed="true" cacheMaxSize="1000000" />

...

.

For more information about soft links, see this article on Creating Symbolic Links.

Live Search
spaceKey@self
additionalnone
placeholderSearch all help pages
typepage

Panel
borderColor#00374F
titleColorwhite
titleBGColor#00374F
borderStylesolid
titleSections on this page
Table of Contents
maxLevel3
indent12px
stylenone

Upgrade Considerations

You need to configure soft links in the /tomcat/webapps/phixflow directory.

Warning

When you upgrade PhixFlow to the latest version, the process replaces everything in /tomcat/webapps/phixflow, and therefore deletes the soft links. After upgrade you must reinstate the soft links after completing the special upgrade instructions; see Upgrading PhixFlow.

This is also why you must never add files directly to /tomcat/webapps/phixflow or it's subdirectories.

Creating Soft Links 

Anchor
softlink
softlink

In the following commands:

  • path/folder_name is the full path to the directory to which you want to link

  • soft_link

...

  •  is the path to the directory

...

  • where you want to

...

  • access the soft link

...

  • .

On Linux

...

create soft links using the ln command

ln

...

-s

...

path/folder_name

...

soft_link

...

If a file path includes spaces, enclose it in double-quotes. 

Example ln command
Code Block
sudo ln -s /opt/phixflow/data

...

/ /opt/tomcat/webapps/phixflow/

...

datalink

On Windows

...

create soft links using the mklink command

By default, the mklink command creates links to specific files. To link to a directory, use the /D option.

mklink /D soft_link

...

path/folder_name

...

To soft link to a specific file, omit /D.

For more information about symlinks, see this article on Creating Symbolic Links.

The Path or URL to Use

Within PhixFlow, to refer to a file on the server, start the path with the datalink directory.

Examples:

  • file path:   datalink/Project1/Images/file1.png
  • URL:   url("https:datalink/MyProject/MyImage.png")

...

In your PhixFlow application, to display an image stored on the PhixFlow server, use the URL for it's location, for example:  url("https:datalink/MyProject/MyImage.png").

For example, you can configure the following CSS Properties to use an image stored on the PhixFlow server as a background image. 

...

Example mklink command
Code Block
mklink /D c:\app\tomcat\webapps\phixflow\datalink c:\path\phixflow\data

Tomcat configuration

If you have installed Tomcat according to the standard recommendations (Install Tomcat), you will already have the configuration you need.

But to check, or in case of problems:

For Linux installations only, configure the context.xml file as follows:

  1. Open /opt/tomcat/conf/context.xml

  2. Find the line: <Resources cachingAllowed="true" cacheMaxSize="1000000" />

  3. Replace it with: <Resources allowLinking="true" cachingAllowed="true" cacheMaxSize="1000000" />

For Windows installations, you must not include this option. It is not needed, and adding it can cause security issues. 

Example Soft Links

In the following example, Tomcat has a soft link called images-link to a files/images directory in PhixFlow.

OS

Soft link in a Tomcat directory


points to → 

PhixFlow server directory containing files

Linux

<path>/tomcat/webapps/phixflow/images-link

/opt/phixflow/files/images/

Windows

<path>\tomcat\webapps\phixflow\images-link

<path>/phixflow/files/images//

You can also create soft links within the PhixFlow server, for example to simplify paths.

OS

Soft link in Tomcat directory


points to → 

Soft link in PhixFlow server


points to → 

Directory containing files

Linux

<path>/tomcat/webapps/phixflow/proj1-images

/opt/phixflow/images/project1/

/opt/phixflow/allprojects/apps/project1/files/images/

Windows

<path>\tomcat\webapps\phixflow\proj1-images

<path>/phixflow/images/project1/

<path>/phixflow/allprojects/apps/project1/files/images/