Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

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 is the browser which must send the cookie back to the API. This mechanism is described here[1].

...

There are two ways to configure an Apache instance. Appliance Manager instances can be exposed either a path (example.com/am-sweden) or through a subdomain (am-sweden.example.com). 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 'example.com', 'am-sweden.example.com', 'example.com/am-sweden'. To perform this operation the 'mod-header' needs to be in the Apache.

Code Block
# a2enmod headers

Create the configuration file

Code Block
title/etc/apache2/sites-available/example.com
<VirtualHost *:80>
	# Admin address
	ServerAdmin admin@example.com
 
	# Domain where is exposed  Abiquo
    ServerName example.com
 
	# Root path (/) instead of /ui
	DocumentRoot /var/www/abiquo/ui
    # Enable the balancer manager console in the server root
    <Location /manager>
        SetHandler balancer-manager
    </Location>
 
	# 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
    </Proxy>

    # 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; domain=example.com"
    </Location>

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


	CustomLog /var/log/apache2/example.com_access.log combined
</VirtualHost>

# Subdomain exposure
<VirtualHost *:80>
	# Here is the subdomain
    ServerName am-denmark.example.com

    ProxyRequests Off
 
	# Requests will go to /am
    <Location /am>
        ProxyPass http://10.60.1.4:8080/am
        ProxyPassReverse http://10.60.1.4:8080/am
    </Location>

    ErrorLog /var/log/apache2/am-denmark.log
    LogLevel error
</VirtualHost>

Enable the site.

Code Block
# a2ensite example.com