Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread Nick Kew

> On 17 May 2018, at 18:44, John Bazik  wrote:
> 
> 
>> Would you be able to share the nginx config to achieve what you're
>> looking for, as a reference point?
> 
> Sure.  Condensing it, the basic idea is this;
> 
>location / {
>uwsgi_pass cms;
>include uwsgi_params;
>uwsgi_intercept_errors on;
>error_page 404 = @fallback;
>}
>location @fallback {
>try_files $uri @static;
>}
>location @static {
>proxy_pass  http://static/$request_uri;
>}

Gotcha.  Interesting that that works: it kind-of implies the possibility
of recursive error documents.

I wonder if, as a workaround, you might use an errordocument that
converts 404 to 301 or 302, and redirects to $static/$request_uri?

(apologies if this is the beer speaking: just back from an evening out).

-- 
Nick Kew

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



[users@httpd] (rewritten) In directory pages, how to show file dates in a specific timezone?

2018-05-17 Thread Dedeco Balaco

Hello,

I could not find a way to show file listing pages (generated by Apache) 
with times in the correct timezone. The timezone is defined in the 
environment, but Apache refuses to take it into account (assuming that 
what I set it what should be set).


To detail the situation a bit more: a Debian 9 server with Apache 2.4; a 
normal user account; a working ~/public_html folder for public web content.


Dates and times are correctly shown in SSH accesses to the server, made 
by me. Although the server is in a different timezone, the command ls 
(and others) use the TZ variable where timezone is needed, showing times 
as if here. This is not related to Apache, but seem important (to 
compare). If the server uses Bios times or anything, it does not matter 
(my guess), since we can choose our timezone as needed, with the TZ 
environment variable.


For the system I shortly defined, imagine these steps:

1. Access the server with SSH

2. Create a new folder in ~/public_html with the command:

mkdir ~/public_html/nf

3. Create one file in that folder with the command

echo "arquivo" > ~/public_html/nf/arquivo.txt

4. Show that folder content (one file) to someone, with the public URL:

http://user.server.fi/nf

This page will be created by Apache 2.4. But it shows time in 
server's clock (or timezone, I am not sure, and it should not matter, I 
think, as long as it consider the timezone I want, somehow).


My user environment has the variable TZ set to my timezone, as said. We 
can confirm that exists in the web environment for each user, using 
phpinfo() function in any served PHP script.


Since Apache does not seem to consider the TZ variable to choose the 
timezone to show file metadata, how should I do it?



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



Re: [users@httpd] In directory pages, how to show file dates in a specific timezone?

2018-05-17 Thread Dedeco Balaco



Em 17-05-2018 15:55, Stormy escreveu:

On 2018-05-17 12:30 PM, Dedeco Balaco wrote:
[snip]

How to make Apache file listing pages be shown in the correct timezone,
or a specific one (possibly using a "SetEnv TZ" line in .htaccess ?
p.s.:
There is a small error in the users list page (
https://httpd.apache.org/userslist.html ). The verb in the note
sentence is wrong.


s/ send|sent ??? I've just looked at your reference, the page is
perfect. I might suggest that if you want help, don't insult the
volunteers who *can* help.


It should be send, and sent was written there - or I would have no 
reason to point it.


With *everything* I have said, I did not mean to insult anyone! If you 
thought that, I might have chosen the wrong words. We should interpret 
my words with good and calm tones, and always having constructive things.




As to your question, "timezones" is rather vague. Depending upon your
hardware and your o/s, you may have BIOS time, o/s time and various
pieces of coding that consciously (or not) use one, the other or a
possibly incorrect interpretation of either one.



I chose to write it short, since I pointed to a discussion about the 
same problem, where more details are shown - although I imagined they 
should not be needed. I will rewrite my first message now.


Thank you for your reply

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



Re: [users@httpd] In directory pages, how to show file dates in a specific timezone?

2018-05-17 Thread Stormy

On 2018-05-17 12:30 PM, Dedeco Balaco wrote:
[snip]

How to make Apache file listing pages be shown in the correct timezone,
or a specific one (possibly using a "SetEnv TZ" line in .htaccess ?
p.s.:
There is a small error in the users list page (
https://httpd.apache.org/userslist.html ). 
The verb in the note sentence is wrong.


s/ send|sent ??? I've just looked at your reference, the page is 
perfect. I might suggest that if you want help, don't insult the 
volunteers who *can* help.


As to your question, "timezones" is rather vague. Depending upon your 
hardware and your o/s, you may have BIOS time, o/s time and various 
pieces of coding that consciously (or not) use one, the other or a 
possibly incorrect interpretation of either one.


Paul

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



[users@httpd] [Appeal] zh Reviewers wanted (was: Attempting translating Chinese documentation)

2018-05-17 Thread William A Rowe Jr
On Sun, May 13, 2018 at 8:24 AM, CodeingBoy  wrote:

> Hello William, thanks for your information. I have completed the
> translation progress of error messages.
> I have translated these message to both Simplified Chinese(zh-cn) and
> Traditional Chinese(zh-tw). One thing should be noticed is that I'm not a
> native speaker of Traditional Chinese, for Taiwan people they might feel a
> little weird(though they can understand it).
> On the other hand, I did a lot checking to make sure translations contains
> little mistakes(if any). A reviewer would be helpful, but I didn't find
> one. :(
>

Thank you for your contribution and attention to detail! Committed to httpd
trunk in
http://svn.apache.org/viewvc?view=revision=1831800

If any conversant/native reader would kindly review either (or both) the
draft zh-cn and/or zh-tw error text, we can move on to backporting this
commit to 2.4.x for the next release. For the entire draft error page doc
set, please checkout;
http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/error/

Sharing with users@ to hopefully find a willing reviewer.

Again, thank you much!

Cheers,

Bill

ps: to any of you on users@ who might be interested, if you are willing to
review docs submissions in your native/fluent languages, please consider
subscribing to d...@httpd.apache.org to lend your aid. TIA!


Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
> A bit of an ugly hack (and probably not useful), but what about an
> errordocument that uses SSI to include your contents?

Mmm.  I don't want to go there.

> Would you be able to share the nginx config to achieve what you're
> looking for, as a reference point?

Sure.  Condensing it, the basic idea is this;

location / {
uwsgi_pass cms;
include uwsgi_params;
uwsgi_intercept_errors on;
error_page 404 = @fallback;
}
location @fallback {
try_files $uri @static;
}
location @static {
proxy_pass  http://static/$request_uri;
}

John

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



Re: [users@httpd] In directory pages, how to show file dates in a specific timezone?

2018-05-17 Thread Dedeco Balaco


Em 16-05-2018 11:57, Dedeco Balaco escreveu:

Hello,

I could not find a way to show file listing pages (of Apache) with times
in correct the timezone. The timezone is defined in the enrironment, but
Apache refuses to take it into account.

The discussion made in
https://www.linuxquestions.org/questions/showthread.php?p=5855435 shows
that situation clearly. The main point is that:

- dates and times are correctly shown in SSH accesses, they take the TZ
(for timezone) variable value

- PHP also takes that variable into account, something that is even
shown by phpinfo PHP function


How to make Apache file listing pages be shown in the correct timezone,
or a specific one (possibly using a "SetEnv TZ" line in .htaccess ?


p.s.:

There is a small error in the users list page (
https://httpd.apache.org/userslist.html ). There is written


Before you go further, please read Eric S. Raymond and Rick Moen's
explanation of "How To Ask Questions The Smart Way". If you follow
their advice, you will discover that these forums have dozens of
helpers ready to provide you with guidance on using the Apache HTTP
Server! Note: Do not SENT your Apache questions to Eric or Rick!


where should be


Before you go further, please read Eric S. Raymond and Rick Moen's
explanation of "How To Ask Questions The Smart Way". If you follow
their advice, you will discover that these forums have dozens of
helpers ready to provide you with guidance on using the Apache HTTP
Server! Note: Do not SEND your Apache questions to Eric or Rick!


The verb in the note sentence is wrong.




In the last few days, I have seen several answers, discussions, but to 
other questions. They are aparently more complicated than my problem. If 
this is this a wrong list to choose for my problem, please say that to me.


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



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread Nick Kew

> On 17 May 2018, at 16:07, John Bazik  wrote:
> 
>> Oh I see, I didn't realize legacy was also proxied.  Maybe
>> ProxyErrorOverride helps with one of the options?
> 
> That lets me use ErrorDocument on the proxy, but it doesn't
> let me redirect the original request to the legacy site.

A bit of an ugly hack (and probably not useful), but what about an
errordocument that uses SSI to include your contents?

Would you be able to share the nginx config to achieve what you're
looking for, as a reference point?

-- 
Nick Kew

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



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
> Oh I see, I didn't realize legacy was also proxied.  Maybe
> ProxyErrorOverride helps with one of the options?

That lets me use ErrorDocument on the proxy, but it doesn't
let me redirect the original request to the legacy site.

John

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



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread Eric Covener
On Thu, May 17, 2018 at 10:51 AM, John Bazik  wrote:
>> FallBackResource may be one option. Another might be the "lookahead"
>> feature in mod_rewrite. Another is to poke and prod with -d/-f tests
>> in mod_rewrite if you can determine that way.
>
> All of those respond to a missing file, not a 404 returned from a
> proxied request.  That's where I keep hitting a wall.
>
Oh I see, I didn't realize legacy was also proxied.  Maybe
ProxyErrorOverride helps with one of the options?

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



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
> FallBackResource may be one option. Another might be the "lookahead"
> feature in mod_rewrite. Another is to poke and prod with -d/-f tests
> in mod_rewrite if you can determine that way.

All of those respond to a missing file, not a 404 returned from a
proxied request.  That's where I keep hitting a wall.

John

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



Re: [users@httpd] configuring a proxy fallback

2018-05-17 Thread Eric Covener
On Thu, May 17, 2018 at 10:42 AM, John Bazik  wrote:
> Here's something I think I can't do with apache.
>
> I have a uwsgi backend server and a legacy http server.  I would like a
> reverse proxy that puts the dynamic site "in front of" the legacy site,
> such that 404s from the former are internally redirected to the latter.
>
> We have this implemented in nginx, but I recently needed to switch the
> proxy to apache.  ErrorDocument is the obvious hook, but it has to be
> a local url.  I've looked at the rewrite engine and balancer groups,
> and I haven't found any way to do this.  I was about ready to give up
> and thought I'd see if smarter people than me have an answer.
>

FallBackResource may be one option. Another might be the "lookahead"
feature in mod_rewrite. Another is to poke and prod with -d/-f tests
in mod_rewrite if you can determine that way.

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



[users@httpd] configuring a proxy fallback

2018-05-17 Thread John Bazik
Here's something I think I can't do with apache.

I have a uwsgi backend server and a legacy http server.  I would like a
reverse proxy that puts the dynamic site "in front of" the legacy site,
such that 404s from the former are internally redirected to the latter.

We have this implemented in nginx, but I recently needed to switch the
proxy to apache.  ErrorDocument is the obvious hook, but it has to be
a local url.  I've looked at the rewrite engine and balancer groups,
and I haven't found any way to do this.  I was about ready to give up
and thought I'd see if smarter people than me have an answer.

John

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



Re: [users@httpd] Running Lua Script using mod_lua

2018-05-17 Thread Daniel Gruno

On 05/17/2018 08:21 AM, Luca Toscano wrote:

Hi,

2018-05-16 12:22 GMT+02:00 Hemant Chaudhary 
>:


Hi,

While running lua_script using mod_lua, I am getting this error in
error_log. What does it mean
"PANIC: unprotected error in call to Lua API (core and library have
incompatible numeric types)"


What version of Lua are you using? You can quickly check with something 
like ldd /usr/local/apache2/modules/mod_lua.so. It might be a mismatch 
between what you are trying to execute (the script) and what you are 
using as interpreter (mod_lua), but I haven't investigated it very well 
so I might be wrong :)


Almost! :)
It's an incompatibility between mod_lua's lua lib (typically 5.1 or 5.2) 
and a library that is being used (likely made for 5.3?). There were 
fundamental changes to how numbers work in 5.3, if I remember correctly, 
so you would either have to use a library that works with 5.1/5.2, OR 
recompile mod_lua with the 5.3 library and headers.




Hope that helps,

Luca



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



Re: [users@httpd] Running Lua Script using mod_lua

2018-05-17 Thread Luca Toscano
Hi,

2018-05-16 12:22 GMT+02:00 Hemant Chaudhary 
:

> Hi,
>
> While running lua_script using mod_lua, I am getting this error in
> error_log. What does it mean
> "PANIC: unprotected error in call to Lua API (core and library have
> incompatible numeric types)"
>
>
What version of Lua are you using? You can quickly check with something
like ldd /usr/local/apache2/modules/mod_lua.so. It might be a mismatch
between what you are trying to execute (the script) and what you are using
as interpreter (mod_lua), but I haven't investigated it very well so I
might be wrong :)

Hope that helps,

Luca