This page is for administrators who need to link the Tomcat Webserver to files stored on the PhixFlow Server.
Overview
Application designers use images in their screens, for example for logos, or user profiles. Application users may also need to download files from the application. For the Tomcat webserver to find files, it needs to know where they are on the PhixFlow server. This requires a soft link (also called datalink or symlink) to the relevant directories. This acts as a shortcut between the two directories and lets the Tomcat webserver "see" the files.
Upgrade Considerations
When you upgrade PhixFlow to the latest version, the process replaces everything under the
When you configure soft links, it is usually in the .../tomcat/webapps/phixflow directory.
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.
This is also why you must never add files to .../tomcat/webapps/phixflow or it's subdirectories.
Configuring Soft Links
Securing Soft Links
To ensure soft links from Tomcat to PhixFlow directories are secure, configure the context.xml file as follows:
- Edit
/opt/tomcat/conf/context.xml
- Find the line:
<Resources cachingAllowed="true" cacheMaxSize="1000000" />
- Replace it with:
<Resources allowLinking="true" cachingAllowed="true" cacheMaxSize="1000000" />
Creating Soft Links
In the following commands:
path/folder_name
is the full path to the directory to which you want to linksoft_link_name
is the directory name you want to use as a soft link
On Linux use the ln
command
ln -s path/folder_name soft_link_name
If a file path includes spaces, enclose it in double-quotes.
sudo ln -s /opt/phixflow/data/ /opt/tomcat/webapps/phixflow/datalink
On Windows use the mklink
command
The mklink command creates links to specific files by default. To link to a directory, use the /D
option.
mklink /D soft_link_name path/folder_name
mklink /D c:\tomcat\webapps\phixflow\datalink c:\path\phixflow\data
For more information about symlinks, see this article on Creating Symbolic Links.
Example Data Links
In the following example, Tomcat has a soft link to a files/images directory in PhixFlow
OS | Soft link in a Tomcat directory | points to → | PhixFlow server directory containing files |
---|---|---|---|
Linux | .../tomcat/webapps/phixflow/images-link |
| |
Windows |
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 | .../tomcat/webapps/phixflow/proj1-images |
| /opt/phixflow/allprojects/apps/project1/ | ||
Windows |