logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



mod_proxy_cluster

 
Post new topic   Reply to topic    Apache Forum Index -> Apache third-party Modules



View previous topic :: View next topic  
Author Message
Karm



Joined: 26 Jun 2017
Posts: 3
Location: Czech Republic

PostPosted: Wed 28 Jun '17 15:59    Post subject: mod_proxy_cluster Reply with quote

Hello,

WTF is mod_cluster and why are you posting about it?

my name is Karm, and I keep spending some time on revamping mod_cluster project [1].
In a nutshell, mod_cluster project consists of two parts:

- mod_proxy_cluster httpd modules acting as dynamically configurable proxy offering high-availability and load balancing [2]
- mod_cluster Java library for Tomcat 6+, JBoss AS 7+, Wildfly [3]

These Tomcat/JBoss AS/Wildfly workers send their addresses and deployed contexts to the balancer.
One doesn't have to configure ProxyPass, mod_cluster does it automatically. Workers also
send information about their load calculated with various metrics, deploy/undeploy events etc.

Apache Lounge httpd and mod_proxy.lib

mod_proxy_cluster modules use "private" mod_proxy structures, so it is
not safe to load mod_proxy_cluster modules into httpd it was not compiled with.

I would like to start providing mod_proxy_cluster Windows builds
for ApacheLounge httpd. With my own httpd on Windows, I have
mod_proxy.lib available [4], although I cannot find it in ApacheLounge distro zips.

So, I extract symbols from mod_proxy.so and create a new file with EXPORTS on its first line,
followed by one name of the exported symbol per line, e.g. 64bit
Code:

EXPORTS
ap_proxy_acquire_connection
ap_proxy_backend_broke
ap_proxy_buckets_lifetime_transform
<SNIP>

or with 32bit version:
Code:

EXPORTS
_ap_proxy_acquire_connection@16
_ap_proxy_backend_broke@8
_ap_proxy_buckets_lifetime_transform@12
<SNIP>

This is how I generate it:
Code:

SET HTTPD_DEV_HOME=%WORKSPACE%\httpd-apache-lounge\Apache24
dumpbin /exports /nologo /out:!HTTPD_DEV_HOME!\lib\mod_proxy.def.tmp !HTTPD_DEV_HOME!\modules\mod_proxy.so

echo EXPORTS> !HTTPD_DEV_HOME!\lib\mod_proxy.def
powershell -Command "(Get-Content !HTTPD_DEV_HOME!\lib\mod_proxy.def.tmp) ^| Foreach-Object {$_ -replace '.*\s(_?ap_proxy.*^|_?proxy_.*)$','$1'} ^| select-string -pattern '^^_?ap_proxy^|^^_?proxy_' ^| Add-Content !HTTPD_DEV_HOME!\lib\mod_proxy.def"

if "%arch%" equ "64" (
    lib /def:!HTTPD_DEV_HOME!\lib\mod_proxy.def /OUT:!HTTPD_DEV_HOME!\lib\mod_proxy.lib /MACHINE:X64 /NAME:mod_proxy.so
) else (
    lib /def:!HTTPD_DEV_HOME!\lib\mod_proxy.def /OUT:!HTTPD_DEV_HOME!\lib\mod_proxy.lib /MACHINE:X86 /NAME:mod_proxy.so
)

Then I use the new mod_proxy.lib file:
Code:

cmake -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DAPR_LIBRARY=%HTTPD_DEV_HOME_POSSIX%/lib/libapr-1.lib ^
-DAPR_INCLUDE_DIR=%HTTPD_DEV_HOME_POSSIX%/include/ ^
-DAPACHE_INCLUDE_DIR=%HTTPD_DEV_HOME_POSSIX%/include/ ^
-DAPRUTIL_LIBRARY=%HTTPD_DEV_HOME_POSSIX%/lib/libaprutil-1.lib ^
-DAPRUTIL_INCLUDE_DIR=%HTTPD_DEV_HOME_POSSIX%/include/ ^
-DAPACHE_LIBRARY=%HTTPD_DEV_HOME_POSSIX%/lib/libhttpd.lib ^
-DPROXY_LIBRARY=%HTTPD_DEV_HOME_POSSIX%/lib/mod_proxy.lib ^
%WORKSPACE_POSSIX%/mod_proxy_cluster/native/

It works fine with 64bit build, i.e. /MACHINE:X64 for lib tool and vcvars64.bat before cmake is called. The aforementioned mod_proxy.lib generation procedure utterly fails with 32bit build though, as described below:

QUESTION: 32bit: LNK2019: unresolved external symbol: __imp__...

I must have misunderstood something profound about debug builds and linking modules I am afraid, because I have no idea why 32bit flavor falls flat on its face [5] and 64bit build passes. I use MSVC 19.0.24213.1.

I'm new to MSVC toolchain, coming from purely Linux background and struggling heavily. I'm glad for any pointers (pun not intended) that would bring me closer to offering regular builds of mod_proxy_cluster to Apache Lounge users.

Cheers
Karm
karm fedoraproject.org
Fedora & JBoss community

[1] http://modcluster.io/
[2] https://github.com/modcluster/mod_proxy_cluster
[3] https://github.com/modcluster/mod_cluster/
[4] https://ci.modcluster.io/job/httpd-windows/arch=64,label=w2k12r2/
[5] https://www.hastebin.com/uxekuguxuk.pas
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2581
Location: Hilversum, NL, EU

PostPosted: Wed 28 Jun '17 16:55    Post subject: Reply with quote

I see you use httpd 2.4.25 from here.

Does it help I mail you the mod_proxy.lib's from 2.4.26 ?

VC14 or VC15 ?
Back to top
Karm



Joined: 26 Jun 2017
Posts: 3
Location: Czech Republic

PostPosted: Wed 28 Jun '17 17:01    Post subject: Reply with quote

Hi Steffen,

I would like to build with ApacheLounge 2.4.26 with VC15 (I recently upgraded from VC14).

I appreciate the offer of mailing the file to me, but I'm looking for a permanent solution. You see, I would like the CI to produce two mod_proxy_cluster Windows builds regularly: One with JBoss devel httpd and one with the latest ApacheLounge httpd.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 6255
Location: Germany, Next to Hamburg

PostPosted: Wed 28 Jun '17 17:04    Post subject: Reply with quote

I had such an issue when for some reason the VC versions mixed or something in the path was wrong and the compiler tried to link 32bit and 64 bit binaries. I tried to get mod_svn See https://www.apachehaus.com/forum/index.php?topic=1351

Maybe try /MACHINE:X86 for the Win32 build.
Back to top
Karm



Joined: 26 Jun 2017
Posts: 3
Location: Czech Republic

PostPosted: Tue 04 Jul '17 18:58    Post subject: [SOLVED] mod_proxy_cluster for Apache Lounge HTTP Server Reply with quote

Hi guys,
mod_proxy_cluster [1] modules are now available for Apache Lounge HTTP Server [2].
Our new CI will be building both with our JBoss-ish httpd and with Apache Lounge httpd on Windows.

The build contains a dead-simple smoke test that mimics initial messages from a worker node
(without starting Wildfly or Tomcat though [3]), so the build should [4] never be completely
in shambles. Usual disclaimers apply, it is a CI on master intended for developers after all...

If anyone finds mod_cluster project useful, or if there are any doubts or questions, drop us a line:

* Apache Lounge / Windows httpd modules related: I'll be watching this thread
* Java Wildfly/Tomcat mod_cluster workers and/or other mod_cluster stuff: our JBoss community forum [5]

Cheers
Karm
karm fedoraproject.org
Fedora & JBoss community

[1] https://github.com/modcluster/mod_proxy_cluster
[2] https://ci.modcluster.io/job/mod_proxy_cluster-2.x-windows/DISTRO=apache-lounge,arch=64,label=w2k12r2/55/artifact/mod_proxy_cluster-2.0.0.Alpha1-SNAPSHOT-edd4299-apachelounge-2.4.26-Win64.zip
[3] https://github.com/modcluster/ci.modcluster.io/blob/master/windows/mod_proxy_cluster/build.bat#L117
[4] https://www.ietf.org/rfc/rfc2119.txt
[5] https://developer.jboss.org/en/mod_cluster
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache third-party Modules
Page 1 of 1