Re: Livecode server configuration: tracking down and Apache redirect

2020-12-20 Thread Richard Gaskin via use-livecode

David Bovill wrote:

> The server return 400 Not Found when routing for a *.json file, while
> 200 OK when routing for a *.txt file - all other conditions seem the
> same.
...
> The .htaccess in the $DOCUMENT_ROOT folder does not mention json file
> endings.

Ah, we may have been looking at this backwards.

Rather than ask why Apache ISN'T serving JSON, we might ask why it SHOULD.

IIRC, following the general principle of least access Apache's defaults 
serve only a small number of types, and additional types must be added 
explicitly.


Just as we use directives to tell Apache to recognize the file type 
".lc", you should be able to tell it to recognize .json by adding this 
to Apache's config:


AddType application/json .json


Details here also show how to force UTF-8 for json, along with other tips:

https://htaccessbook.com/useful-htaccess-rules/


--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Livecode server configuration: tracking down and Apache redirect

2020-12-20 Thread David Bovill via use-livecode
Thanks for the tips Richard:
On 18 Dec 2020, 21:05 +, Richard Gaskin via use-livecode 
, wrote:
> David Bovill wrote:
>
> > I have a Livecode server running Revigniter under Apache on Ubuntu. I
> > installed it 8 years ago or so, and it is causing redirect problems
> > with files ending in .json. I am assuming that a long time ago a set
> > the configuration somewhere to handle .json files in a particular way,
> > but I can’t track this down. Any thoughts where to look?
>
> Is the redirect a 301, 302, or something else?

The server return 400 Not Found when routing for a *.json file, while 200 OK 
when routing for a *.txt file - all other conditions seem the same.

If I replace “json” with “json” or “xyz” or any arbitrary txt in the 
(Revigniter) routing everything works as expected. The .htaccess in the 
$DOCUMENT_ROOT folder does not mention json file endings.

I suspect there is another file somewhere doing the Apache based redirect?
> Is the returntype appropriate for JSON?

Yes
> Do you see the problem when access from an LC client, a browser, or both?

Both
> > I’m wondering if there is some sort of log that would allow me to know
> > how Apache is handling a faulty redirect? I’m a bit stuck tracking it
> > down.
>
> The Apache logs are at:
> /var/log/apache2/access.log
> /var/log/apache2/error.log

I can’t see information there that will help debug.
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Livecode server configuration: tracking down and Apache redirect

2020-12-18 Thread Richard Gaskin via use-livecode

David Bovill wrote:

> I have a Livecode server running Revigniter under Apache on Ubuntu. I
> installed it 8 years ago or so, and it is causing redirect problems
> with files ending in .json. I am assuming that a long time ago a set
> the configuration somewhere to handle .json files in a particular way,
> but I can’t track this down. Any thoughts where to look?

Is the redirect a 301, 302, or something else?

Is the returntype appropriate for JSON?

Do you see the problem when access from an LC client, a browser, or both?


> I’m wondering if there is some sort of log that would allow me to know
> how Apache is handling a faulty redirect? I’m a bit stuck tracking it
> down.

The Apache logs are at:
/var/log/apache2/access.log
/var/log/apache2/error.log

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 
 ambassa...@fourthworld.comhttp://www.FourthWorld.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Livecode server configuration: tracking down and Apache redirect

2020-12-18 Thread David Bovill via use-livecode
I have a Livecode server running Revigniter under Apache on Ubuntu. I installed 
it 8 years ago or so, and it is causing redirect problems with files ending in 
.json. I am assuming that a long time ago a set the configuration somewhere to 
handle .json files in a particular way, but I can’t track this down. Any 
thoughts where to look?

I’ve tried the following places so far: .htaccess and 
/etc/apache2/sites-enabled/000-default.conf  which do their job - but no 
mention of .json files.

I’m wondering if there is some sort of log that would allow me to know how 
Apache is handling a faulty redirect? I’m a bit stuck tracking it down.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode