Mailing List Archive

Modperl as backend for mobile apps
Goodmorning,

We are using Apache2-ModPerl for the backend of a mobile app and would
like to switch off the standard ErrorDocuments in Apache2. Is this
possible?

Thanks in advance,

Michel
Re: Modperl as backend for mobile apps [ In reply to ]
On 31.10.2016 10:26, Michel Jansen wrote:
> Goodmorning,
>
> We are using Apache2-ModPerl for the backend of a mobile app and would like to switch off
> the standard ErrorDocuments in Apache2. Is this possible?
>

Have a look here :
http://httpd.apache.org/docs/2.4/mod/core.html#errordocument

I believe it is otherwise possible to do this dynamically with mod_perl, but the above is
the simplest and most direct method.

Note : if you want more precise information, then also supply your version of Apache and
mod_perl.
Re: Modperl as backend for mobile apps [ In reply to ]
We do this by processing all requests in an eval block and putting Apache
into assbackwards mode so that we can send a 500 response with a JSON
response body

On Mon, Oct 31, 2016 at 5:44 AM, A. Warnier <aw@ice-sa.com> wrote:

> On 31.10.2016 10:26, Michel Jansen wrote:
>
>> Goodmorning,
>>
>> We are using Apache2-ModPerl for the backend of a mobile app and would
>> like to switch off
>> the standard ErrorDocuments in Apache2. Is this possible?
>>
>>
> Have a look here :
> http://httpd.apache.org/docs/2.4/mod/core.html#errordocument
>
> I believe it is otherwise possible to do this dynamically with mod_perl,
> but the above is the simplest and most direct method.
>
> Note : if you want more precise information, then also supply your version
> of Apache and mod_perl.
>
>
>


--
John Dunlap
*CTO | Lariat *

*Direct:*
*john@lariat.co <john@lariat.co>*

*Customer Service:*
877.268.6667
support@lariat.co
Re: Modperl as backend for mobile apps [ In reply to ]
On 16-10-31 10:34 AM, John Dunlap wrote:
> We do this by processing all requests in an eval block and putting
> Apache into assbackwards mode so that we can send a 500 response with a
> JSON response body

You can also do it with $r->custom_response[1] from within your mod_perl
code itself.

https://perl.apache.org/docs/2.0/api/Apache2/Response.html#C_custom_response_

Adam
Re: Modperl as backend for mobile apps [ In reply to ]
We're doing that but, for whatever reason, the only way we were able to get
apache to return JSON instead of HTML was in assbackwards mode

On Mon, Oct 31, 2016 at 10:46 AM, Adam Prime <adam.prime@utoronto.ca> wrote:

> On 16-10-31 10:34 AM, John Dunlap wrote:
>
>> We do this by processing all requests in an eval block and putting
>> Apache into assbackwards mode so that we can send a 500 response with a
>> JSON response body
>>
>
> You can also do it with $r->custom_response[1] from within your mod_perl
> code itself.
>
> https://perl.apache.org/docs/2.0/api/Apache2/Response.html#C
> _custom_response_
>
> Adam
>



--
John Dunlap
*CTO | Lariat *

*Direct:*
*john@lariat.co <john@lariat.co>*

*Customer Service:*
877.268.6667
support@lariat.co