Deploying To Server

Showing results for 
Search instead for 
Did you mean: 

Deploying To Server

0 0 6,307

Obsolete Pages{{Obsolete}}

The official documentation is at:

Alfresco ShareConfiguration
{{Partner Info
| companyName=DENC Netherlands B.V.
| companyWebsite=
| companyLogo=DENC.jpg
| companyDescription=Design, Engineering & Contracting
| contactEmail=info [at]


This guide will detail a setup to deploy Alfresco Share to a live server using Tomcat 6 and Apache with mod_jk (the Apache Tomcat Connector). It will assume a working Alfresco Share install on Tomcat 6.


You've set up your development environment for Alfresco and Alfresco Share, you've made all the modifications and now you need to deploy Share to a server so everyone can access it. This brings a new set of issues, some technical, some visual. For instance, because you're deploying to a colocated server with an untrusted connection, you need to make the connection is encrypted so no information can be compromised. Another issue is the address people will see when they use Alfresco (Share), do you want a visible port number? Do you want a visible path prefix? My answer is no. You don't want the port number visible (or in other words, you want to use the default port) and you don't want a visible path prefix for the default application (Explorer or Share). Below I will detail how to setup Alfresco Share on a subdomain. Most steps also apply if you want to deploy Alfresco Explorer in a similar fashion, however I believe it requires additional configuration to properly set the context (path prefix) where alfresco can be found so all external links can be properly created. I will assume the use of Tomcat 6 as deployment server, however I believe most steps will perfectly work for Tomcat 5 too.

Setting up Tomcat 6

There's a lot of information detailing the installation of Alfresco, so I won't go into the basics. However I will detail additional requirements. First let's set up a default context so there's no prefix path visible in the URL for Alfresco share. The proper way to do this is by creating the file $CATALINA_BASE/conf/[enginename]/[hostname]/ROOT.xml. When Tomcat 6 is located at /var/lib/tomcat6/ the full path will be /var/lib/tomcat6/conf/Catalina/localhost/ROOT.xml. Create the following XML document inside the file:

<Context path='' docBase='share.war'>

The path attribute sets the context used in the URL. Using '' as the path thus means 'use as default'. The docBase attribute sets where the real webapp is. When using Alfresco Share this is share.war by default, it's not necessary to use the absolute path.

Now if you restart Tomcat you'll see that you can reach Alfresco Share at [host]:[port], without specifying the share prefix.

Next we need to setup a connector for Apache. It's possible this is already done on your Tomcat install by default, if not add the following in the Catalina Service section in $CATALINA_BASE/conf/server.xml:

<Connector port='8009' protocol='AJP/1.3' redirectPort='8443' />

Restart Tomcat again for the connector to be available.

Setting up Apache

If you haven't done already, install mod_jk (libapache2-mod-jk in Ubuntu). First we define the workers, I used $CATALINA_BASE/conf/ as configuration file:



The name tomcat is arbitrary, so you can replace all occurances with whatever you like.

Next point Apache to this configuration file. You can either edit your httpd.conf, or if you're using a distribution with a config dir setup (for example, /etc/apache2/conf.d/ in Ubuntu) create a file and add the following content:

JkWorkersFile /var/lib/tomcat6/conf/

Remember to use your own $CATALINA_BASE if it's not /var/lib/tomcat6.

Finally, setup a virtualhost that will connect to Tomcat:

<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*)$1 [R=301,L]

<VirtualHost *:443>

JkMount /* tomcat

SSLEngine on
SSLCertificateKeyFile /etc/ssl/private/certificate.pem
SSLCertificateFile /etc/ssl/private/certificate.crt
SSLCACertificateFile /etc/ssl/private/authority.crt

SetEnvIf User-Agent '.*MSIE.*' nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0

This will create a virtualhost at (yes, replace this with your (sub)domain location), will force port 80/http to be redirected to port 443/https (forces the secure connection, the 301 will tell the browser it's a permanent redirect) and will serve all content (/*) using the worker tomcat as specified in our workers file (if you changed the name there, also change it here). Be sure to enter your own certificate information instead of what I entered.

You can extend this configuration file in the same way you'd normally do with Apache, so you can add rewrite rules etc..

Restart Apache for the configuration to have effect.

Final thoughts

You now have Alfresco Share on a user friendly location, with a user friendly and secure setup. If Alfresco explorer is deployed on the same Tomcat instance, you can reach it at https://[host]/alfresco. Your other webapps should also still be reachable at their context path, keep this in mind when there's an app that might use names that are also used in Alfresco Share URLs. Last but not least, Share will get deployed into the ROOT folder too because of the ROOT.xml configuration file, so if you've got modified contents in there be sure to back them up!