mod_jk version not available for Apache 2.4 in RHEL7 - apache

Recently was trying to setup load balancing using mod_jk in apache 2.4 in RHEL 7.
The web server and application are hosted in Amazon Cloud Service.The problem i am facing is with versions of mod_jk. Apparently lot of searching i got to know that latest version of mod_jk is available untill apache 2.2.X versions.I am getting mod_jk would not be loaded error.Please provide inputs on this issue.In am not able to down grade it to 2.2 either.
mod_jk.conf
LoadModule jk_module modules/mod_jk.so
JkWorkersFile conf/workers.properties
JkLogFile logs/mod_jk.log
JkMount /application/* loadbalancer
workers.properties
worker.list=loadbalancer,status
worker.node1.port=8009
worker.node1.host=node1.mydomain.com
worker.node1.type=ajp13
worker.node1.ping_mode=A
worker.node1.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=node1,node2
worker.loadbalancer.sticky_session=1
worker.status.type=status

You can install mod_jk by following the below steps:
# cd /var/java/
# mkdir mod-jk
# cd mod-jk
# wget http://www.eu.apache.org/dist/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.41-src.tar.gz
# tar -xf tomcat-connectors-1.2.41-src.tar.gz
# yum install -y httpd-devel gcc gcc-c++ make libtool
# cd tomcat-connectors-1.2.41-src/native
# ./configure --with-apxs=/usr/sbin/apxs
# make
# libtool --finish /usr/lib64/httpd/modules
# make install
# service httpd restart

The link in Ghayel's answer is dead, but you can download tomcat-connectors from: https://tomcat.apache.org/download-connectors.cgi

I get it work on 2021-03-02 using this tomcat tarball :
https://downloads.apache.org/tomcat/tomcat-connectors/jk/tomcat-connectors-1.2.48-src.tar.gz
Before, I had the same error as describe after upgrading from RHEL6 to RHEL7.
httpd refuse to start with error :
Syntax error on line 4 of /etc/httpd/conf.d/svc_jk.conf: Cannot load modules/mod_jk.so into server: /etc/httpd/modules/mod_jk.so: undefined symbol: ap_log_error
Having a deeper look show me that my mod_jk was not update by RHEL upgrader process and the current mod_jk was not availiable for httpd in yum repository
The ONLY change I did is from the configure command I ran :
./configure --with-apxs=/usr/bin/apxs
(I found apxs from httpd-devel in /usr/bin not in /usr/sbin )
And effectively, "make install" publish the new mod_jk.so in /usr/lib64/httpd/modules , not "libtool --finish /usr/lib64/httpd/modules"
Regards
nbanba

Related

How to enable Brotli on Debian 10 with DirectAdmin?

I'm running the latest version of DA (1.61.3), PHP 7.4.7 en Apache 2.4.43 on a Debian 10 server. I want to add Brotli support en did this:
Installed Brotli package on Debian (apt-get install brotli)
Added brotli module to apache for custombuild, following: https://help.directadmin.com/item.php?id=191 (--with-brotli)
After this I checked at https://www.brotli.pro and https://tools.keycdn.com/brotli-test, but it fails, says: no Brotli support.
In PHP info I see under the section curl this:
Before BROTLI was not mentoined here, so something is installed, but as you can see the value is "No".
What do I have to do more to enable Brotli?
Thanks for help!
Try this ...
Check if the brotli module is really active in Apache:
httpd -t -D DUMP_MODULES
then recompile the php
cd /usr/local/directadmin/custombuild
./build php
./build rewrite_confs

Apache passenger stopped work after upgrade passenger from 5.1.12 to 5.20

After upgrade Apache module Passenger from 5.1.12 to 5.2.0 Apache doesn't start properly and exit with the error
# apache2ctl configtest
Invalid command 'PassengerResolveSymlinksInDocumentRoot', perhaps misspelled or defined by a module not included in the server configuration
After comment string in Apache virtual host
# PassengerResolveSymlinksInDocumentRoot on
Apache starts but Redmine doesn't work showing listing directoty/files insted of main page(another words can't find index file)
OS: Ubuntu 14.04.5 LTS
# dpkg -l | grep passenger
ii libapache2-mod-passenger 1:5.2.0-1~trusty1
ii passenger 1:5.2.0-1~trusty1
ii passenger-dev 1:5.2.0-1~trusty1
ii passenger-doc 1:5.2.0-1~trusty1
All packets is installed from oss-binaries.phusionpassenger.com
# cat /etc/apt/sources.list.d/passenger.list
deb https://oss-binaries.phusionpassenger.com/apt/passenger trusty main
Module passenger is enable
# a2query -m | grep pass
passenger (enabled by site administrator)
I have tried reinstall passenger(delete and install again)
# apt-get remove -y passenger libapache2-mod-passenger
# apt-get install -y libapache2-mod-passenger
However it hasn't helped to resove the issue
# passenger-config validate-install
What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'
‣ ⬢ Passenger itself
⬡ Apache
-------------------------------------------------------------------------
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓
# passenger-config validate-install
What would you like to validate?
Use <space> to select.
If the menu doesn't display correctly, press '!'
⬢ Passenger itself
‣ ⬡ Apache
-------------------------------------------------------------------------
* Checking whether this Passenger install is in PATH... ✓
* Checking whether there are no other Passenger installations... ✓
Passenger status
# passenger-status
Version : 5.2.0
Date : 2018-02-05 12:23:58 +0100
Instance: homhYxzl (Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.2.0)
----------- General information -----------
Max pool size : 6
App groups : 0
Processes : 0
Requests in top-level queue : 0
# passenger-install-apache2-module
The Phusion Passenger Apache module is correctly installed :-)
P.S. I have managed to resolve the issue
PassengerResolveSymlinksInDocumentRoot
This option has been removed in 5.2.0 version according to
https://blog.phusion.nl/2018/01/29/passenger-5-2-0/
So there are 2 ways to fix it
1.Don't use symbol links in DocumentRoot
2.Use parameter PassengerAppRoot in virtual host Apache(if you use symbol link in DocumentRoot)
<VirtualHost *:443>
ServerName myservername
DocumentRoot /var/www/redmine
PassengerAppRoot /opt/redmine/redmine
…
</VirtualHost>
# ls -l /var/www/redmine
lrwxrwxrwx 1 root root 27 Apr 27 2017 /var/www/redmine -> /opt/redmine/redmine/public
From 5.2.0 Breaking change overview:
We've removed PassengerResolveSymlinksInDocumentRoot. It was an old
compatibility option for Passenger version 2. Switch to
PassengerAppRoot if you are setting the application root via a
document root containing symlinks.
Use PassengerAppRoot to specify your application's root directory
I resolve this problem with downgrade passenger version.
1) Uninstall new version:
apt-get remove -y passenger libapache2-mod-passenger
2) Install specific version:
sudo apt-get install passenger=1:5.1.12-1~trusty1
sudo apt-get install libapache2-mod-passenger=1:5.1.12-1~trusty1
sudo apt-get install passenger-dev=1:5.1.12-1~trusty1
3) Enaple apache module:
sudo a2enmod passenger
4) Restart apache:
sudo service apache2 restart
5) Enjoy

uwsgi and apache2 issue

I'm having trouble with setting up uwsgi behind apache2.
Here's my system:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.5 LTS
Release: 12.04
Codename: precise
$ apache2 -v
Server version: Apache/2.4.20 (Ubuntu)
$ uwsgi --version
2.0.14
$ cat /etc/init/uwsgi.conf
description "uWSGI Emperor"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals/ --logto /var/log/uwsgi.log
$ python --version
Python 2.7.3
With
$ cat ~/myapp/wsgi.py
def application(environ, start_response):
start_response('200 OK', [('Content-Type', 'text/html')])
return ["<h1 style='color:blue'>Hello There!</h1>"]
and
$ cd ~/myapp
$ uwsgi --socket 0.0.0.0:8081 --protocol=http -w wsgi
i can browse to http://example.com:8081 and see the "Hello there!" test page. So, I'm assuming uwsgi is working correctly. However, I want to put uwsgi behind apache2, but whenenver I try
$ a2enmod uwsgi
and restart apache2 I get an error that I can't make sense of:
$ service apache2 restart
* Restarting Apache httpd web server apache2 [fail]
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf:
Syntax error on line 1 of /etc/apache2/mods-enabled/uwsgi.load:
Cannot load /usr/lib/apache2/modules/mod_uwsgi.so into server:
/usr/lib/apache2/modules/mod_uwsgi.so: cannot open shared object file:
No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
Can anyone help me with this? I have searched for hours but I can't find aynthing that helped me with this..
Thank you very much in advance.
PS: Oh, and I couldn't find any relevant information in the apache error logs.
In case anyone is interested, here's how i got it to work:
Instead of using the uwsgi_mod, i simply proxied everything in my apache configuration:
<VirtualHost *:80>
...
ProxyPreserveHost On
ProxyRequests Off
ProxyVia Off
ProxyPass / http://127.0.0.1:8081/
ProxyPassReverse / http://127.0.0.1:8081/
</VirtualHost>
The uwsgi command would run with uwsgi --ini uwsgi.ini where uwsgi.ini would contain the following lines
[uwsgi]
chdir = path/to/my/project
http-socket = :8081
module = wsgi:application
...
That way i don't need to run the uwsgi_mod and everything works. Hopefully that helps anyone, someday.

cloudflare install error on apache : httpd is needed by mod_cloudflare

I tried to install mod_cloudflare on Apache.
but it says :
# rpm -i mod_cloudflare-el6-x86_64.latest.rpm
mod_cloudflare-el6-x86_64.latest.rpm: Header V4 DSA/SHA1 Signature, key ID 8e5f9a5d: NOKEY
error: Failed dependencies:
httpd is needed by mod_cloudflare-1.2.0-1360806316.el6.x86_64
but I have apache installed :
# httpd -v
Server version: Apache/2.4.12 (Unix)
Server built: Apr 16 2015 16:27:46
Cpanel::Easy::Apache v3.28.7 rev9999
How can I make it work?!
have you install glibc
try yum install glibc.i686 and try rpm -i mod_cloudflare-el6-x86_64.latest.rpm again. hope it works
For CentOS:
# yum install libtool httpd-devel
# wget https://www.cloudflare.com/static/misc/mod_cloudflare/mod_cloudflare.c
# apxs -a -i -c mod_cloudflare.c
Add the following line within the Webuzo Apache Configuration:
LoadModule cloudflare_module /usr/lib64/httpd/modules/mod_cloudflare.so
Restart Apache.
mod_cloudflare is now working
You are probably better off following the manual installation guide on cloudflares site for mod_apache:
http://www.cloudflare.com/resources-downloads

How to upgrade apache 2.2.15 to apache 2.4.12 on CentOS 6.6?

I tried ,but didn't work for me.
Apache 2.4 on CentOS 6.6:
Step 1:
cd /etc/yum.repos.d/
wget http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-httpd24.repo
Step 2:
yum install httpd24.x86_64
Step 3:
$ /opt/rh/httpd24/root/usr/sbin/httpd -version
Server version: Apache/2.4.6 (Red Hat)
Server built: Sep 25 2013 05:25:46
NOTE: config files are in: /opt/rh/httpd24/root/etc/httpd
$ ls
conf conf.d conf.modules.d logs modules run
EDIT: in case you want to switch off Apache 2.2
$ chkconfig httpd off
$ chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
httpd24-httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
EDIT 2: http://wiki.apache.org/httpd/PHP-FPM
yum install php-fpm
/etc/init.d/php-fpm start
Does any body knows the solutions, please let me know.
It would be best if you built it yourself from the Apache source code on a CentOS 6.6 system.
Compiling and Installing Apache 2.4:
http://httpd.apache.org/docs/current/install.html
Make note of the configure line during the build so you can make sure it includes all the modules you want (Like mod_ssl...etc..). Details on what is available for the configure line located here http://httpd.apache.org/docs/current/programs/configure.html
$ CC="pgcc" CFLAGS="-O2" \
./configure --prefix=/sw/pkg/apache \
--enable-ldap=shared \
--enable-lua=shared
If you want your own RPM, create a SPEC file with your own customizations.
The easiest way is to install the SCL version, as described here:
https://unix.stackexchange.com/questions/412122/how-to-update-apache-to-2-4-29-using-scl