Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: mod_proxy_cluster |
|
Author |
|
Karm
Joined: 26 Jun 2017 Posts: 3 Location: Czech Republic
|
Posted: Wed 28 Jun '17 15:59 Post subject: mod_proxy_cluster |
|
|
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: 3092 Location: Hilversum, NL, EU
|
Posted: Wed 28 Jun '17 16:55 Post subject: |
|
|
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
|
Posted: Wed 28 Jun '17 17:01 Post subject: |
|
|
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: 7371 Location: Germany, Next to Hamburg
|
Posted: Wed 28 Jun '17 17:04 Post subject: |
|
|
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
|
|
Back to top |
|
|
|
|
|
|