Alfresco Mobile: Change external alfresco url behind proxy

There are some times when you need to access your Alfresco server behind a firewall (to get access to it from outside your company) or you just want to use a more clean URL, that is:

Default URL: http://myalfrescoserver:8080/alfresco
New URL: http://www.mycompany.com/alfresco

This can be achieved with a Reverse Proxy server or adding some rewriting rules in Apache (using hte mod_rewrite module), but this is a topic for another post.

The fact is that in spite of we are able to access Alfresco through the Web interface, we cannot connect using the iPhone/iPAD app getting this error:

Alfresco Mobile did not connect to http://myalfrescoserver:8080/alfresco/service/cmis/s/workspace/....

The problem is that the iphone app gets the internal url from the webservice. Should we try the url from internal network we’ll be able to download the xml data which is send from the server to the client. In this xml data, all the href point to http://myalfresco:8080/alfresco instead of http://www.mycompany.com/alfresco.

These are the steps to fix it:

  1. Create the directory META-INF :

    {ALFRESCO_HOME}/tomcat/shared/classes/META-INF

  2. Create the file spring-webscripts-config-custom.xml in the folder

    {ALFRESCO_HOME}/tomcat/shared/classes/META-IN

  3. Add the following code:
    <alfresco-config>
       
       <config evaluator="string-compare" condition="Server">
          <server>
             <scheme>http</scheme>
             <hostname>your-pulic-host</hostname>
             <port>your-port</port>
             <path>alfresco</path>
          </server>
       </config>
    
    </alfresco-config> 
    
  4. Restart Alfresco

Now try the iPhone/iPAD app!

Advertisements

One thought on “Alfresco Mobile: Change external alfresco url behind proxy

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s