# Multipe Djigzo Instances

**URL:** <https://community.ciphermail.com/t/multipe-djigzo-instances/171>\
**Category:** Gateway\
**Created:** [February 25, 2011, 9:46am UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171 "2011-02-25T09:46:52Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Manuel\_Faux](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Manuel\_Faux](https://community.ciphermail.com/u/Manuel_Faux)\
**Post date:** [February 25, 2011, 9:46am UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/1 "2011-02-25T09:46:52Z")

</div>

Hi,

I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:

- Copied the Djigzo files in one folder for each instance

- Created one database for each instance

- Configured each instance to use its database in the hibernate.cfg.xml

- Configured an individual SOAP port for each instance

- Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)

- Added the content filter pipe to Postfix's master.cf for each instance

- Added the inet TCP socket for each instance in master.cf

- Created one init script for each instance

This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?

Is there a documented way, how to chroot Djigzo?

Kind Regards,  
Manuel Faux

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [February 25, 2011, 11:46am UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/2 "2011-02-25T11:46:00Z")

</div>

> Hi,
> 
> I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> 
> - Copied the Djigzo files in one folder for each instance
> 
> - Created one database for each instance
> 
> - Configured each instance to use its database in the hibernate.cfg.xml
> 
> - Configured an individual SOAP port for each instance
> 
> - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> 
> - Added the content filter pipe to Postfix's master.cf for each instance
> 
> - Added the inet TCP socket for each instance in master.cf
> 
> - Created one init script for each instance
> 
> This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?

How does Postfix decide which back-end to use? based on sender domain?

You should be able to manage Postfix and see the log files from the Web  
GUI but each instance modifies the same Postfix config and shows the  
same log file.

Instead of modifying djigzo-web to use a different soap port you can  
specify the soap port in the Tomcat context file  
(/etc/tomcat6/Catalina/localhost):

\<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
override="false"/\>  
\</Context\>

The \<Parameter\> setting overrides the \<context-param\> setting for  
"djigzo.system.properties" in web.xml. In the above example, the soap  
port is set to 12345.

> Is there a documented way, how to chroot Djigzo?

Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK  
runtime. This is probably possible although I'm not sure whether it's  
worth the effort since Java is very secure (unless you use Web Applets  
in your browser but no one is using that any more :).

Kind regards,

Martijn

> **···**
>
> On 02/25/2011 10:46 AM, Manuel Faux wrote:
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![Manuel\_Faux](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Manuel\_Faux](https://community.ciphermail.com/u/Manuel_Faux)\
**Post date:** [April 13, 2011, 11:07am UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/3 "2011-04-13T11:07:39Z")

</div>



---

<div class="post-metadata">

**Author:** ![Manuel\_Faux](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Manuel\_Faux](https://community.ciphermail.com/u/Manuel_Faux)\
**Post date:** [April 13, 2011, 11:11am UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/4 "2011-04-13T11:11:49Z")

</div>

Hi,

Where is the system variable djigzo-web.home used? Is it really necessary to set this variable? Is it possible to set it per Tomcat context?

Kind regards,  
Manuel Faux

Hope the Mail can be seen this time. 😉

> **···**
>
> -----Original Message-----  
> From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> Sent: Friday, February 25, 2011 12:46 PM  
> To: users(a)lists.djigzo.com  
> Subject: Re: Multipe Djigzo Instances
> 
> On 02/25/2011 10:46 AM, Manuel Faux wrote:
> 
> > Hi,
> > 
> > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > 
> > - Copied the Djigzo files in one folder for each instance
> > 
> > - Created one database for each instance
> > 
> > - Configured each instance to use its database in the hibernate.cfg.xml
> > 
> > - Configured an individual SOAP port for each instance
> > 
> > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > 
> > - Added the content filter pipe to Postfix's master.cf for each instance
> > 
> > - Added the inet TCP socket for each instance in master.cf
> > 
> > - Created one init script for each instance
> > 
> > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> 
> How does Postfix decide which back-end to use? based on sender domain?
> 
> You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> 
> Instead of modifying djigzo-web to use a different soap port you can specify the soap port in the Tomcat context file  
> (/etc/tomcat6/Catalina/localhost):
> 
> \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> override="false"/\>  
> \</Context\>
> 
> The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> 
> > Is there a documented way, how to chroot Djigzo?
> 
> Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> 
> Kind regards,
> 
> Martijn
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [April 13, 2011, 11:35am UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/5 "2011-04-13T11:35:15Z")

</div>

> Hi,
> 
> Where is the system variable djigzo-web.home used? Is it really necessary to set this variable? Is it possible to set it per Tomcat context?

djigzo-web.home is used to find the factory settings file for the web  
app (normally found in /usr/share/djigzo-web/conf/djigzo-web.properties)  
and to know where to store the uploaded SSL certificate (SSL certificate  
that's uploaded with the GUI).

I have checked and almost all settings in djigzo-web.properties are set  
at the default value. The only exception are "upload.filesize-max" and  
"upload.requestsize-max" which I belief by default do not have a max.  
The upload max settings are used when you upload something to the  
gateway (a file with certificates, an attachment on the pdf reply page  
etc.). The upload max settings are the upper limit of any file you can  
send to the gateway. For the PDF reply page there is an additional  
maximum fort the allowed attachment "email.attachment.max-size" which is  
by default 5MB.

So, if you do not need to override the default settings, an unlimited  
upload of acceptable and you do not need to upload a SSL certificate via  
the GUI you can skip setting djigzo-web.home.

If you do need to override any setting I think you can use the method  
explained in the previous email using the Context.

Kind regards,

Martijn Brinkers

> **···**
>
> On 04/13/2011 01:11 PM, Manuel Faux wrote:
> 
> > -----Original Message-----  
> > From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > Sent: Friday, February 25, 2011 12:46 PM  
> > To: users(a)lists.djigzo.com  
> > Subject: Re: Multipe Djigzo Instances
> > 
> > On 02/25/2011 10:46 AM, Manuel Faux wrote:
> > 
> > > Hi,
> > > 
> > > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > > 
> > > - Copied the Djigzo files in one folder for each instance
> > > 
> > > - Created one database for each instance
> > > 
> > > - Configured each instance to use its database in the hibernate.cfg.xml
> > > 
> > > - Configured an individual SOAP port for each instance
> > > 
> > > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > > 
> > > - Added the content filter pipe to Postfix's master.cf for each instance
> > > 
> > > - Added the inet TCP socket for each instance in master.cf
> > > 
> > > - Created one init script for each instance
> > > 
> > > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> > 
> > How does Postfix decide which back-end to use? based on sender domain?
> > 
> > You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> > 
> > Instead of modifying djigzo-web to use a different soap port you can specify the soap port in the Tomcat context file  
> > (/etc/tomcat6/Catalina/localhost):
> > 
> > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> > override="false"/\>  
> > \</Context\>
> > 
> > The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> > 
> > > Is there a documented way, how to chroot Djigzo?
> > 
> > Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> > 
> > Kind regards,
> > 
> > Martijn
> > 
> > --  
> > Djigzo open source email encryption  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.djigzo.com  
> > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![Manuel\_Faux](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Manuel\_Faux](https://community.ciphermail.com/u/Manuel_Faux)\
**Post date:** [April 13, 2011, 1:03pm UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/6 "2011-04-13T13:03:28Z")

</div>



---

<div class="post-metadata">

**Author:** ![Manuel\_Faux](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Manuel\_Faux](https://community.ciphermail.com/u/Manuel_Faux)\
**Post date:** [April 13, 2011, 1:04pm UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/7 "2011-04-13T13:04:55Z")

</div>

Hi,

Sorry for the blank mails, this seems to be a bug in my Outlook 2007 mail client...

Here's my question to the mailing list:

I've tried overriding Djigzo default's by using your method:

\<Context docBase="/usr/share/djigzo-web/djigzo.war" path="/djigzo1"\>  
&nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=10901" override="false"/\>  
&nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.host=192.168.1.101" override="false"/\>  
&nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;soap.password=pvaj3pa8321kjzzzz2" override="false"/\>  
\</Context\>

It seems Djigzo ignores the settings. Is there a way to determine which settings are set for each option?

Is the format of the value parameter correct: "djigzo-web.spring.authenticator.config=\<value\>&10;\<option\>=\<value\>"? What does the djigz-web.spring.authenticator.xml represent?

Kind regards,  
Manuel Faux

> **···**
>
> -----Original Message-----  
> From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> Sent: Friday, February 25, 2011 12:46 PM  
> To: users(a)lists.djigzo.com  
> Subject: Re: Multipe Djigzo Instances
> 
> On 02/25/2011 10:46 AM, Manuel Faux wrote:
> 
> > Hi,
> > 
> > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > 
> > - Copied the Djigzo files in one folder for each instance
> > 
> > - Created one database for each instance
> > 
> > - Configured each instance to use its database in the hibernate.cfg.xml
> > 
> > - Configured an individual SOAP port for each instance
> > 
> > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > 
> > - Added the content filter pipe to Postfix's master.cf for each instance
> > 
> > - Added the inet TCP socket for each instance in master.cf
> > 
> > - Created one init script for each instance
> > 
> > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> 
> How does Postfix decide which back-end to use? based on sender domain?
> 
> You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> 
> Instead of modifying djigzo-web to use a different soap port you can specify the soap port in the Tomcat context file  
> (/etc/tomcat6/Catalina/localhost):
> 
> \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> override="false"/\>  
> \</Context\>
> 
> The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> 
> > Is there a documented way, how to chroot Djigzo?
> 
> Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> 
> Kind regards,
> 
> Martijn
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [April 13, 2011, 1:23pm UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/8 "2011-04-13T13:23:49Z")

</div>

> Hi,
> 
> Sorry for the blank mails, this seems to be a bug in my Outlook 2007 mail client...
> 
> Here's my question to the mailing list:
> 
> I've tried overriding Djigzo default's by using your method:
> 
> \<Context docBase="/usr/share/djigzo-web/djigzo.war" path="/djigzo1"\>  
> &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=10901" override="false"/\>  
> &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.host=192.168.1.101" override="false"/\>  
> &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;soap.password=pvaj3pa8321kjzzzz2" override="false"/\>  
> \</Context\>
> 
> It seems Djigzo ignores the settings. Is there a way to determine which settings are set for each option?
> 
> Is the format of the value parameter correct: "djigzo-web.spring.authenticator.config=\<value\>&10;\<option\>=\<value\>"? What does the djigz-web.spring.authenticator.xml represent?

No you should only add one "djigzo.system.properties" parameter. The  
context only seems to support just one parameter so you need to encode  
the properties into one string (this is Tomcat shortcoming). Because the  
properties need to be newline separated and XML does not directly  
support a NL character you need to XML write the NL as &#10;

So in your case I think the parameter value should look like:

"djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345&#10;djigzo.ws.server.host=192.168.1.101&#10;soap.password=pvaj3pa8321kjzzzz2"

Note: without any newlines (my mail app adds the newlines)

The reason you need to add "djigzo-web.spring.authenticator.config=" is  
that it's a required system setting.

If you look at web.xml in the djigzo-web.war file the following section  
does more or less the same thing:

\<context-param\>  
\<param-name\>djigzo.system.properties\</param-name\>  
\<param-value\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<!-- Use the default authenticator. --\>  
&nbsp;&nbsp;&nbsp;&nbsp;djigzo-web.spring.authenticator.config=spring-default-  
authenticator.xml  
\</param-value\>  
\</context-param\>

The only difference is that in web.xml you can use newline characters.  
Now because you are overriding the "djigzo.system.properties" settings  
in the Context you should also add the  
"djigzo-web.spring.authenticator.config" setting in your properties  
because all existing settings in web.xml will no longer be used.

Instead of specifying everything in the Context you can create multiple  
copies of djigzo-web.war and change the web.xml contained in the war  
files (a war file is just a zip with a different extension). I however  
would prefer the Context approach because that only requires 'external'  
changes.

Kind regards,

Martijn Brinkers

> **···**
>
> On 04/13/2011 03:04 PM, Manuel Faux wrote:
> 
> > Kind regards,  
> > Manuel Faux
> > 
> > -----Original Message-----  
> > From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > Sent: Friday, February 25, 2011 12:46 PM  
> > To: users(a)lists.djigzo.com  
> > Subject: Re: Multipe Djigzo Instances
> > 
> > On 02/25/2011 10:46 AM, Manuel Faux wrote:
> > 
> > > Hi,
> > > 
> > > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > > 
> > > - Copied the Djigzo files in one folder for each instance
> > > 
> > > - Created one database for each instance
> > > 
> > > - Configured each instance to use its database in the hibernate.cfg.xml
> > > 
> > > - Configured an individual SOAP port for each instance
> > > 
> > > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > > 
> > > - Added the content filter pipe to Postfix's master.cf for each instance
> > > 
> > > - Added the inet TCP socket for each instance in master.cf
> > > 
> > > - Created one init script for each instance
> > > 
> > > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> > 
> > How does Postfix decide which back-end to use? based on sender domain?
> > 
> > You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> > 
> > Instead of modifying djigzo-web to use a different soap port you can specify the soap port in the Tomcat context file  
> > (/etc/tomcat6/Catalina/localhost):
> > 
> > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> > override="false"/\>  
> > \</Context\>
> > 
> > The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> > 
> > > Is there a documented way, how to chroot Djigzo?
> > 
> > Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> > 
> > Kind regards,
> > 
> > Martijn
> > 
> > --  
> > Djigzo open source email encryption  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.djigzo.com  
> > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![Manuel\_Faux](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Manuel\_Faux](https://community.ciphermail.com/u/Manuel_Faux)\
**Post date:** [April 16, 2011, 11:43am UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/9 "2011-04-16T11:43:24Z")

</div>

Hi,

does this setting affect all contexts or only the context it's being specified in? I think these parameters are set globally and affect every context, so the context which is deployed last, overrides all configuration values. Might this be possible?  
I cannot figure out how this might be done, because each context has another class loader, as far as I know.

Kind regards,  
Manuel Faux

> **···**
>
> -----Original Message-----  
> From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> Sent: Wednesday, April 13, 2011 3:24 PM  
> To: users(a)lists.djigzo.com  
> Subject: Re: Multipe Djigzo Instances
> 
> On 04/13/2011 03:04 PM, Manuel Faux wrote:
> 
> > Hi,
> > 
> > Sorry for the blank mails, this seems to be a bug in my Outlook 2007 mail client...
> > 
> > Here's my question to the mailing list:
> > 
> > I've tried overriding Djigzo default's by using your method:
> > 
> > \<Context docBase="/usr/share/djigzo-web/djigzo.war" path="/djigzo1"\>  
> > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=10901" override="false"/\>  
> > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.host=192.168.1.101" override="false"/\>  
> > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > value="djigzo-web.spring.authenticator.config=spring-default-authentic  
> > ator.xml&#10;soap.password=pvaj3pa8321kjzzzz2" override="false"/\>  
> > \</Context\>
> > 
> > It seems Djigzo ignores the settings. Is there a way to determine which settings are set for each option?
> > 
> > Is the format of the value parameter correct: "djigzo-web.spring.authenticator.config=\<value\>&10;\<option\>=\<value\>"? What does the djigz-web.spring.authenticator.xml represent?
> 
> No you should only add one "djigzo.system.properties" parameter. The context only seems to support just one parameter so you need to encode the properties into one string (this is Tomcat shortcoming). Because the properties need to be newline separated and XML does not directly support a NL character you need to XML write the NL as &#10;
> 
> So in your case I think the parameter value should look like:
> 
> "djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345&#10;djigzo.ws.server.host=192.168.1.101&#10;soap.password=pvaj3pa8321kjzzzz2"
> 
> Note: without any newlines (my mail app adds the newlines)
> 
> The reason you need to add "djigzo-web.spring.authenticator.config=" is that it's a required system setting.
> 
> If you look at web.xml in the djigzo-web.war file the following section does more or less the same thing:
> 
> \<context-param\>  
> \<param-name\>djigzo.system.properties\</param-name\>  
> \<param-value\>  
> &nbsp;&nbsp;&nbsp;&nbsp;\<!-- Use the default authenticator. --\>  
> &nbsp;&nbsp;&nbsp;&nbsp;djigzo-web.spring.authenticator.config=spring-default-  
> authenticator.xml  
> \</param-value\>  
> \</context-param\>
> 
> The only difference is that in web.xml you can use newline characters.  
> Now because you are overriding the "djigzo.system.properties" settings in the Context you should also add the "djigzo-web.spring.authenticator.config" setting in your properties because all existing settings in web.xml will no longer be used.
> 
> Instead of specifying everything in the Context you can create multiple copies of djigzo-web.war and change the web.xml contained in the war files (a war file is just a zip with a different extension). I however would prefer the Context approach because that only requires 'external'  
> changes.
> 
> Kind regards,
> 
> Martijn Brinkers
> 
> > Kind regards,  
> > Manuel Faux
> > 
> > -----Original Message-----  
> > From: users-bounces(a)lists.djigzo.com  
> > [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > Sent: Friday, February 25, 2011 12:46 PM  
> > To: users(a)lists.djigzo.com  
> > Subject: Re: Multipe Djigzo Instances
> > 
> > On 02/25/2011 10:46 AM, Manuel Faux wrote:
> > 
> > > Hi,
> > > 
> > > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > > 
> > > - Copied the Djigzo files in one folder for each instance
> > > 
> > > - Created one database for each instance
> > > 
> > > - Configured each instance to use its database in the hibernate.cfg.xml
> > > 
> > > - Configured an individual SOAP port for each instance
> > > 
> > > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > > 
> > > - Added the content filter pipe to Postfix's master.cf for each instance
> > > 
> > > - Added the inet TCP socket for each instance in master.cf
> > > 
> > > - Created one init script for each instance
> > > 
> > > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> > 
> > How does Postfix decide which back-end to use? based on sender domain?
> > 
> > You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> > 
> > Instead of modifying djigzo-web to use a different soap port you can  
> > specify the soap port in the Tomcat context file  
> > (/etc/tomcat6/Catalina/localhost):
> > 
> > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> > override="false"/\>  
> > \</Context\>
> > 
> > The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> > 
> > > Is there a documented way, how to chroot Djigzo?
> > 
> > Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> > 
> > Kind regards,
> > 
> > Martijn
> > 
> > --  
> > Djigzo open source email encryption  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.djigzo.com  
> > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [April 17, 2011, 4:29pm UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/10 "2011-04-17T16:29:44Z")

</div>

> does this setting affect all contexts or only the context it's being specified in? I think these parameters are set globally and affect every context, so the context which is deployed last, overrides all configuration values. Might this be possible?  
> I cannot figure out how this might be done, because each context has another class loader, as far as I know.

You are right. It seems that only one setting is used. I spend some time  
investigating this and I think I have found a solution to run multiple GUIs.

Suppose you only want to use different values for djigzo.ws.server.host  
and djigzo.ws.server.port and that you want to run two instances of the  
GUI. You should add two context XML files and make sure that the context  
set the required properties.

So and two context files to /etc/tomcat6/Catalina/localhost

djigzo1.xml:

\<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.host" value="127.0.0.1"  
override="false"/\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.port" value="9000"  
override="false"/\>  
\</Context\>

and djigzo2.xml:

\<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.host" value="192.168.178.101"  
override="false"/\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.port" value="9001"  
override="false"/\>  
\</Context\>

These two contexts will make the URL [https://1.2.3.4:8443/djigzo1/](https://1.2.3.4:8443/djigzo1/) go to  
the gateway running on 127.0.0.1:9000 and [https://1.2.3.4:8443/djigzo2/](https://1.2.3.4:8443/djigzo2/)  
to the gateway running on 192.168.178.101:9001

Kind regards,

Martijn Brinkers

> **···**
>
> On 04/16/2011 01:43 PM, Manuel Faux wrote:
> 
> > Kind regards,  
> > Manuel Faux
> > 
> > -----Original Message-----  
> > From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > Sent: Wednesday, April 13, 2011 3:24 PM  
> > To: users(a)lists.djigzo.com  
> > Subject: Re: Multipe Djigzo Instances
> > 
> > On 04/13/2011 03:04 PM, Manuel Faux wrote:
> > 
> > > Hi,
> > > 
> > > Sorry for the blank mails, this seems to be a bug in my Outlook 2007 mail client...
> > > 
> > > Here's my question to the mailing list:
> > > 
> > > I've tried overriding Djigzo default's by using your method:
> > > 
> > > \<Context docBase="/usr/share/djigzo-web/djigzo.war" path="/djigzo1"\>  
> > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=10901" override="false"/\>  
> > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.host=192.168.1.101" override="false"/\>  
> > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > > value="djigzo-web.spring.authenticator.config=spring-default-authentic  
> > > ator.xml&#10;soap.password=pvaj3pa8321kjzzzz2" override="false"/\>  
> > > \</Context\>
> > > 
> > > It seems Djigzo ignores the settings. Is there a way to determine which settings are set for each option?
> > > 
> > > Is the format of the value parameter correct: "djigzo-web.spring.authenticator.config=\<value\>&10;\<option\>=\<value\>"? What does the djigz-web.spring.authenticator.xml represent?
> > 
> > No you should only add one "djigzo.system.properties" parameter. The context only seems to support just one parameter so you need to encode the properties into one string (this is Tomcat shortcoming). Because the properties need to be newline separated and XML does not directly support a NL character you need to XML write the NL as &#10;
> > 
> > So in your case I think the parameter value should look like:
> > 
> > "djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345&#10;djigzo.ws.server.host=192.168.1.101&#10;soap.password=pvaj3pa8321kjzzzz2"
> > 
> > Note: without any newlines (my mail app adds the newlines)
> > 
> > The reason you need to add "djigzo-web.spring.authenticator.config=" is that it's a required system setting.
> > 
> > If you look at web.xml in the djigzo-web.war file the following section does more or less the same thing:
> > 
> > \<context-param\>  
> > \<param-name\>djigzo.system.properties\</param-name\>  
> > \<param-value\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<!-- Use the default authenticator. --\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;djigzo-web.spring.authenticator.config=spring-default-  
> > authenticator.xml  
> > \</param-value\>  
> > \</context-param\>
> > 
> > The only difference is that in web.xml you can use newline characters.  
> > Now because you are overriding the "djigzo.system.properties" settings in the Context you should also add the "djigzo-web.spring.authenticator.config" setting in your properties because all existing settings in web.xml will no longer be used.
> > 
> > Instead of specifying everything in the Context you can create multiple copies of djigzo-web.war and change the web.xml contained in the war files (a war file is just a zip with a different extension). I however would prefer the Context approach because that only requires 'external'  
> > changes.
> > 
> > Kind regards,
> > 
> > Martijn Brinkers
> > 
> > > Kind regards,  
> > > Manuel Faux
> > > 
> > > -----Original Message-----  
> > > From: users-bounces(a)lists.djigzo.com  
> > > [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > > Sent: Friday, February 25, 2011 12:46 PM  
> > > To: users(a)lists.djigzo.com  
> > > Subject: Re: Multipe Djigzo Instances
> > > 
> > > On 02/25/2011 10:46 AM, Manuel Faux wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > > > 
> > > > - Copied the Djigzo files in one folder for each instance
> > > > 
> > > > - Created one database for each instance
> > > > 
> > > > - Configured each instance to use its database in the hibernate.cfg.xml
> > > > 
> > > > - Configured an individual SOAP port for each instance
> > > > 
> > > > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > > > 
> > > > - Added the content filter pipe to Postfix's master.cf for each instance
> > > > 
> > > > - Added the inet TCP socket for each instance in master.cf
> > > > 
> > > > - Created one init script for each instance
> > > > 
> > > > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> > > 
> > > How does Postfix decide which back-end to use? based on sender domain?
> > > 
> > > You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> > > 
> > > Instead of modifying djigzo-web to use a different soap port you can  
> > > specify the soap port in the Tomcat context file  
> > > (/etc/tomcat6/Catalina/localhost):
> > > 
> > > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > > &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > > value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> > > override="false"/\>  
> > > \</Context\>
> > > 
> > > The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> > > 
> > > > Is there a documented way, how to chroot Djigzo?
> > > 
> > > Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> > > 
> > > Kind regards,
> > > 
> > > Martijn
> > > 
> > > --  
> > > Djigzo open source email encryption  
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > Users mailing list  
> > > Users(a)lists.djigzo.com  
> > > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> > 
> > --  
> > Djigzo open source email encryption  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.djigzo.com  
> > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![Manuel\_Faux](https://avatars.discourse-cdn.com/v4/letter/m/50afbb/32.png) [@Manuel\_Faux](https://community.ciphermail.com/u/Manuel_Faux)\
**Post date:** [April 17, 2011, 4:54pm UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/11 "2011-04-17T16:54:57Z")

</div>

Thank you very much! That definitely did the trick. 😉

So the method you suggested before may be used to globally set some configuration values, I guess...

Thank you.  
Kind regards,  
Manuel Faux

> **···**
>
> -----Original Message-----  
> From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> Sent: Sunday, April 17, 2011 6:30 PM  
> To: users(a)lists.djigzo.com  
> Subject: Re: Multipe Djigzo Instances
> 
> On 04/16/2011 01:43 PM, Manuel Faux wrote:
> 
> > does this setting affect all contexts or only the context it's being specified in? I think these parameters are set globally and affect every context, so the context which is deployed last, overrides all configuration values. Might this be possible?  
> > I cannot figure out how this might be done, because each context has another class loader, as far as I know.
> 
> You are right. It seems that only one setting is used. I spend some time investigating this and I think I have found a solution to run multiple GUIs.
> 
> Suppose you only want to use different values for djigzo.ws.server.host and djigzo.ws.server.port and that you want to run two instances of the GUI. You should add two context XML files and make sure that the context set the required properties.
> 
> So and two context files to /etc/tomcat6/Catalina/localhost
> 
> djigzo1.xml:
> 
> \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.host" value="127.0.0.1"  
> override="false"/\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.port" value="9000"  
> override="false"/\>  
> \</Context\>
> 
> and djigzo2.xml:
> 
> \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.host" value="192.168.178.101"  
> override="false"/\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.port" value="9001"  
> override="false"/\>  
> \</Context\>
> 
> These two contexts will make the URL [https://1.2.3.4:8443/djigzo1/](https://1.2.3.4:8443/djigzo1/) go to the gateway running on 127.0.0.1:9000 and [https://1.2.3.4:8443/djigzo2/](https://1.2.3.4:8443/djigzo2/) to the gateway running on 192.168.178.101:9001
> 
> Kind regards,
> 
> Martijn Brinkers
> 
> > Kind regards,  
> > Manuel Faux
> > 
> > -----Original Message-----  
> > From: users-bounces(a)lists.djigzo.com  
> > [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > Sent: Wednesday, April 13, 2011 3:24 PM  
> > To: users(a)lists.djigzo.com  
> > Subject: Re: Multipe Djigzo Instances
> > 
> > On 04/13/2011 03:04 PM, Manuel Faux wrote:
> > 
> > > Hi,
> > > 
> > > Sorry for the blank mails, this seems to be a bug in my Outlook 2007 mail client...
> > > 
> > > Here's my question to the mailing list:
> > > 
> > > I've tried overriding Djigzo default's by using your method:
> > > 
> > > \<Context docBase="/usr/share/djigzo-web/djigzo.war" path="/djigzo1"\>  
> > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=10901" override="false"/\>  
> > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.host=192.168.1.101" override="false"/\>  
> > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > > value="djigzo-web.spring.authenticator.config=spring-default-authenti  
> > > c ator.xml&#10;soap.password=pvaj3pa8321kjzzzz2" override="false"/\>  
> > > \</Context\>
> > > 
> > > It seems Djigzo ignores the settings. Is there a way to determine which settings are set for each option?
> > > 
> > > Is the format of the value parameter correct: "djigzo-web.spring.authenticator.config=\<value\>&10;\<option\>=\<value\>"? What does the djigz-web.spring.authenticator.xml represent?
> > 
> > No you should only add one "djigzo.system.properties" parameter. The  
> > context only seems to support just one parameter so you need to encode  
> > the properties into one string (this is Tomcat shortcoming). Because  
> > the properties need to be newline separated and XML does not directly  
> > support a NL character you need to XML write the NL as &#10;
> > 
> > So in your case I think the parameter value should look like:
> > 
> > "djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345&#10;djigzo.ws.server.host=192.168.1.101&#10;soap.password=pvaj3pa8321kjzzzz2"
> > 
> > Note: without any newlines (my mail app adds the newlines)
> > 
> > The reason you need to add "djigzo-web.spring.authenticator.config=" is that it's a required system setting.
> > 
> > If you look at web.xml in the djigzo-web.war file the following section does more or less the same thing:
> > 
> > \<context-param\>  
> > \<param-name\>djigzo.system.properties\</param-name\>  
> > \<param-value\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<!-- Use the default authenticator. --\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;djigzo-web.spring.authenticator.config=spring-default-  
> > authenticator.xml  
> > \</param-value\>  
> > \</context-param\>
> > 
> > The only difference is that in web.xml you can use newline characters.  
> > Now because you are overriding the "djigzo.system.properties" settings in the Context you should also add the "djigzo-web.spring.authenticator.config" setting in your properties because all existing settings in web.xml will no longer be used.
> > 
> > Instead of specifying everything in the Context you can create multiple copies of djigzo-web.war and change the web.xml contained in the war files (a war file is just a zip with a different extension). I however would prefer the Context approach because that only requires 'external'  
> > changes.
> > 
> > Kind regards,
> > 
> > Martijn Brinkers
> > 
> > > Kind regards,  
> > > Manuel Faux
> > > 
> > > -----Original Message-----  
> > > From: users-bounces(a)lists.djigzo.com  
> > > [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > > Sent: Friday, February 25, 2011 12:46 PM  
> > > To: users(a)lists.djigzo.com  
> > > Subject: Re: Multipe Djigzo Instances
> > > 
> > > On 02/25/2011 10:46 AM, Manuel Faux wrote:
> > > 
> > > > Hi,
> > > > 
> > > > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > > > 
> > > > - Copied the Djigzo files in one folder for each instance
> > > > 
> > > > - Created one database for each instance
> > > > 
> > > > - Configured each instance to use its database in the hibernate.cfg.xml
> > > > 
> > > > - Configured an individual SOAP port for each instance
> > > > 
> > > > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > > > 
> > > > - Added the content filter pipe to Postfix's master.cf for each instance
> > > > 
> > > > - Added the inet TCP socket for each instance in master.cf
> > > > 
> > > > - Created one init script for each instance
> > > > 
> > > > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> > > 
> > > How does Postfix decide which back-end to use? based on sender domain?
> > > 
> > > You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> > > 
> > > Instead of modifying djigzo-web to use a different soap port you can  
> > > specify the soap port in the Tomcat context file  
> > > (/etc/tomcat6/Catalina/localhost):
> > > 
> > > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > > &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > > value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> > > override="false"/\>  
> > > \</Context\>
> > > 
> > > The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> > > 
> > > > Is there a documented way, how to chroot Djigzo?
> > > 
> > > Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> > > 
> > > Kind regards,
> > > 
> > > Martijn
> > > 
> > > --  
> > > Djigzo open source email encryption  
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > Users mailing list  
> > > Users(a)lists.djigzo.com  
> > > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> > 
> > --  
> > Djigzo open source email encryption  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.djigzo.com  
> > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> 
> --  
> Djigzo open source email encryption

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [April 17, 2011, 4:57pm UTC](https://community.ciphermail.com/t/multipe-djigzo-instances/171/12 "2011-04-17T16:57:58Z")

</div>

> Thank you very much! That definitely did the trick. 😉
> 
> So the method you suggested before may be used to globally set some configuration values, I guess...

Well actually my initial suggestion was just wrong ;). Global settings  
should be set in the djigzo-web.properties file.

Kind regards,

Martijn

> **···**
>
> On 04/17/2011 06:54 PM, Manuel Faux wrote:
> 
> > Thank you.  
> > Kind regards,  
> > Manuel Faux
> > 
> > -----Original Message-----  
> > From: users-bounces(a)lists.djigzo.com [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > Sent: Sunday, April 17, 2011 6:30 PM  
> > To: users(a)lists.djigzo.com  
> > Subject: Re: Multipe Djigzo Instances
> > 
> > On 04/16/2011 01:43 PM, Manuel Faux wrote:
> > 
> > > does this setting affect all contexts or only the context it's being specified in? I think these parameters are set globally and affect every context, so the context which is deployed last, overrides all configuration values. Might this be possible?  
> > > I cannot figure out how this might be done, because each context has another class loader, as far as I know.
> > 
> > You are right. It seems that only one setting is used. I spend some time investigating this and I think I have found a solution to run multiple GUIs.
> > 
> > Suppose you only want to use different values for djigzo.ws.server.host and djigzo.ws.server.port and that you want to run two instances of the GUI. You should add two context XML files and make sure that the context set the required properties.
> > 
> > So and two context files to /etc/tomcat6/Catalina/localhost
> > 
> > djigzo1.xml:
> > 
> > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.host" value="127.0.0.1"  
> > override="false"/\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.port" value="9000"  
> > override="false"/\>  
> > \</Context\>
> > 
> > and djigzo2.xml:
> > 
> > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.host" value="192.168.178.101"  
> > override="false"/\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.ws.server.port" value="9001"  
> > override="false"/\>  
> > \</Context\>
> > 
> > These two contexts will make the URL [https://1.2.3.4:8443/djigzo1/](https://1.2.3.4:8443/djigzo1/) go to the gateway running on 127.0.0.1:9000 and [https://1.2.3.4:8443/djigzo2/](https://1.2.3.4:8443/djigzo2/) to the gateway running on 192.168.178.101:9001
> > 
> > Kind regards,
> > 
> > Martijn Brinkers
> > 
> > > Kind regards,  
> > > Manuel Faux
> > > 
> > > -----Original Message-----  
> > > From: users-bounces(a)lists.djigzo.com  
> > > [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > > Sent: Wednesday, April 13, 2011 3:24 PM  
> > > To: users(a)lists.djigzo.com  
> > > Subject: Re: Multipe Djigzo Instances
> > > 
> > > On 04/13/2011 03:04 PM, Manuel Faux wrote:
> > > 
> > > > Hi,
> > > > 
> > > > Sorry for the blank mails, this seems to be a bug in my Outlook 2007 mail client...
> > > > 
> > > > Here's my question to the mailing list:
> > > > 
> > > > I've tried overriding Djigzo default's by using your method:
> > > > 
> > > > \<Context docBase="/usr/share/djigzo-web/djigzo.war" path="/djigzo1"\>  
> > > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=10901" override="false"/\>  
> > > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties" value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.host=192.168.1.101" override="false"/\>  
> > > > &nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > > > value="djigzo-web.spring.authenticator.config=spring-default-authenti  
> > > > c ator.xml&#10;soap.password=pvaj3pa8321kjzzzz2" override="false"/\>  
> > > > \</Context\>
> > > > 
> > > > It seems Djigzo ignores the settings. Is there a way to determine which settings are set for each option?
> > > > 
> > > > Is the format of the value parameter correct: "djigzo-web.spring.authenticator.config=\<value\>&10;\<option\>=\<value\>"? What does the djigz-web.spring.authenticator.xml represent?
> > > 
> > > No you should only add one "djigzo.system.properties" parameter. The  
> > > context only seems to support just one parameter so you need to encode  
> > > the properties into one string (this is Tomcat shortcoming). Because  
> > > the properties need to be newline separated and XML does not directly  
> > > support a NL character you need to XML write the NL as &#10;
> > > 
> > > So in your case I think the parameter value should look like:
> > > 
> > > "djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345&#10;djigzo.ws.server.host=192.168.1.101&#10;soap.password=pvaj3pa8321kjzzzz2"
> > > 
> > > Note: without any newlines (my mail app adds the newlines)
> > > 
> > > The reason you need to add "djigzo-web.spring.authenticator.config=" is that it's a required system setting.
> > > 
> > > If you look at web.xml in the djigzo-web.war file the following section does more or less the same thing:
> > > 
> > > \<context-param\>  
> > > \<param-name\>djigzo.system.properties\</param-name\>  
> > > \<param-value\>  
> > > &nbsp;&nbsp;&nbsp;&nbsp;\<!-- Use the default authenticator. --\>  
> > > &nbsp;&nbsp;&nbsp;&nbsp;djigzo-web.spring.authenticator.config=spring-default-  
> > > authenticator.xml  
> > > \</param-value\>  
> > > \</context-param\>
> > > 
> > > The only difference is that in web.xml you can use newline characters.  
> > > Now because you are overriding the "djigzo.system.properties" settings in the Context you should also add the "djigzo-web.spring.authenticator.config" setting in your properties because all existing settings in web.xml will no longer be used.
> > > 
> > > Instead of specifying everything in the Context you can create multiple copies of djigzo-web.war and change the web.xml contained in the war files (a war file is just a zip with a different extension). I however would prefer the Context approach because that only requires 'external'  
> > > changes.
> > > 
> > > Kind regards,
> > > 
> > > Martijn Brinkers
> > > 
> > > > Kind regards,  
> > > > Manuel Faux
> > > > 
> > > > -----Original Message-----  
> > > > From: users-bounces(a)lists.djigzo.com  
> > > > [mailto:users-bounces(a)[lists.djigzo.com](http://lists.djigzo.com)] On Behalf Of Martijn Brinkers  
> > > > Sent: Friday, February 25, 2011 12:46 PM  
> > > > To: users(a)lists.djigzo.com  
> > > > Subject: Re: Multipe Djigzo Instances
> > > > 
> > > > On 02/25/2011 10:46 AM, Manuel Faux wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > I want to run multiple Djigzo instances on one server with one Postfix installation. What I did so far is the following:
> > > > > 
> > > > > - Copied the Djigzo files in one folder for each instance
> > > > > 
> > > > > - Created one database for each instance
> > > > > 
> > > > > - Configured each instance to use its database in the hibernate.cfg.xml
> > > > > 
> > > > > - Configured an individual SOAP port for each instance
> > > > > 
> > > > > - Deployed the backend for each Djigzo instance (this was a bit tricky, because I had to modify djigzo-web to allow overruling some configuration values via the Tomcat context (feel free to contact me to hand over you the sources) because each instance has to use an own SOAP port)
> > > > > 
> > > > > - Added the content filter pipe to Postfix's master.cf for each instance
> > > > > 
> > > > > - Added the inet TCP socket for each instance in master.cf
> > > > > 
> > > > > - Created one init script for each instance
> > > > > 
> > > > > This setup works so far, but I'm unsure if I've forgotten something or some other things will interfere. I am aware of the fact I cannot use Djigzo-Web to configure Postfix anymore or to view the logs, does anyone see other limitations?
> > > > 
> > > > How does Postfix decide which back-end to use? based on sender domain?
> > > > 
> > > > You should be able to manage Postfix and see the log files from the Web GUI but each instance modifies the same Postfix config and shows the same log file.
> > > > 
> > > > Instead of modifying djigzo-web to use a different soap port you can  
> > > > specify the soap port in the Tomcat context file  
> > > > (/etc/tomcat6/Catalina/localhost):
> > > > 
> > > > \<Context docBase="/usr/share/djigzo-web/djigzo.war" unpackWAR="false"\>  
> > > > &nbsp;&nbsp;&nbsp;&nbsp;\<Parameter name="djigzo.system.properties"  
> > > > value="djigzo-web.spring.authenticator.config=spring-default-authenticator.xml&#10;djigzo.ws.server.port=12345"  
> > > > override="false"/\>  
> > > > \</Context\>
> > > > 
> > > > The \<Parameter\> setting overrides the \<context-param\> setting for "djigzo.system.properties" in web.xml. In the above example, the soap port is set to 12345.
> > > > 
> > > > > Is there a documented way, how to chroot Djigzo?
> > > > 
> > > > Djigzo runs on Java (OpenJDK) so you should chroot the complete OpenJDK runtime. This is probably possible although I'm not sure whether it's worth the effort since Java is very secure (unless you use Web Applets in your browser but no one is using that any more :).
> > > > 
> > > > Kind regards,
> > > > 
> > > > Martijn
> > > > 
> > > > --  
> > > > Djigzo open source email encryption  
> > > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > > Users mailing list  
> > > > Users(a)lists.djigzo.com  
> > > > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> > > 
> > > --  
> > > Djigzo open source email encryption  
> > > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > > Users mailing list  
> > > Users(a)lists.djigzo.com  
> > > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> > 
> > --  
> > Djigzo open source email encryption  
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > Users mailing list  
> > Users(a)lists.djigzo.com  
> > [http://lists.djigzo.com/lists/listinfo/users](http://lists.djigzo.com/lists/listinfo/users)
> 
> --  
> Djigzo open source email encryption
