Apache Module for Linux

From Lianjapedia
Jump to: navigation, search

See Also

Creating a Self-Signed Certificate (Linux Apache), Creating a Self-Signed Certificate (Windows IIS), ISAPI Extension for IIS, Lianja Server Manager on Linux

Overview

If you want to integrate Lianja Cloud Server in with Apache you need to install and configure the Lianja Module for Apache.

This will provide both HTTP and HTTPS (SSL) access to your Lianja Apps and the whole Lianja APaaS with integrated Login, App Center and Logout.

To install and configure the Lianja Module for Apache perform the following steps depending on your Linux distribution.

Ubuntu, Debian and family

1. Copy the file mod_lianja.so from /opt/lianja/server/drivers/ to /usr/lib/apache2/modules/. The mod_lianja.so file is included in the Lianja App Builder and Lianja Cloud Server installers.

2. Create the file /etc/apache2/mods-available/lianja.load with following contents:

LoadModule recital_module /usr/lib/apache2/modules/mod_lianja.so

3. Edit the required conf files in /etc/apache2/sites-enabled/ setting the DocumentRoot to:

DocumentRoot /opt/lianja/cloudserver/tenants/public/wwwroot

('public' is the default tenancy, set an alternative tenancy as required)

4. Edit /etc/apache2/apache2.conf (or the conf file for specific sites in sites-enabled) and add the following access (changing tenancy as required):

<Directory /opt/lianja/cloudserver/tenants/public/wwwroot/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

5. Optionally redirect the index page to the Lianja login page (login.rsp) by adding the following to the site(s) conf files:

<Location "/">
    Redirect permanent "/index.html" "/login.rsp"
</Location>

6. Enable the lianja module:

$ sudo a2enmod lianja

7. Check that there are no syntax errors in the conf files:

$ sudo apache2ctl configtest

8. Restart apache

$ sudo service apache2 restart

RedHat Family

1. Copy the file mod_lianja.so from /opt/lianja/server/drivers/ to /etc/httpd/modules/

2. Edit the /etc/httpd/conf/httpd.conf file

  • Change the DocumentRoot to:
DocumentRoot "/opt/lianja/cloudserver/tenants/public/wwwroot"

('public' is the default tenancy, set an alternative tenancy as required)

  • Add the following access (changing tenancy as required):
<Directory "/opt/lianja/cloudserver/tenants/public/wwwroot">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

3. Create the file /etc/httpd/conf.modules.d/lianja.conf with the following line:

LoadModule recital_module modules/mod_lianja.so

4. Restart apache

# systemctl restart httpd.service

Note: If running SELINUX you need to run the command below to allow HTTPD scripts and modules to connect to the network.

# /usr/sbin/setsebool -P httpd_can_network_connect 1

And to set the security context for the Lianja module:

chcon system_u: object_r: httpd_modules_t: s0 /etc/httpd/modules/mod_lianja.so

And to allow http and https firewall access:

# firewall-cmd --zone=public --permanent --add-service=http
# firewall-cmd --zone=public --permanent --add-service=https