Showing posts with label Apache24. Show all posts
Showing posts with label Apache24. Show all posts

Sunday, July 4, 2021

Enable mod_jk module in Apache Webserver

Apache mod_jk module uses for communication between Apache webserver and tomcat application server.


Most of the real-world applications are multi-tier applications and application server always behind the web servers. It will improve application performance and better way of handle load balance between application servers.


Generally, all static content requests serve by webserver and if any dynamic request, then only it will go to application servers such a way it will improve application performance.

 

OS: Windows 10

Webserver: Apache2.4

 

Pre-Requisite


Install Apache server


http://www.liferaysavvy.com/2021/07/install-apache-webserver-in-windows.html

 

Download mod_jk module

 

Apache is providing tomcat connectors that is mod_jk from following website. Download binary version of mod_jk module. We can also build mod_jk from source. All apache modules have extension *.so. Apache Haus is also proving binary version of apache modules.


http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/





Download “tomcat-connectors-1.2.40-windows-x86_64-httpd-2.4.x.zip” from above download page or use direct link below.


http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/tomcat-connectors-1.2.40-windows-x86_64-httpd-2.4.x.zip


Extract “tomcat-connectors-1.2.40-windows-x86_64-httpd-2.4.x.zip” it contains “mod_jk.so” file.





 

 

 

Copy “mod_jk.so” file to Apache24 module directory





 

Load Module

 

Create mod_jk configuration file in apache conf extra directory “C:\Apache2441\conf\extra” and add load module configurations as follows. Configuration also covered log location and its format.



LoadModule jk_module "${SRVROOT}/modules/mod_jk.so"

<IfModule jk_module>

    JkLogFile ${SRVROOT}/logs/mod_jk.log

    JkLogStampFormat "[%b %d %Y - %H:%M:%S] "

    JkRequestLogFormat "%w %V %T"

    JkLogLevel info

    JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

</IfModule>


 



Include “mod_jk” configuration in httpd.conf


Open “httpd.conf” file in the apache conf directory and include “mod_jk” configuration as follows.





 

# mod_jk configurations

Include conf/extra/mod_jk.conf

 

 

Start Apache


Once enabled the mod_jk module, start/restart server. Access default page in browser.


http://localhost/

 




Verify mod_jk loading


Once apache is started successfully you can see mod_jk.log file in the apache logs directory. If you open the logs we can see below message for successful loading of module or we can see error information.

mod_jk/1.2.40 initialized




 

Author

 

 

 

 

Install Apache Webserver in Windows

 

Download Apache for windows


Apache Haus is providing windows version of webserver binaries and its required modules.

Following is Apache Haus website download page and can download apache webserver for windows.

https://www.apachehaus.com/cgi-bin/download.plx






OS: Windows 10

Current installation demonstrated for Windows 10 OS. Download “httpd-2.4.48-o111k-x64-vs16.zip” from above download page.

Direct Link is below

https://www.apachehaus.com/downloads/httpd-2.4.48-o111k-x64-vs16.zip

 

Extract


Once downloaded binary version of Apache web server for windows 10 extract in your local machine. It contains root directory Aapche24.

Copy Apache24 directory to your system C:/ Drive




Start Apache


Open window command prompt locates to Apache24 bin directory and run httpd.exe




 

Verify installation


Access localhost form the browser and it render “Apache Haus” default webpage and it confirms that you have successfully installed Apache Web server in your local windows machine.


http://localhost/




 

Notes:


Apache installation is required Visual Studio 2017 (VC15) or Visual Studio 2019 (VS16).

Visual Studio 2019 (VS16) compatible Apache version is “httpd-2.4.48-o111k-x64-vs16.zip

Visual Studio 2017 (VC15) compatible Apache version is “httpd-2.4.48-o111k-x64-vc15.zip


References


https://www.apachehaus.com/cgi-bin/download.plx


Author

Recent Posts

Recent Posts Widget

Popular Posts