Re: [users@httpd] RE: Can you use variables inside a conf file?
Out of curiosity, is it possible to define the same environment variable, but with different values, in different VirtualHosts? I presume this can't be done, as all of the hosts would inherit the same environment, including the environment variables. For example, I have live and test versions of every server in our apache. The live server uses directory /cgi-bin/ and the test server uses /cgi-test/. This means that we have to define things like aliases in both live and test VirtualHosts. This means we can screw them up... I've always wanted to define some sort of local variable in each VirtualHost, containing the location of the cgi directory. Then we could INCLUDE the same set of aliases in both the live and test hosts, but they would pick up their respective paths. In fact, I've often wished that the Apache configuration would support its own internal variables, but so far nothing has happened. I must not be wishing hard enough. On 28 January 2012 14:53, Rainer Jung rainer.j...@kippdata.de wrote: On 25.01.2012 14:47, Desilets, Alain wrote: I use this syntax too, but I think it works for me only because of my loading of a NON-STANDARD module, mod_define. http://people.apache.org/~**rjung/mod_define/mod_define.* *html http://people.apache.org/~rjung/mod_define/mod_define.html It works for me and I don't have mod_define loaded. Using an environment variable with the ${MYVAR} syntax works without mod_define. If you want to define the value of the variable inside the httpd configuration files, you would need mod_define. Major difference: environment variables can't be changed with apachectl restart or apachectl graceful, because in both cases the httpd parent process keept running and all child processes are forked from it with an unchanged environment. If you define the variables inside the configuration and use the additional module, any changes to the definitions will become active by apachectl restart and apachectl graceful. Starting with the forthcoming Apache 2.4 defining variable inside the httpd configuration will become a core feature. Regards, Rainer --**--**- The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/**userslist.htmlhttp://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.orgusers-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscribe@**httpd.apache.orgusers-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org -- Steve Swift http://www.swiftys.org.uk
Re: [users@httpd] RE: Can you use variables inside a conf file?
On 29.01.2012 09:42, Steve Swift wrote: Out of curiosity, is it possible to define the same environment variable, but with different values, in different VirtualHosts? I presume this can't be done, as all of the hosts would inherit the same environment, including the environment variables. For example, I have live and test versions of every server in our apache. The live server uses directory /cgi-bin/ and the test server uses /cgi-test/. This means that we have to define things like aliases in both live and test VirtualHosts. This means we can screw them up... I've always wanted to define some sort of local variable in each VirtualHost, containing the location of the cgi directory. Then we could INCLUDE the same set of aliases in both the live and test hosts, but they would pick up their respective paths. In fact, I've often wished that the Apache configuration would support its own internal variables, but so far nothing has happened. I must not be wishing hard enough. Sorry, mod_define and the builtin variables for Apache 2.4 only support global variables. Maybe mod_macro could help you. It allows to specify recurring config snipets which you can instantiate using parameters. Regards, Rainer On 28 January 2012 14:53, Rainer Jung rainer.j...@kippdata.de mailto:rainer.j...@kippdata.de wrote: On 25.01.2012 14:47, Desilets, Alain wrote: I use this syntax too, but I think it works for me only because of my loading of a NON-STANDARD module, mod_define. http://people.apache.org/~__rjung/mod_define/mod_define.__html http://people.apache.org/~rjung/mod_define/mod_define.html It works for me and I don't have mod_define loaded. Using an environment variable with the ${MYVAR} syntax works without mod_define. If you want to define the value of the variable inside the httpd configuration files, you would need mod_define. Major difference: environment variables can't be changed with apachectl restart or apachectl graceful, because in both cases the httpd parent process keept running and all child processes are forked from it with an unchanged environment. If you define the variables inside the configuration and use the additional module, any changes to the definitions will become active by apachectl restart and apachectl graceful. Starting with the forthcoming Apache 2.4 defining variable inside the httpd configuration will become a core feature. Regards, Rainer - The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [users@httpd] Proces killed after http post without ConentType header
Tanx for reply! In run on CentOS 5.7 (Latest). CentOS' policy is to have most stable versions which is apache 2.2.3... And this is not stable behaviour. PHP Version = 5.3.9 mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1 Acording to this version info only my httpd is a out of date but should be stable. 2012/1/29 Yehuda Katz yeh...@ymkatz.net On Sat, Jan 28, 2012 at 7:16 AM, Bardo Bakker bardobak...@gmail.comwrote: Hi, I wrote some software which post a binary (image) to our server. After a reboot (due to resize HDD), the server has some post issues. It hangs at the end of a http post without the content type header set. I would like to know: is this a bug, configuration mistake, or miss interpertation of http post protocol... Tank you! Version apache: [root@www ~]# /usr/sbin/httpd -V Server version: Apache/2.2.3 This is a very old version with known security issues. You should upgrade. On kill/error/fault I found in error_log: Sat Jan 28 12:56:09 2012] [notice] child pid 17077 exit signal Segmentation fault (11), possible coredump in /tmp So made a coredump: gdb: bt all: Core was generated by `/usr/sbin/httpd -k start'. Program terminated with signal 11, Segmentation fault. #0 0x7fe25c5696c0 in zend_hash_num_elements () from /etc/httpd/modules/libphp5.so Pretty obvious that the problem is with PHP. My guess is that you updated some library on the system (maybe MySQL) and PHP is now first trying to use it. You did not include which PHP version you are using. I suggest you check your php configuration. As long as you are not using different configuration files for mod_php and php-cli, you should be able to run php -i to check that PHP is working properly. - Y
Re: [users@httpd] Proces killed after http post without ConentType header
On Sun, Jan 29, 2012 at 6:36 AM, Bardo Bakker bardobak...@gmail.com wrote: Tanx for reply! In run on CentOS 5.7 (Latest). CentOS' policy is to have most stable versions which is apache 2.2.3... And this is not stable behaviour. PHP Version = 5.3.9 mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1 Acording to this version info only my httpd is a out of date but should be stable. Were you able to run php -i ? That will usually tell you why PHP is crashing. - Y
Re: [users@httpd] Proces killed after http post without ConentType header
Runs perfect! Op 29 jan. 2012 om 15:46 heeft Yehuda Katz yeh...@ymkatz.net het volgende geschreven: On Sun, Jan 29, 2012 at 6:36 AM, Bardo Bakker bardobak...@gmail.com wrote: Tanx for reply! In run on CentOS 5.7 (Latest). CentOS' policy is to have most stable versions which is apache 2.2.3... And this is not stable behaviour. PHP Version = 5.3.9 mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1 Acording to this version info only my httpd is a out of date but should be stable. Were you able to run php -i ? That will usually tell you why PHP is crashing. - Y
Re: [users@httpd] Proces killed after http post without ConentType header
On Sun, Jan 29, 2012 at 9:46 AM, Yehuda Katz yeh...@ymkatz.net wrote: On Sun, Jan 29, 2012 at 6:36 AM, Bardo Bakker bardobak...@gmail.comwrote: Tanx for reply! In run on CentOS 5.7 (Latest). CentOS' policy is to have most stable versions which is apache 2.2.3... And this is not stable behaviour. PHP Version = 5.3.9 mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1 Acording to this version info only my httpd is a out of date but should be stable. Were you able to run php -i ? That will usually tell you why PHP is crashing. If php -i does not segfault, you should check that it is actually loading all of your extensions. Compare he output of php -i with the expected information from your php.ini . Sometimes the PHP CLI will not load MySQL and mod_php will, so you will miss the errors that are caused by that extension. It looks like you updated PHP and MySQL some time since January 10 (since that is when 5.3.9 and 5.5.20 where released). I would suggest that you downgrade to the previous versions (try the ones that ship with CentOS, since as you mentioned, they are supposed to be stable) and see if you still have the problem. Or, rebuild PHP, making sure that it is using the correct MySQL libraries. As I mentioned, the segfault is in mod_php, not in the Apache core. If you want you can send me (privately if you want) the PHP script you use and your php.ini (and any included ini files) and I can see if I can replicate the problem and file an official PHP bug if necessary. - Y
Re: [users@httpd] RE: Can you use variables inside a conf file?
I'll investigate mod_macro. Thank you. On 29 January 2012 11:01, Rainer Jung rainer.j...@kippdata.de wrote: On 29.01.2012 09:42, Steve Swift wrote: Out of curiosity, is it possible to define the same environment variable, but with different values, in different VirtualHosts? I presume this can't be done, as all of the hosts would inherit the same environment, including the environment variables. For example, I have live and test versions of every server in our apache. The live server uses directory /cgi-bin/ and the test server uses /cgi-test/. This means that we have to define things like aliases in both live and test VirtualHosts. This means we can screw them up... I've always wanted to define some sort of local variable in each VirtualHost, containing the location of the cgi directory. Then we could INCLUDE the same set of aliases in both the live and test hosts, but they would pick up their respective paths. In fact, I've often wished that the Apache configuration would support its own internal variables, but so far nothing has happened. I must not be wishing hard enough. Sorry, mod_define and the builtin variables for Apache 2.4 only support global variables. Maybe mod_macro could help you. It allows to specify recurring config snipets which you can instantiate using parameters. Regards, Rainer On 28 January 2012 14:53, Rainer Jung rainer.j...@kippdata.de mailto:rainer.jung@kippdata.**de rainer.j...@kippdata.de wrote: On 25.01.2012 14:47, Desilets, Alain wrote: I use this syntax too, but I think it works for me only because of my loading of a NON-STANDARD module, mod_define. http://people.apache.org/~__**rjung/mod_define/mod_define.__** html http://people.apache.org/~__rjung/mod_define/mod_define.__html http://people.apache.org/~**rjung/mod_define/mod_define.** html http://people.apache.org/~rjung/mod_define/mod_define.html It works for me and I don't have mod_define loaded. Using an environment variable with the ${MYVAR} syntax works without mod_define. If you want to define the value of the variable inside the httpd configuration files, you would need mod_define. Major difference: environment variables can't be changed with apachectl restart or apachectl graceful, because in both cases the httpd parent process keept running and all child processes are forked from it with an unchanged environment. If you define the variables inside the configuration and use the additional module, any changes to the definitions will become active by apachectl restart and apachectl graceful. Starting with the forthcoming Apache 2.4 defining variable inside the httpd configuration will become a core feature. Regards, Rainer --**--**- The official User-To-User support forum of the Apache HTTP Server Project. See URL:http://httpd.apache.org/**userslist.htmlhttp://httpd.apache.org/userslist.html for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.**apache.orgusers-unsubscr...@httpd.apache.org from the digest: users-digest-unsubscribe@**httpd.apache.orgusers-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org -- Steve Swift http://www.swiftys.org.uk
Re: [users@httpd] Proces killed after http post without ConentType header
The server is currently in commercial use. I can't afford downgrading php. If I want to do it with yum I need to remove php first (also with downgrade) and plesk gets removed as well... So, how would you replicate the problem? How would you do a binary post to a server without setting the content type header? If there is a bug in php 5.3.9 how could we test this? There are some somewhat similar bugs in php. I think we can indeed conclude it is a php thing. So lets remove the discussion from this mailing list. I'll post my findings on php mailing list. tanx! 2012/1/29 Yehuda Katz yeh...@ymkatz.net On Sun, Jan 29, 2012 at 9:46 AM, Yehuda Katz yeh...@ymkatz.net wrote: On Sun, Jan 29, 2012 at 6:36 AM, Bardo Bakker bardobak...@gmail.comwrote: Tanx for reply! In run on CentOS 5.7 (Latest). CentOS' policy is to have most stable versions which is apache 2.2.3... And this is not stable behaviour. PHP Version = 5.3.9 mysql Ver 14.14 Distrib 5.5.20, for Linux (x86_64) using readline 5.1 Acording to this version info only my httpd is a out of date but should be stable. Were you able to run php -i ? That will usually tell you why PHP is crashing. If php -i does not segfault, you should check that it is actually loading all of your extensions. Compare he output of php -i with the expected information from your php.ini . Sometimes the PHP CLI will not load MySQL and mod_php will, so you will miss the errors that are caused by that extension. It looks like you updated PHP and MySQL some time since January 10 (since that is when 5.3.9 and 5.5.20 where released). I would suggest that you downgrade to the previous versions (try the ones that ship with CentOS, since as you mentioned, they are supposed to be stable) and see if you still have the problem. Or, rebuild PHP, making sure that it is using the correct MySQL libraries. As I mentioned, the segfault is in mod_php, not in the Apache core. If you want you can send me (privately if you want) the PHP script you use and your php.ini (and any included ini files) and I can see if I can replicate the problem and file an official PHP bug if necessary. - Y