Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
Hi Jim (et all), did you get any other feedback on the slotmem (directory) override? Writing all the slotmem-shm files (for mod_proxy_balancer) in the logs directory looks quite unlovely, e.g. in my configuration with two balancer and shared logs directory: # ls -F1 logs/ error/ access/ slotmem-shm-s45fb3af_default.shm slotmem-shm-s45fb3af_my_second_balancer.shm slotmem-shm-s45fb3af.shm slotmem-shm-s463b4ab_default.shm slotmem-shm-s463b4ab_my_second_balancer.shm slotmem-shm-s463b4ab.shm It would be nice to have a customizable slotmem-prefix and/or target directory for shm files. What do you think? Best regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 7:26:19 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) My plan is 2 pronged... to see if r1297560 is enough and if allowing a slotmem override is even needed (or wanted) ... ;) On Mar 6, 2012, at 12:35 PM, Zisis Lianas wrote: Thanks Jim, that works fine for the default-rel-runtimedir configuration. Slotmem file is created as serverroot/logs/slotmem-shm-s.shm. Now if also the slotmem-file-target-location directive gets available, this thread is done for me. Regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 5:21:22 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) http://svn.apache.org/viewvc?rev=1297560view=rev On Mar 6, 2012, at 10:39 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 10:33 AM, Jim Jagielski j...@jagunet.com wrote: Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On behalf of anyone else reading this thread, here's the idiom from mod_socache_dbm.c: #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR /socache-dbm- ... const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace, NULL); ctx-data_file = ap_server_root_relative(p, path); On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
Yeppers... see 2.4.2 :) On Apr 18, 2012, at 10:28 AM, Zisis Lianas wrote: Hi Jim (et all), did you get any other feedback on the slotmem (directory) override? Writing all the slotmem-shm files (for mod_proxy_balancer) in the logs directory looks quite unlovely, e.g. in my configuration with two balancer and shared logs directory: # ls -F1 logs/ error/ access/ slotmem-shm-s45fb3af_default.shm slotmem-shm-s45fb3af_my_second_balancer.shm slotmem-shm-s45fb3af.shm slotmem-shm-s463b4ab_default.shm slotmem-shm-s463b4ab_my_second_balancer.shm slotmem-shm-s463b4ab.shm It would be nice to have a customizable slotmem-prefix and/or target directory for shm files. What do you think? Best regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 7:26:19 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) My plan is 2 pronged... to see if r1297560 is enough and if allowing a slotmem override is even needed (or wanted) ... ;) On Mar 6, 2012, at 12:35 PM, Zisis Lianas wrote: Thanks Jim, that works fine for the default-rel-runtimedir configuration. Slotmem file is created as serverroot/logs/slotmem-shm-s.shm. Now if also the slotmem-file-target-location directive gets available, this thread is done for me. Regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 5:21:22 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) http://svn.apache.org/viewvc?rev=1297560view=rev On Mar 6, 2012, at 10:39 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 10:33 AM, Jim Jagielski j...@jagunet.com wrote: Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On behalf of anyone else reading this thread, here's the idiom from mod_socache_dbm.c: #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR /socache-dbm- ... const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace, NULL); ctx-data_file = ap_server_root_relative(p, path); On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
Hi Jim, for me/us it's needed, because we operate with multi-instancing. e.g.: Apache installation directory (ServerRoot) is /opt/http-2.4.x/ (belonging to apache:apache). This installation only provides the httpd binaries/modules. Users on this server configure their own apache insances: (user1:group1) /var/www/project1/ \== logs/ (error/access/pid/mutex) \== htdocs/ (content) \== config/ (httpd.conf, includes, etc.) (user2:group2) /var/www/project2/ \== logs/ \== htdocs/ \== config/ (user3:group3) /var/www/project3/ \== logs/ \== htdocs/ \== config/ So a customizable slotmem-shm file would make sense in this scenario. Regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 7:26:19 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) My plan is 2 pronged... to see if r1297560 is enough and if allowing a slotmem override is even needed (or wanted) ... ;) On Mar 6, 2012, at 12:35 PM, Zisis Lianas wrote: Thanks Jim, that works fine for the default-rel-runtimedir configuration. Slotmem file is created as serverroot/logs/slotmem-shm-s.shm. Now if also the slotmem-file-target-location directive gets available, this thread is done for me. Regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 5:21:22 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) http://svn.apache.org/viewvc?rev=1297560view=rev On Mar 6, 2012, at 10:39 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 10:33 AM, Jim Jagielski j...@jagunet.com wrote: Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On behalf of anyone else reading this thread, here's the idiom from mod_socache_dbm.c: #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR /socache-dbm- ... const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace, NULL); ctx-data_file = ap_server_root_relative(p, path); On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
[snip] So to sum up: all uses of DEFAULT_REL_RUNTIMEDIR I can see at the moment are overwritable by configuration. A runtime configurable runtime directory would not be a critical feature but make it easy to move all these objects in a common directory not known at build time. [snip] This is such a common use-case that it would make a lot of sense to provide such a directive. See next mail in this thread for a reference. i -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On Wed, Mar 7, 2012 at 9:39 AM, Zisis Lianas zisis.lia...@consol.de wrote: Hi Jim, for me/us it's needed, because we operate with multi-instancing. e.g.: Apache installation directory (ServerRoot) is /opt/http-2.4.x/ (belonging to apache:apache). This installation only provides the httpd binaries/modules. ServerRoot does not have to be the directory above {bin,libexec,sbin}. It should be the directory above {conf,logs}. When running in this scenario, you do have to have absolute paths to your apache modules, eg: LoadModule status_module /usr/local/libexec/apache22/mod_status.so rather than: LoadModule status_module libexec/apache22/mod_status.so The disadvantage of doing it this way is that you have to specify full paths to all your modules. The disadvantage of doing it your way is that your ServerRoot is not your ServerRoot... Cheers Tom
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
- Original Message - On Wed, Mar 7, 2012 at 9:39 AM, Zisis Lianas zisis.lia...@consol.de wrote: Hi Jim, for me/us it's needed, because we operate with multi-instancing. e.g.: Apache installation directory (ServerRoot) is /opt/http-2.4.x/ (belonging to apache:apache). This installation only provides the httpd binaries/modules. ServerRoot does not have to be the directory above {bin,libexec,sbin}. It should be the directory above {conf,logs}. When running in this scenario, you do have to have absolute paths to your apache modules, eg: LoadModule status_module /usr/local/libexec/apache22/mod_status.so rather than: LoadModule status_module libexec/apache22/mod_status.so The disadvantage of doing it this way is that you have to specify full paths to all your modules. The disadvantage of doing it your way is that your ServerRoot is not your ServerRoot... I think this is exactly the point. You wouldn't want to give up this kind of convenience. Ideally, you'd like to keep both. The only reason I can think of providing different versions of binaries would be to provide a different suexec. But overall it sounds like overkill - same with modules. Cheers Tom i -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
I'll work on it... I already have a version for slotmem, but a generic solution it best, I agree. But what do we call it? DefaultDir? On Mar 7, 2012, at 5:17 AM, Igor Galić wrote: [snip] So to sum up: all uses of DEFAULT_REL_RUNTIMEDIR I can see at the moment are overwritable by configuration. A runtime configurable runtime directory would not be a critical feature but make it easy to move all these objects in a common directory not known at build time. [snip] This is such a common use-case that it would make a lot of sense to provide such a directive. See next mail in this thread for a reference. i -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
I agree that ServerRoot should not be touched or changed, but it begs the question how do we differentiate between what is ServerRoot relative and what is DefaultRuntimeDir ? I guess docs that mention what modules use DefaultRuntimeDir is sufficient? Or maybe we just call it something like SafeWriteDir that says we know that httpd can write to this dir... Or to make it clear that we're talking transitory files, something like TempDir or ScratchSpace ?? On Mar 7, 2012, at 5:50 AM, Igor Galić wrote: - Original Message - On Wed, Mar 7, 2012 at 9:39 AM, Zisis Lianas zisis.lia...@consol.de wrote: Hi Jim, for me/us it's needed, because we operate with multi-instancing. e.g.: Apache installation directory (ServerRoot) is /opt/http-2.4.x/ (belonging to apache:apache). This installation only provides the httpd binaries/modules. ServerRoot does not have to be the directory above {bin,libexec,sbin}. It should be the directory above {conf,logs}. When running in this scenario, you do have to have absolute paths to your apache modules, eg: LoadModule status_module /usr/local/libexec/apache22/mod_status.so rather than: LoadModule status_module libexec/apache22/mod_status.so The disadvantage of doing it this way is that you have to specify full paths to all your modules. The disadvantage of doing it your way is that your ServerRoot is not your ServerRoot... I think this is exactly the point. You wouldn't want to give up this kind of convenience. Ideally, you'd like to keep both. The only reason I can think of providing different versions of binaries would be to provide a different suexec. But overall it sounds like overkill - same with modules. Cheers Tom i -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
- Original Message - I agree that ServerRoot should not be touched or changed, but it begs the question how do we differentiate between what is ServerRoot relative and what is DefaultRuntimeDir ? I guess docs that mention what modules use DefaultRuntimeDir is sufficient? Or maybe we just call it something like SafeWriteDir that says we know that httpd can write to this dir... Or to make it clear that we're talking transitory files, something like TempDir or ScratchSpace ?? I knew this is going to be my favourite part of this discussion ;) So far, DefaultRuntimeDir sounds most reasonable (to me) i -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On Wed, Mar 7, 2012 at 6:37 AM, Jim Jagielski j...@jagunet.com wrote: I'll work on it... I already have a version for slotmem, but a generic solution it best, I agree. But what do we call it? DefaultDir? As I mentioned yesterday, I have thrown together the code for the API and directive and need to test it. On Mar 7, 2012, at 5:17 AM, Igor Galić wrote: [snip] So to sum up: all uses of DEFAULT_REL_RUNTIMEDIR I can see at the moment are overwritable by configuration. A runtime configurable runtime directory would not be a critical feature but make it easy to move all these objects in a common directory not known at build time. [snip] This is such a common use-case that it would make a lot of sense to provide such a directive. See next mail in this thread for a reference. i -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
2012/3/7 Igor Galić i.ga...@brainsware.org: I knew this is going to be my favourite part of this discussion ;) So far, DefaultRuntimeDir sounds most reasonable (to me) I'd like it green! But seriously, doesn't this directive change the runtime directory from the default to something not the default? In which case, a simple RuntimeDir may be better? Cheers Tom
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
Yeah, it's pretty ez actually... ap_scratch_space (or whatever) which is an extern. And then the changes from DEFAULT_REL_RUNTIMEDIR to ap_scratch_space except for the initial setting of ap_scratch_space to it. Some places will need a strcat instead of using cpp string concat, but not too bad at all... On Mar 7, 2012, at 6:54 AM, Jeff Trawick wrote: On Wed, Mar 7, 2012 at 6:37 AM, Jim Jagielski j...@jagunet.com wrote: I'll work on it... I already have a version for slotmem, but a generic solution it best, I agree. But what do we call it? DefaultDir? As I mentioned yesterday, I have thrown together the code for the API and directive and need to test it. On Mar 7, 2012, at 5:17 AM, Igor Galić wrote: [snip] So to sum up: all uses of DEFAULT_REL_RUNTIMEDIR I can see at the moment are overwritable by configuration. A runtime configurable runtime directory would not be a critical feature but make it easy to move all these objects in a common directory not known at build time. [snip] This is such a common use-case that it would make a lot of sense to provide such a directive. See next mail in this thread for a reference. i -- Igor Galić Tel: +43 (0) 664 886 22 883 Mail: i.ga...@brainsware.org URL: http://brainsware.org/ GPG: 6880 4155 74BD FD7C B515 2EA5 4B1D 9E08 A097 C9AE -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On Wed, Mar 7, 2012 at 6:59 AM, Tom Evans tevans...@googlemail.com wrote: 2012/3/7 Igor Galić i.ga...@brainsware.org: I knew this is going to be my favourite part of this discussion ;) So far, DefaultRuntimeDir sounds most reasonable (to me) That's what I have (along with ap_runtime_dir_relative()). I'd like it green! But seriously, doesn't this directive change the runtime directory from the default to something not the default? In which case, a simple RuntimeDir may be better? Cheers Tom -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On Windows this happens, too when not running as Adminstrator. Running the same config as Administrator it works smoothly. [Tue Mar 06 09:53:59.734436 2012] [proxy_balancer:emerg] [pid 7064:tid 356] (OS 5)Access forbidden : AH01179: balancer slotmem_create failed [Tue Mar 06 09:53:59.735436 2012] [:emerg] [pid 7064:tid 356] AH00020: Configuration Failed, exiting Cheers Mario P.S.: No TOFU please ;-)
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
OK... What I'll do is add a directive which provides a default location for slotmem file... On Mar 5, 2012, at 1:53 PM, Zisis Lianas wrote: I can reproduce this on SuSE Linux Enterprise 11sp1 (x86_64, 2.6.32.12-0.7-xen) and Ubuntu 11.04 (x86_64, 2.6.38.x). - Ursprüngliche Mail - Von: Jim Jagielski j...@apache.org An: dev@httpd.apache.org Gesendet: Montag, 5. März 2012 19:15:03 Betreff: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) What system is this... I'm assuming that your shm impl does an actual file connection for the shm instance... On Mar 5, 2012, at 10:46 AM, Zisis Lianas wrote: 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
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem?
RE: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
Sounds reasonable. -Original Message- From: Jeff Trawick [mailto:traw...@gmail.com] Sent: Dienstag, 6. März 2012 14:37 To: dev@httpd.apache.org Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem?
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On Tue, Mar 6, 2012 at 8:38 AM, Plüm, Rüdiger, VF-Group ruediger.pl...@vodafone.com wrote: Sounds reasonable. BTW, I started sketching out a RuntimeDir directive and ap_runtime_dir_relative() API. (i.e., I threw some code together but I don't have time this a.m. to test it ;) ). If something like that is considered the basis of an appropriate resolution to this particular problem, I'll proceed in the short term. Otherwise, I may wait for a rainy day. -Original Message- From: Jeff Trawick [mailto:traw...@gmail.com] Sent: Dienstag, 6. März 2012 14:37 To: dev@httpd.apache.org Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem?
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On Tue, Mar 6, 2012 at 10:33 AM, Jim Jagielski j...@jagunet.com wrote: Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On behalf of anyone else reading this thread, here's the idiom from mod_socache_dbm.c: #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR /socache-dbm- ... const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace, NULL); ctx-data_file = ap_server_root_relative(p, path); On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
http://svn.apache.org/viewvc?rev=1297560view=rev On Mar 6, 2012, at 10:39 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 10:33 AM, Jim Jagielski j...@jagunet.com wrote: Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On behalf of anyone else reading this thread, here's the idiom from mod_socache_dbm.c: #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR /socache-dbm- ... const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace, NULL); ctx-data_file = ap_server_root_relative(p, path); On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
Thanks Jim, that works fine for the default-rel-runtimedir configuration. Slotmem file is created as serverroot/logs/slotmem-shm-s.shm. Now if also the slotmem-file-target-location directive gets available, this thread is done for me. Regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 5:21:22 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) http://svn.apache.org/viewvc?rev=1297560view=rev On Mar 6, 2012, at 10:39 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 10:33 AM, Jim Jagielski j...@jagunet.com wrote: Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On behalf of anyone else reading this thread, here's the idiom from mod_socache_dbm.c: #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR /socache-dbm- ... const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace, NULL); ctx-data_file = ap_server_root_relative(p, path); On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
My plan is 2 pronged... to see if r1297560 is enough and if allowing a slotmem override is even needed (or wanted) ... ;) On Mar 6, 2012, at 12:35 PM, Zisis Lianas wrote: Thanks Jim, that works fine for the default-rel-runtimedir configuration. Slotmem file is created as serverroot/logs/slotmem-shm-s.shm. Now if also the slotmem-file-target-location directive gets available, this thread is done for me. Regards, Zisis - Original Message - From: Jim Jagielski j...@jagunet.com To: dev@httpd.apache.org Sent: Tuesday, March 6, 2012 5:21:22 PM Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) http://svn.apache.org/viewvc?rev=1297560view=rev On Mar 6, 2012, at 10:39 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 10:33 AM, Jim Jagielski j...@jagunet.com wrote: Yeah, that seems better, ala ./modules/cache/mod_socache_dbm.c On behalf of anyone else reading this thread, here's the idiom from mod_socache_dbm.c: #define DEFAULT_DBM_PREFIX DEFAULT_REL_RUNTIMEDIR /socache-dbm- ... const char *path = apr_pstrcat(p, DEFAULT_DBM_PREFIX, namespace, NULL); ctx-data_file = ap_server_root_relative(p, path); On Mar 6, 2012, at 8:36 AM, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielski j...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem? -- Born in Roswell... married an alien...
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On 06.03.2012 15:53, Jeff Trawick wrote: On Tue, Mar 6, 2012 at 8:38 AM, Plüm, Rüdiger, VF-Group ruediger.pl...@vodafone.com wrote: Sounds reasonable. BTW, I started sketching out a RuntimeDir directive and ap_runtime_dir_relative() API. (i.e., I threw some code together but I don't have time this a.m. to test it ;) ). If something like that is considered the basis of an appropriate resolution to this particular problem, I'll proceed in the short term. Otherwise, I may wait for a rainy day. I like the idea even if the current problem will be fixed without. I think the locations of all created or read file can be influenced by configuration except for some implicit files in DEFAULT_REL_RUNTIMEDIR, which is a build time setting. So being able to influence helps in post build adoption of the layout. I hope there's no boostapping problem in the sense of runtimedir needed before config was parsed. Have a rainy day ;) Regards, Rainer -Original Message- From: Jeff Trawick [mailto:traw...@gmail.com] Sent: Dienstag, 6. März 2012 14:37 To: dev@httpd.apache.org Subject: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) On Tue, Mar 6, 2012 at 7:56 AM, Jim Jagielskij...@jagunet.com wrote: OK... What I'll do is add a directive which provides a default location for slotmem file... Uhh, that seems as endless as per-mutex directives. Is slotmem not using DEFAULT_REL_RUNTIMEDIR already? (not perfect, but a good start) Directive to specify runtime directory (API returns serverroot + DEFAULT_REL_RUNTIMEDIR if not configured). Directive like Mutex but for shmem?
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On 3/6/2012 6:32 PM, Rainer Jung wrote: I like the idea even if the current problem will be fixed without. I think the locations of all created or read file can be influenced by configuration except for some implicit files in DEFAULT_REL_RUNTIMEDIR, which is a build time setting. So being able to influence helps in post build adoption of the layout. Yes, this is vital. I'm still trying to grok the intention of DEFAULT_REL_RUNTIMEDIR, but if we are talking about a file used as a mutex/shared file/etc, wouldn't NOT having such a directive or configuration parameter cause contention between multi-instance configurations where httpd -c /path/to/conf1.conf and httpd -c /path/to/conf2.conf end up pointing to the same file even though they share nothing else in common? Seems like some stepping-on-of-toes would occur unless I'm missing something else obvious. -- Daniel Ruggeri
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
On 07.03.2012 02:01, Daniel Ruggeri wrote: On 3/6/2012 6:32 PM, Rainer Jung wrote: I like the idea even if the current problem will be fixed without. I think the locations of all created or read file can be influenced by configuration except for some implicit files in DEFAULT_REL_RUNTIMEDIR, which is a build time setting. So being able to influence helps in post build adoption of the layout. Yes, this is vital. I'm still trying to grok the intention of DEFAULT_REL_RUNTIMEDIR, but if we are talking about a file used as a mutex/shared file/etc, wouldn't NOT having such a directive or configuration parameter cause contention between multi-instance configurations where httpd -c /path/to/conf1.conf and httpd -c /path/to/conf2.conf end up pointing to the same file even though they share nothing else in common? Seems like some stepping-on-of-toes would occur unless I'm missing something else obvious. DEFAULT_REL_RUNTIMEDIR is defined by the layout file and usually it is logs, but could also be run. It should be used relative to the server root. So if you run two servers with different server root, there's no clash of files in DEFAULT_REL_RUNTIMEDIR. By searching the code I find the following things placed in DEFAULT_REL_RUNTIMEDIR: - the pid file. Can be moved using PidFile - mutexes created by the new unified mutex handling. Should be configurable using Mutex - some gprof dump code in the prefork MPM. Not usually used and code comments indicate, that the directory is also configurable (not checked) - default data file paths for dbm and shmcb implementations of socache. The path can be configured when choosing the socache impl type in the config. - default path of the CGI socket. Can be configured with ScriptSock - data file for shm in slotmem_shm. Until now if a user gave a relative path, the file was put underneath the server root using the relative path. So if the path would have been a plain file name, the file would have been created directly in the server root. Now after Jim's change a relative path will be resolved relative to DEFAULT_REL_RUNTIMEDIR which is usually meant to be writable. The path itself is confgurable. So to sum up: all uses of DEFAULT_REL_RUNTIMEDIR I can see at the moment are overwritable by configuration. A runtime configurable runtime directory would not be a critical feature but make it easy to move all these objects in a common directory not known at build time. With respect to your question about multi-instances I'd say that unfortunately the directive makes conflicts more likely. Without the directive users are forced to use different server roots for their instances, e.g. to keep log files separate. If they go into the business of configuring the paths of all objects written individually, they can do so for the above list as well. Now having the directive, it could be that they always try to use /var/run/apache or similar as the runtime directory for all instances which will immediately lead to conflict. Of course all is a matter of documentation first and then education (RTFM). After reading the code IMHO the docs for socache and slotmem could be a bit more explicit about the data files used. Since e.g. socache modules are only provider implementations, their docs pages only say that they don't have any configuration directives. Only in the uncommented example of how to activate socache you can see a path name that's not explained. Regards, Rainer
RE: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
The files that you see in strace are not mutex files. Hence the mutex directive cannot work here. The correct fix would be IMHO another directive (either for mod_proxy or better for mod_proxy_balancer) to allow defining a directory where these shared memory files should be created. Regards Rüdiger -Original Message- From: Zisis Lianas Sent: Montag, 5. März 2012 16:47 To: dev@httpd.apache.org Subject: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) 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
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
What system is this... I'm assuming that your shm impl does an actual file connection for the shm instance... On Mar 5, 2012, at 10:46 AM, Zisis Lianas wrote: 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
Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179)
I can reproduce this on SuSE Linux Enterprise 11sp1 (x86_64, 2.6.32.12-0.7-xen) and Ubuntu 11.04 (x86_64, 2.6.38.x). - Ursprüngliche Mail - Von: Jim Jagielski j...@apache.org An: dev@httpd.apache.org Gesendet: Montag, 5. März 2012 19:15:03 Betreff: Re: httpd 2.4.1 and mod_slotmem_shm / mod_proxy_balancer (AH01179) What system is this... I'm assuming that your shm impl does an actual file connection for the shm instance... On Mar 5, 2012, at 10:46 AM, Zisis Lianas wrote: 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