Legacy Knowledge Base
Published Sep. 10, 2025

Set up the Apache web server and connect it to Tomcat-based Liferay using mod_jk

Written By

Madhusudan Sharma

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How to articles!

While we make every effort to ensure this Knowledge Base is accurate,it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • How can we install an apache web server and connect the same with the application server over a Linux-based operating system?

Environment

  • Liferay DXP 7.4

Resolution

  • The following are the steps that will help you set up the Apache web server and connect it to Tomcat-based Liferay using mod_jk:
    1. Prerequisites: Tomcat bundled Liferay and Sudoer user to install and configure HTTPD.
    2. Install httpd using the command: sudo yum install httpd.
    3. Install Associated packages using sudo yum install httpd-devel apr apr-devel apr-util apr-util-devel gcc gcc-c++ make autoconf libtool
    4. Verify the installation: Go to /etc/httpd/ and check the list of files there.
    5. Run the sudo systemctl start httpd.service command to start the Apache server and test on the browser for the default landing page.
    6. Install mod_jk: Follow the below commands to make and install mod_jk connector from the source:
    1. sudo wget https://archive.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.49-src.tar.gz 
    2. sudo tar -xvzf tomcat-connectors-1.2.49-src.tar.gz
    3. cd tomcat-connectors-1.2.49-src/native
    4. sudo ./configure --with-apxs=/usr/bin/apxs
    5. sudo dnf install redhat-rpm-config
    6. sudo make
    7. sudo libtool --finish /usr/lib64/httpd/modules
    8. sudo make install
    9. ls /usr/lib64/httpd/modules
    10. ls -l /etc/httpd/modules/mod_jk.so
    11. sudo mkdir -p /var/run/mod_jk
    12. sudo chown apache:apache /var/run/mod_jk
     
    7. Verify if the file mod_jk.so is present at /etc/httpd/modules
    8. Configure AJP in Tomcat: Uncomment the ajp connector from liferay_home/tomcat-9.0.xx/conf/server.xml and edit like below.
    <Connector protocol="AJP/1.3" 
    address="IP of the Liferay Server/Application Server"
    port="8009"
    redirectPort="8443" URIEncoding="UTF-8" secret="Enter a strong secret" />
    Note: Change the IP address to the IP of the Liferay server/Application Server and enter a strong secret in secret.
     
    9. Configure mod_jk: Create and add the below configuration to /etc/httpd/conf/workAers.properties:
    worker.list=loadbalancer 
    worker.loadbalancer.type=lb
    worker.loadbalancer.balanced_workers=node1
    worker.loadbalancer.secret= Add the secret
    worker.node1.host=192.168.122.4
    worker.node1.port=8009
    worker.node1.type=ajp13
    worker.node1.lbfactor=1
    Note: Add the same secret that was added in ajp connector of Liferay.
     
    10. Configure /etc/httpd/conf.d/mod_jk.conf like below:
    LoadModule jk_module "/etc/httpd/modules/mod_jk.so" 
    JkWorkersFile /etc/httpd/conf/workers.properties #Path to workers.properties file created above
    JkShmFile /var/run/httpd/mod_jk.shm #Where to put jk shared memory
    JkLogFile /var/log/httpd/mod_jk.log #Where to put jk logs JkLogFile
    JkLogLevel info #Set the jk log level [debug/error/info]
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " #Select the timestamp log format
     
    11. Add jkmount inside your virtual host configuration -
    JkMount /* loadbalancer 
    JkMount / loadbalancer

    Add the above to the file httpd.conf if SSL is not required and to ssl.conf if SSL is enabled.

Additional Information

  • How to find your IP address in Linux
  • Please note that the installation and configuration of a WebServer on a machine comes under a third-party application and Liferay support will be limited in this case.
Did this article resolve your issue ?

Legacy Knowledge Base