Difference between revisions of "Apache Module for Linux"

From Lianjapedia
Jump to: navigation, search
(RedHat Family)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==See Also==
 
==See Also==
[[ISAPI Extension for IIS]], [[Lianja Server Manager on Linux]]
+
[[Creating a Self-Signed Certificate (Linux Apache)]], [[Creating a Self-Signed Certificate (Windows IIS)]], [[ISAPI Extension for IIS]], [[Lianja Server Manager on Linux]]
  
 
==Overview==
 
==Overview==
Line 12: Line 12:
 
==Ubuntu, Debian and family==
 
==Ubuntu, Debian and family==
  
1. Copy the file '''mod_lianja.so''' from '''/opt/lianja/drivers/''' to '''/usr/lib/apache2/modules/'''
+
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:
 
2. Create the file '''/etc/apache2/mods-available/lianja.load''' with following contents:
Line 21: Line 21:
 
('public' is the default tenancy, set an alternative tenancy as required)
 
('public' is the default tenancy, set an alternative tenancy as required)
  
4. Edit '''/etc/apache2/apache2.conf''' and add the following access (changing 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):
 
<pre><Directory /opt/lianja/cloudserver/tenants/public/wwwroot/>
 
<pre><Directory /opt/lianja/cloudserver/tenants/public/wwwroot/>
 
     Options Indexes FollowSymLinks
 
     Options Indexes FollowSymLinks
Line 28: Line 28:
 
</Directory></pre>
 
</Directory></pre>
  
5. Enable the lianja module:
+
5. Optionally redirect the index page to the Lianja login page (login.rsp) by adding the following to the site(s) conf files:
 +
<pre><Location "/">
 +
    Redirect permanent "/index.html" "/login.rsp"
 +
</Location></pre>
 +
 
 +
6. Enable the lianja module:
 
<pre>$ sudo a2enmod lianja</pre>
 
<pre>$ sudo a2enmod lianja</pre>
  
6. Restart apache
+
7. Check that there are no syntax errors in the conf files:
 +
<pre>$ sudo apache2ctl configtest</pre>
 +
 +
8. Restart apache
 
<pre>$ sudo service apache2 restart</pre>
 
<pre>$ sudo service apache2 restart</pre>
  
==RedHat, Centos, Fedora==
+
==RedHat Family==
  
1. Copy the file '''mod_lianja.so''' from '''/opt/lianja/drivers/''' to '''/etc/httpd/modules/'''
+
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
 
2. Edit the '''/etc/httpd/conf/httpd.conf''' file
Line 51: Line 59:
 
</Directory></pre>
 
</Directory></pre>
  
3. Create the file '''/etc/httpd/conf.d/lianja.conf''' with the following line:
+
3. Create the file '''/etc/httpd/conf.modules.d/lianja.conf''' with the following line:
 
<pre>LoadModule recital_module modules/mod_lianja.so</pre>
 
<pre>LoadModule recital_module modules/mod_lianja.so</pre>
  
Line 60: Line 68:
  
 
<pre># /usr/sbin/setsebool -P httpd_can_network_connect 1</pre>
 
<pre># /usr/sbin/setsebool -P httpd_can_network_connect 1</pre>
 +
 +
And to set the security context for the Lianja module:
 +
 +
<pre>chcon system_u: object_r: httpd_modules_t: s0 /etc/httpd/modules/mod_lianja.so</pre>
  
 
And to allow http and https firewall access:
 
And to allow http and https firewall access:
Line 67: Line 79:
  
 
[[Category:Lianja v4.0]]
 
[[Category:Lianja v4.0]]
 +
[[Category:Lianja Cloud Server]]
 +
[[Category:Lianja Server]]
 +
[[Category:Installation on Linux]]
 +
[[Category:Installation]]

Latest revision as of 11:35, 23 November 2021

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