Atomia Agents

Atomia Apache Agent

12 views 0

This manual covers the installation and configuration of the Atomia Apache Agent to enable your customers to work with apache map files.

Before you begin

The Atomia Apache Agent is part of the Atomia agents package. You should start by reading the general package overview and instructions here.

Pre-installation actions

The agent doesn’t require anything special before the installation.

Post-installation actions

In order to properly function, the agent must use root Linux user. So, the first thing to change is the default agent user in the /etc/atomia/config. Open the file and replace atomia-agent with root.

Keep in mind

The default agent user change will force usage of the root Linux user for all agents installed on the server.

One more thing to do is to create and set up the agent’s configuration file. Start by copying the example config file:

sudo cp /etc/atomia/apache-agent.json.example /etc/atomia/apache-agent.json

Edit new copy and change some default properties if needed.

Example file and what each option means:

{
    "auth": {
        "username":"someauthusername",
        "password":"someauthpassword"
    },
    "port": "7000",
    "host": "192.168.33.22",
    "log_path": "/var/log/atomia/apache-agent.log",
    "server_web_root": "/storage/content",
    "vhost_map": "/storage/configuration/maps/vhost.map",
    "users_map": "/storage/configuration/maps/users.map",
    "parking_map": "/storage/configuration/maps/parks.map",
    "redirection_map": "/storage/configuration/maps/redrs.map",
    "frame_redirection_map": "/storage/configuration/maps/frmrs.map",
    "suspended_map": "/storage/configuration/maps/sspnd.map",
    "package_map": "/storage/configuration/maps/packg.map",
    "php_version_map": "/storage/configuration/maps/phpvr.map",
    "proxy_map": "/storage/configuration/maps/proxy.map",
    "ssl_config_dir": "/etc/httpd/ssl.d",
    "ssl_cert_dir": "/storage/content/%%s/%%s/ssl",
    "apachectl_path": "/usr/sbin/apachectl"
}
Option Meaning
auth Basic access authentication (username and password) for the Atomia Apache agent. Without these fields, the client won’t be able to use the Apache agent.
port Port for the management interface to listen on.
host The IP address of the machine which gonna be used for listening by Apache agent.
log_path The file where the apache agent should log info and error.
server_web_root The storage path where the website’s content is saved.
vhost_map The location of the vhost map file.
users_map The location of the users map file.
parking_map The location of the parking map file.
redirection_map The location of the redirection map file.
frame_redirection_map The location of the frame redirection map file.
suspended_map The location of the suspended map file.
package_map The location of the package map file.
php_version_map The location of the PHP version map file.
proxy_map The location of the proxy map file.
ssl_config_dir
ssl_cert_dir
apachectl_path

Changes in the Automation Server

In order to connect the Apache agent with the Atomia provisioning module, the Resource and ProvisioningDescription files should be updated on the server where Atomia Automation Server is installed.

Resource description transformation file

Make sure you have the following resource in the resource file: C:\Program Files (x86)\Atomia\AutomationServer\Common\Resources.xml:

<?xml version="1.0"?>
<resourceDescription xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <bindings>
        <moduleList>
            <module name="Atomia.Provisioning.Modules.ApacheRest.Apache" resourceAsignmentPolicy="RoundRobin" />
        </moduleList>
        <resourceList>
            <resource name="Apache">
                <property name="ApacheBaseUrl">http://192.168.33.22:7000</property>
                <property name="Username">someauthusername</property>
                <property name="Password">someauthpassword</property>
                <property name="ClusterIpAddress">192.168.33.22</property>
                <property name="LoadBalancerResourceName">LoadBalancerService_Linux</property>
            </resource>
        </resourceList>
    </bindings>
</resourceDescription>

In the transformation file example above, the ApacheBaseUrl property should match exactly the host and port properties in the apache-agent.json file (as defined in the example at the beginning of this section). Also, the Username and Password properties should be equivalent to the corresponding fields in the auth section of the same config file.

Provisioning description

Make sure that all Apache simple services have REST client set as a providing module. You can do that by placing the following transformation file on the Automation server inside the folder: C:\Program Files (x86)\Atomia\AutomationServer\Common\Resources.xml

<?xml version="1.0" encoding="utf-8"?>
<provisioningDescription xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
	<simpleService providingModule="Atomia.Provisioning.Modules.ApacheRest.Apache" xdt:Locator="XPath(//*[@providingModule='Atomia.Provisioning.Modules.Apache.Apache'])" xdt:Transform="SetAttributes(providingModule)" />
</provisioningDescription>

Running the service

systemctl start atomia-apache-agent

Was this helpful?