Re: [users@httpd] httpd object file

2017-03-29 Thread Hemant Chaudhary
Hi,

My ubantu is creating only .a and .la of apache modules. I am converting .a
of modules to .so , so that I can load modules. But while converting I am
getting unresolved reference to apache functions. This is the reason I need
libhttpd, so that I can link libhttpd while converting and solve the error.
Is there any way to solve unresolved error of ap* apache functions. Is it
possible to use .a for LoadModules or we need only .so


Thanks
Hemant

On Tue, Mar 28, 2017 at 10:55 PM, Eric Covener  wrote:

> On Tue, Mar 28, 2017 at 2:27 AM, Hemant Chaudhary
>  wrote:
> > I ported httpd-2.4.23 on ubantu. I want libhttpd.a or libhttpd.so. But I
> am
> > getting only executable httpd.
> > Can you please help me to locate libhttpd or how to create libhttpd.a or
> > libhttpd.so. Even I am not able to figure out httpd.o file.
>
> I didn't think the unix builds still know how to create a libhttpd.
> It's certainly not necessary anywhere.
>
> --
> Eric Covener
> cove...@gmail.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>


Re: [users@httpd] using tee to feed logs to executable

2017-03-29 Thread Milind Vaidya
it does not restart apache it just copytruncates erro_log file.

On Wed, Mar 29, 2017 at 6:19 PM, Eric Covener  wrote:

> On Wed, Mar 29, 2017 at 9:16 PM, Milind Vaidya  wrote:
> > But will it be same instance of the program or separate one ?
>
> A second process.
>
> >
> > I mean one consuming error_log and another consuming ssl_error_log ?
>
> One each
>
> >
> > also I am terminating the consumer once EOF is received. But it does not
> > look like it starts every hour when the logrotate rotates error_log
>
> What do you have logrotate doing? Does it restart Apache?  Y
>
> --
> Eric Covener
> cove...@gmail.com
>
> -
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>


Re: [users@httpd] using tee to feed logs to executable

2017-03-29 Thread Eric Covener
On Wed, Mar 29, 2017 at 9:16 PM, Milind Vaidya  wrote:
> But will it be same instance of the program or separate one ?

A second process.

>
> I mean one consuming error_log and another consuming ssl_error_log ?

One each

>
> also I am terminating the consumer once EOF is received. But it does not
> look like it starts every hour when the logrotate rotates error_log

What do you have logrotate doing? Does it restart Apache?  Y

-- 
Eric Covener
cove...@gmail.com

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] using tee to feed logs to executable

2017-03-29 Thread Milind Vaidya
Thanks. Let me try it.

But will it be same instance of the program or separate one ?

I mean one consuming error_log and another consuming ssl_error_log ?

also I am terminating the consumer once EOF is received. But it does not
look like it starts every hour when the logrotate rotates error_log. I am
wondering if it fails to generate EOF or program is not able to understand
EOF. But is it not creating new program every hour keeping old one hanging
around as it used to do without handling of EOF. But again it is not
restarting it either every hour as was observed initially.




On Wed, Mar 29, 2017 at 6:06 PM, Eric Covener  wrote:

> On Wed, Mar 29, 2017 at 8:46 PM, Milind Vaidya  wrote:
> > I also want the same program to consume  ssl_error_log. Is it possible
> to do
> > that using similar syntax ?
>
> Of course.
>
> -
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>


Re: [users@httpd] using tee to feed logs to executable

2017-03-29 Thread Eric Covener
On Wed, Mar 29, 2017 at 8:46 PM, Milind Vaidya  wrote:
> I also want the same program to consume  ssl_error_log. Is it possible to do
> that using similar syntax ?

Of course.

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] What is preferred PHP interface?

2017-03-29 Thread John Iliffe
Thank you for that very fast response Yehuda.

Surprised that the PHP docs don't seem to have anything equivalent to that 
Wiki.

Regards,

John
=
On Wednesday 29 March 2017 20:47:22 Yehuda Katz wrote:
> The Apache wiki has a rundown of options:
> https://wiki.apache.org/httpd/php Plenty of people still use mod_php
> and it has been updated to work with HTTPD 2.4 and PHP 7.
> 
> - Y
> 
> On Wed, Mar 29, 2017 at 8:49 PM, John Iliffe  wrote:
> > Reading several sources there is conflicting information as to what is
> > the preferred way to implement PHP scripts.  It appears that mod_php
> > (how we do things now) is deprecated so I would like to take
> > advantage of a server change to do things "right".
> > 
> > The documentation on mod_fcgid seems to stop in 2013 with the release
> > of version 2.3.9, so I assume that this is no longer considered to be
> > a good approach.
> > 
> > The link to mod_fastcgi on the Apache documentation page leads to a
> > static billboard page for Chelsea Networks with no links and a last
> > maintained date in 2002, so it doesn't seem to be current either. 
> > This page says to use Netscape to view it (?)
> > 
> > mod_proxy_fcgi seems to be in current use, but right up front is the
> > caveat that there is no starter for the script.  My guess would be
> > that some sort of a wrapper is required to insert the path to the
> > executable, but no documentation has appeared so far.
> > 
> > Using mod_proxy_fcgi also raises the issue of what to proxy to.  The
> > PHP installation (version 7.1.3) includes a php-fpm module but the
> > documentation for it on the PHP web site is rather sparse - ie non-
> > existent.  A Google search comes up with a web site php-fpm.org, but
> > the last entry on the news page is 29 Nov, 2011.  Doesn't sound like
> > this is the preferred path!  The support link here says "Wiki is now
> > offline, sorry.
> > Use PHP 5.3.3+ now, and use php.net!".  This is a very back level of
> > PHP!
> > 
> > So, how is the best way to proceed?
> > 
> > As always, thanks to those who will respond.
> > 
> > Regards,
> > 
> > John
> > 
> > 
> > 
> > 
> > -
> > To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> > For additional commands, e-mail: users-h...@httpd.apache.org

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] What is preferred PHP interface?

2017-03-29 Thread Yehuda Katz
The Apache wiki has a rundown of options: https://wiki.apache.org/httpd/php
Plenty of people still use mod_php and it has been updated to work with
HTTPD 2.4 and PHP 7.

- Y

On Wed, Mar 29, 2017 at 8:49 PM, John Iliffe  wrote:

> Reading several sources there is conflicting information as to what is the
> preferred way to implement PHP scripts.  It appears that mod_php (how we do
> things now) is deprecated so I would like to take advantage of a server
> change to do things "right".
>
> The documentation on mod_fcgid seems to stop in 2013 with the release of
> version 2.3.9, so I assume that this is no longer considered to be a good
> approach.
>
> The link to mod_fastcgi on the Apache documentation page leads to a static
> billboard page for Chelsea Networks with no links and a last maintained
> date in 2002, so it doesn't seem to be current either.  This page says to
> use Netscape to view it (?)
>
> mod_proxy_fcgi seems to be in current use, but right up front is the caveat
> that there is no starter for the script.  My guess would be that some sort
> of a wrapper is required to insert the path to the executable, but no
> documentation has appeared so far.
>
> Using mod_proxy_fcgi also raises the issue of what to proxy to.  The PHP
> installation (version 7.1.3) includes a php-fpm module but the
> documentation for it on the PHP web site is rather sparse - ie non-
> existent.  A Google search comes up with a web site php-fpm.org, but the
> last entry on the news page is 29 Nov, 2011.  Doesn't sound like this is
> the preferred path!  The support link here says "Wiki is now offline,
> sorry.
> Use PHP 5.3.3+ now, and use php.net!".  This is a very back level of PHP!
>
> So, how is the best way to proceed?
>
> As always, thanks to those who will respond.
>
> Regards,
>
> John
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>


[users@httpd] using tee to feed logs to executable

2017-03-29 Thread Milind Vaidya
Hi

I am using

*ErrorLog* *"| /usr/bin/tee -a /var/log/httpd/error_log |  java
logconsumer"*


I also want the same program to consume  ssl_error_log. Is it possible to
do that using similar syntax ?


[users@httpd] What is preferred PHP interface?

2017-03-29 Thread John Iliffe
Reading several sources there is conflicting information as to what is the 
preferred way to implement PHP scripts.  It appears that mod_php (how we do 
things now) is deprecated so I would like to take advantage of a server 
change to do things "right".

The documentation on mod_fcgid seems to stop in 2013 with the release of 
version 2.3.9, so I assume that this is no longer considered to be a good 
approach.

The link to mod_fastcgi on the Apache documentation page leads to a static 
billboard page for Chelsea Networks with no links and a last maintained 
date in 2002, so it doesn't seem to be current either.  This page says to 
use Netscape to view it (?)

mod_proxy_fcgi seems to be in current use, but right up front is the caveat 
that there is no starter for the script.  My guess would be that some sort 
of a wrapper is required to insert the path to the executable, but no 
documentation has appeared so far.

Using mod_proxy_fcgi also raises the issue of what to proxy to.  The PHP 
installation (version 7.1.3) includes a php-fpm module but the 
documentation for it on the PHP web site is rather sparse - ie non-
existent.  A Google search comes up with a web site php-fpm.org, but the 
last entry on the news page is 29 Nov, 2011.  Doesn't sound like this is 
the preferred path!  The support link here says "Wiki is now offline, sorry. 
Use PHP 5.3.3+ now, and use php.net!".  This is a very back level of PHP!

So, how is the best way to proceed?  

As always, thanks to those who will respond.

Regards,

John


 

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] Problem when using nested if statements in apache 2.4

2017-03-29 Thread Luca Toscano
2017-03-28 17:28 GMT+02:00 Luca Toscano :

>
>
> 2017-02-21 18:45 GMT+01:00 Luca Toscano :
>
>> Hi Mike,
>>
>> 2017-02-20 18:17 GMT+01:00 Mike Schlottman :
>>
>>> I’m trying to configure apache 2.4 to show nice error pages to external
>>> users of our web site, while allowing staff to see the real error.   The
>>> idea is to prevent exposing privileged information to the general public
>>> while allowing our staff to more easily debug issues on our production web
>>> site.   To accomplish this I am using a combination of ErrorDocument within
>>> an If statement that evaluates the header X-Real-IP which is the IP address
>>> of the client on my server.
>>>
>>>
>>>
>>> This seems to work, until I nest the If statements to catch all the IP
>>> ranges that I am interested in.
>>>
>>>
>>>
>>> For example…
>>>
>>> 
>>>
>>>   ErrorDocument 404 /errors/404
>>>
>>> 
>>>
>>> will correctly show the nice 404 page for a user coming from 172.28.1.84.
>>>
>>>
>>>
>>> Using this, the same user coming from 172.28.1.84 sees the nice error
>>> page.
>>>
>>> 
>>>
>>>   ErrorDocument 404 /errors/404
>>>
>>> 
>>>
>>>
>>>
>>> Simmilarly the same user gets the nice error page when this code is used.
>>>
>>> 
>>>
>>>   ErrorDocument 404 /errors/404
>>>
>>> 
>>>
>>>
>>>
>>> The problem comes when I combine these 2 so that all users except those
>>> coming from 127.*.*.* or 192.168.*.* see the nice error page.
>>>
>>> 
>>>
>>>   
>>>
>>> ErrorDocument 404 /errors/404
>>>
>>>   
>>>
>>> 
>>>
>>> The user from 172.28.1.84 does not get the nice 404 page, but the
>>> default 404 page.   The IP does not match either of the ranges as observed
>>> when using the ranges individually, but when combined in this way it does
>>> not work as expected.
>>>
>>>
>>>
>>> Any ideas why this is?
>>>
>>>
>>>
>>
>> I reproduced your use case and from the error_log (trace8) I can see that
>> with nested s the second one seems not evaluated (or more precisely,
>> its expression is not). In the beginning I thought it was a peculiarity of
>> how the ErrorDocument core directive settings are merged between sections,
>> but it seems not the case.
>>
>> From my point of view, a container like  should be used like other
>> similar directives like  and , where this use case
>> would look a bit weird. The  naming brings up conventions that we use
>> in traditional programming languages, so this might be the source of the
>> confusion.
>>
>> For your specific use case, I'd have done something like the following:
>>
>> > %{HTTP:X-Real-IP}  -ipmatch '192.168.0.0/16' ">
>> ErrorDocument 404 "My awesome error"
>> 
>>
>> or maybe using /.
>>
>> http://httpd.apache.org/docs/current/sections.html shows a little
>> paragraph about "Nesting of sections", but I don't see any reference of
>> your use case. I'll dig a bit more during the next days to find a better
>> explanation if nobody will come up with a better solution :)
>>
>>
>
> It took me a while (and I forgot to update the list) but I double checked
> and currently httpd does not allow nested  sections. I updated the
> following doc pages to warn users:
>
> http://httpd.apache.org/docs/current/sections.html
> https://httpd.apache.org/docs/2.4/mod/core.html#if ("Not a scripting
> language")
>
> I am currently investigating if http://home.apache.org/~
> elukey/httpd-trunk-core-nested_if_blocks.patch solves the problem; if
> anybody wants to help testing please let me know :) (you can apply the
> patch to the latest 2.4.x branch cleanly and recompile).
>

Too soon, I found some corner cases that require more work to get fixed.
Will update the list once done for anybody interested :)

Luca


Re: [users@httpd] Run Control for Apache in Fedora 25

2017-03-29 Thread Mitchell Krog Photography
Brilliant, so glad you got it sorted :)

Cheers
Mitch



From: John Iliffe  
Reply: users@httpd.apache.org 

Date: 28 March 2017 at 6:08:33 PM
To: users@httpd.apache.org  
Subject:  Re: [users@httpd] Run Control for Apache in Fedora 25

First, my sincere thanks to all the folks who responded so fast to my
problem. I have it fixed, I think. Testing so far seems to work as
expected.

The problem is that when "systemctl enable" generates the new unit file
(httpd.service) it didn't get it quite right. For one thing, it dropped
apachectl from the start up and used httpd directly. For another, the pid
file was being written to a directory that was transient, as noted in the
post by Mikael. In this case I had the reason in my initial post but
didn't understand it.

So.

the solution is to generate a new unit file (read man page systemd.service)
and force the parameters you need. Delete the one generated by systemctl.
be sure that all of the related configuration files (httpd.service,
httpd.conf, init.d/httpd) match as far as where the files are going.

I used the sample in Stack Overflow suggested by Mitchell, modified a bit
to
match my installation. This works one for me.

---
[Unit]
Description=The Apache HTTP Server

[Service]
Type=forking
EnvironmentFile=/usr/apache-2.4.25/bin/envvars
PIDFile=/var/run/httpd.pid
ExecStart=/usr/apache-2.4.25/bin/apachectl -k start
ExecReload=/usr/apache-2.4.25/bin/apachectl -k graceful
ExecStop=/usr/apache-2.4.25/bin/apachectl -k stop
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target
-

Regards,

John

On Tuesday 28 March 2017 10:35:44 Kartik Vashishta wrote:
> Maybe this will help:
> http://stackoverflow.com/questions/32977557/how-do-i-compile-apache-http
> d-2-4-16-with-systemd-support
>
> On Tue, Mar 28, 2017 at 9:35 AM, John Iliffe 
wrote:
> > Thank you Mickey.
> >
> > That is exactly what the problem is; all /var/run subdirectories get
> > deleted on reboot.
> >
> > I tried to move the pid file to another location, for a start its
> > default location under the apache install directory, but even
> > directly on /var/run/, with the result that systemctl could not find
> > it. The pid file was written correctly, under the correct name, and
> > was readable by root, but was reported as missing by systemctl and as
> > a result the "systemctl stop httpd" command didn't work. It just
> > issued an error message and httpd kept right on running.
> >
> > One trhing that I have been careful to do is keep the start up script
> > at init.d/httpd pointed at the same location as httpd.conf.
> >
> > I'm not sure why but systemctl seems to insist that that the httpd pid
> > file be exactly /var/run/httpd/httpd.pid .
> >
> > I think there must be a configuration parameter somewhere for
> > systemctl but I have not been able to find it; can't believe it would
> > be hard coded in the
> > programme!
> >
> > That said, thank you for the reply. It does give me the idea that I
> > am on the right track.
> >
> > John
> > ===
> > ==snip

-
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org


Re: [users@httpd] mod_lua and subprocess_env

2017-03-29 Thread Andrei Ivanov
On Thu, Mar 23, 2017 at 3:52 PM, Andrei Ivanov 
wrote:

> On Wed, Mar 22, 2017 at 5:08 PM, Yann Ylavic  wrote:
>
>> On Wed, Mar 22, 2017 at 3:45 PM, Andrei Ivanov 
>> wrote:
>> > On Wed, Mar 22, 2017 at 3:53 PM, Andrei Ivanov > >
>> > wrote:
>> >
>> > Argh! You've sent more emails but Gmail received them out of order so I
>> > didn't see your initial email about the changed syntax.
>>
>> We seem to talk past each other :)
>> Anyway, maybe past failures make more sense now...
>>
>> >
>> > It works now! :-)
>> > Wooohooo!
>>
>> Cool.
>>
>> >
>> > Now... any chance of getting the patches included in the next release?
>> :-D
>>
>> Possibly, we'll propose and ask for feedbacks on the dev@ mailing list
>> first ;)
>>
>
> Any way I can help with this?
> I saw a discussion already started about 2.4.26...
>

Yann? :-D


>
> Btw, I also created a ticket for what I thought was the solution at that
> time: https://bz.apache.org/bugzilla/show_bug.cgi?id=60456
> I guess that would still make sense to have in the future...
>
>
>>
>> >
>> > Thank you very much, I owe you many beers! :-)
>>
>> I can drink that! let's see :)
>>
>