Using symbolic links with Servoy (Tomcat)

Questions and Answers on installation, deployment, management, locking, tranasactions of Servoy Application Server

Using symbolic links with Servoy (Tomcat)

Postby jasantana » Fri Dec 28, 2012 1:05 pm

Good morning everybody.

I have a customer who is running Servoy Application Server on Linux. Our web application must show some product images which are in a symbolic link under webapps/ROOT/uploads. So the path is like application_server/server/webapps/ROOT/uploads/IMAGENES.

I´m not able to read the content of that folder, if I place the images inside a real folder I have no problem, but using the symbolic link it is impossible.

I found a link in internet that says that I have to add the following to the conf/server.xml file:

Code: Select all
<context path="/mi-aplicacion"
         docBase="DIRECTORIO_de_mi_aplicacion"
         allowLinking="true"/>


So far so good, but can anyone tell me what are the values for path and docBase in my situation.

Thanks in advance
Best regards,
Juan Antonio Santana Medina
jasantana@nephos-solutions.co.uk
Servoy MVP 2015
Servoy 6.x - Servoy 7.x - Servoy 8.x - MySQL - PostgreSQL - Visual Foxpro 9
User avatar
jasantana
 
Posts: 555
Joined: Tue Aug 10, 2010 11:40 am
Location: Leeds - West Yorkshire - United Kingdom

Re: Using symbolic links with Servoy (Tomcat)

Postby mboegem » Fri Dec 28, 2012 3:04 pm

Hi Juan,

I assume you want to link directly from the web browser?

just use: my_url:port/uploads/IMAGENES/my_image.jpg
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1749
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Using symbolic links with Servoy (Tomcat)

Postby troy » Fri Dec 28, 2012 10:22 pm

I'm not sure of the correct syntax to add it directly into server.xml file, but the following seems to work.

1) Create directory webapps/ROOT/META-INF (if it doesn't already exist).
2) Create a file named context.xml within that directory and give it the following content:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
   <Context path="/uploads" override="true" allowLinking="true">
</Context>
3)Restart Servoy and you should be serving up your image files.

For some more information on symlinks within Tomcat, have a look at this StackOverflow.
Troy Elliott, Data Mosaic

Image
Everything you need to build great apps with Servoy
U.S. demo server
Blog: Coding Nomad
User avatar
troy
 
Posts: 27
Joined: Fri Oct 24, 2003 8:49 pm
Location: Washington, DC


Return to Servoy Server

Who is online

Users browsing this forum: No registered users and 6 guests

cron