Skip to end of metadata
Go to start of metadata

Starting in Abiquo 3.0 the client is HTML. This means that how security and login works differs from previous versions. Now security beyond first login is enforced with cookies. This means that it is the browser that must send the cookie back to the API. This mechanism is described here[1].

The upload/download of templates is made through a direct connection to the Appliance Manager. Then it sends a request to the API to check whether the user is authorized to perform the requested action. This request is basically a replica of the original request to the Appliance Manager.

In a multi datacenter environment API and AM might not be on the same host. This prevents the cookie from being sent, therefore the identity cannot be established. Even if CORS is working this will only allow the result (401) to travel back to the client. To allow the identity to be established, all Appliance Manager instances must reside in the same domain as the API.

This document describes how to set up a very basic Apache 2 to allow for multiple Appliance Manager instances under an '' domain. All configuration related to other webapps is omitted.

Abiquo UI configuration

In the file 'client-config.json' the value of the API location must be set to '':

"config.endpoint": ""

Host configuration

To ease the configuration it is very convenient that all hosts work on a domain/hostname basis rather than IPs or even 'localhost'.

The domain '' must resolve to the host. The easiest way is to also set the hostname.

  • Set the host name to ''
    • \# hostname
  • Edit '/etc/hosts' file and add entries for the host's IPs and ''

Apache configuration

There are two ways to configure an Apache instance. Appliance Manager instances can be exposed either as a path ( or through a subdomain ( The configuration here will show how to set up both in the same configuration file.

Enable mod

The trick here is to modify cookies in the response to add the domain. This enables the browser to send the cookie to '', '', ''. To perform this operation the 'mod-header' needs to be in the Apache.

# a2enmod headers

Create the configuration file

<VirtualHost *:80>
	# Admin address
	# Domain where is exposed  Abiquo
	# Root path (/) instead of /ui
	DocumentRoot /var/www/abiquo/ui
    # Enable the balancer manager console in the server root
    <Location /manager>
        SetHandler balancer-manager
	# Do not open the proxy to the world
    ProxyRequests Off

    # Configure the cluster nodes (secondary disabled by default)
    <Proxy balancer://ajp-cluster>
        BalancerMember ajp://localhost:8009 route=node1

    # Configure the modules we want to load balance
    <Location /api>
       ProxyPass balancer://ajp-cluster/api
       ProxyPassReverse balancer://ajp-cluster/api
	   # Set the domain in the Cookie (very important to work)
       Header edit Set-Cookie "^(auth=.*)$"  "$1;"

    # Monolithic Appliance Manager
    <Location /am>
       ProxyPass http://localhost:8080/am
       ProxyPassReverse http://localhost:8080/am
    # Appliance Manager exposed in path
    <Location /am-sweden>
	ErrorLog /var/log/apache2/example.com_error.log
	LogLevel error

	CustomLog /var/log/apache2/example.com_access.log combined

# Subdomain exposure
<VirtualHost *:80>
	# Here is the subdomain

    ProxyRequests Off
	# Requests will go to /am
    <Location /am>

    ErrorLog /var/log/apache2/am-denmark.log
    LogLevel error

Enable the site.

# a2ensite
  • No labels