Hi,

I think there is an issue in mod_slotmem_shm / mod_proxy_balancer
with httpd 2.4.x when building and installing as root, but trying
to run httpd as standard unix-user.

Scenario:
my httpd is installed as 'root' in /root/httpd-2.4.1/, permissions
root:root/0755. When I create a 'user' httpd.conf and load slotmem_shm_module,
proxy_module, proxy_http_module and proxy_balancer_module and do some
balancer configuration, the httpd doesn't come up. Error log (trace8):
[Mon Mar 05 11:36:40.739013 2012] [proxy_balancer:debug] [pid 27793:tid
 140642808817440] mod_proxy_balancer.c(751): AH01178: Doing balancers create: 
544, 1 (6)
[Mon Mar 05 11:36:40.739054 2012] [proxy_balancer:emerg] [pid 27793:tid
 140642808817440] (13)Permission denied: AH01179: balancer slotmem_create failed
[Mon Mar 05 11:36:40.739080 2012] [:emerg] [pid 27793:tid
 140642808817440] AH00020: Configuration Failed, exiting


In strace you can see that httpd is trying to create mutex(?) files in
installation root directory, which belongs to user 'root' and is not
writeable for other users:
open("/root/httpd-2.4.1/s29df2056", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such 
file or directory)
open("/root/httpd-2.4.1/s29df2056", O_WRONLY|O_CLOEXEC) = -1 ENOENT (No such 
file or directory)
open("/root/httpd-2.4.1/s29df2056", O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, 0666) = 
-1 EACCES (Permission denied)


I tried to change the mutex location with the mutex directive and
"proxy-balancer-shm", but that doesn't work:
Mutex file:/tmp/ proxy-balancer-shm
Syntax seems to be OK, but this configuration item is ignored completely.


config extraction:
ServerRoot "/root/httpd-2.4.1"

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so

Mutex file:/tmp/ proxy-balancer-shm

<Proxy balancer://default>
    BalancerMember http://appserver1.localhost:3001 route=0
    BalancerMember http://appserver2.localhost:3001 route=1
    ProxySet lbmethod=byrequests stickysession=JSESSIONID|jsessionid
</Proxy>

ProxyPassMatch /servlet/ balancer://default/
ProxyPassReverse / balancer://default/



My quick hack to get my apache instance started:
--- httpd-2.4.1/modules/slotmem/mod_slotmem_shm.c
+++ httpd-2.4.1/modules/slotmem/mod_slotmem_shm.c
@@ -269,7 +269,10 @@
     }
     if (name) {
         if (name[0] != '/') {
-            fname = ap_server_root_relative(pool, name);
+            char file_name[100];
+            strcpy(file_name, "/tmp/");
+            strcat(file_name, name);
+            fname = file_name;
         }
         else {
             fname = name;


I think it would make sense to check why the mutex configuration of
proxy-balancer-shm is ignored.



Best regards,
Zisis

Reply via email to