Hi Booth,
Below are your questions with my thoughts:
Can I put the web page on the same server as provides the web
services? I have no idea, i don't even want to
know.
Err, you asked the question, but you don't want to know? I assume you
do want to know.
First of all, the answer is yes.
First option: When you create a server with IWS, it generates an Apache
server that acts as a front-end for the application server. For
example, if you told IWS to generate a server named 'BOOTHIWS', you
should have an IFS directory /www/BOOTHIWS/htdocs and inside that you
can put html, javascript,. css,. images, etc. etc. The only caveat is
that IWS expects any URL whose path begins with /web/ to point to the
integrated application server.
http://yourserver:xxx/my.html will work
fine but you can't use
http://yourserver:xxx/web/my.html because the IWS
tooling expects to handle anything beneath /web/. Also, there's a
normal Apache instance there, you can go into it and add any other
aliases, scriptaliases, etc that you want. If you do want to bypass
CORS using the ACOA header you can add it into this Apache config, using
Nadir's example as a template.
The 2nd alternative (which you won't like, so why I am saying it?!) is
that you could use Apache for your web services instead of IWS. Since
IWS isn't there to handle the JSON code, you use something like YAJL or
SQL instead. This way, there is only one server. This is how I do it.
The 3rd alternative is to use this method of setting up Apache and using
it's reverse proxy feature. This is the most complicated and requires
the most system resources of the possible options, but seems to be the
road you were heading down. I don't think I'd go that way, myself.
I can consume that data off my PC's browser with no problem but from a
server at the same root url? Things go all wobbly, which
I suspect is a reflection upon my ignorance of the processes involved.
Yes, if you're using a server with the same root, there's no CORS
issue. (That's what you're asking, right?)
As an Amazon Associate we earn from qualifying purchases.