Question about Iliad access urls/adresses

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Question about Iliad access urls/adresses

Steven Costiou
Hi,
I have a small question.

I'm looking for a way to redirect a specific domain name, like "www.mydomain.com" to an Iliad application adress, like "http://myServerIp:myPort/myApp/myController/whatever".

How can i do that ? Is that even easily possible ?

By the way, it may not be the best place to ask, but i'm using an apache server to host my Iliad applications data, and i've not been able yet to authorize access from the outside (Fedora 13 64bits). Anyone knows how to do that ? To be more specific, local access works, but the server is not reachable from an external client (i guess its a question of firewalls and/or port configurations but i know nothing about that stuff).

-Steven Costiou-

Reply | Threaded
Open this post in threaded view
|

Re: Question about Iliad access urls/adresses

Stefan Schmiedl
Am 31.10.2010 18:48, schrieb Steven Costiou:
Hi,
I have a small question.

I'm looking for a way to redirect a specific domain name, like "www.mydomain.com" to an Iliad application adress, like "http://myServerIp:myPort/myApp/myController/whatever".

If you want to redirect to a complete URL instead of "just" a virtual host, you'll probably
need to do some rewriting in the webserver handling www.mydomain.com. Search for
(reverse) proxy in your webserver's docs.


How can i do that ? Is that even easily possible ?

Sure. IIRC there are lots of examples floating around.


By the way, it may not be the best place to ask, but i'm using an apache server to host my Iliad applications data, and i've not been able yet to authorize access from the outside (Fedora 13 64bits). Anyone knows how to do that ? To be more specific, local access works, but the server is not reachable from an external client (i guess its a question of firewalls and/or port configurations but i know nothing about that stuff).

check with "netstat -lpnt" on which ip addresses and ports your web server is listening
if it is listening on a "local" address like 127.0.0.1 or 192.168.1.1 or 10.0.1.1, you'll
need to add a "Listen {external ip address}" to the configuration or bribe your firewall
admin to do some port forwarding magic.

if netstat reports "0.0.0.0" or "::" as IP addresses, your server should be reachable
from the world; if it is not, bribe your firewall's sysadmin to plow a route for you.

anyways, bribing your local firewall admin is always a good idea :-)

s.
Reply | Threaded
Open this post in threaded view
|

Re: Question about Iliad access urls/adresses

Nicolas Petton
Hi Steven,

You may also need to rewrite Iliad's URLs to match your vhost settings.
The idea is that an Iliad app is reachable at /foo (its path). Your
vhost must redirect incoming url to /foo/(.*). On the other hand, your
website is available at http://mysite.com , so Iliad must rewrite urls
to match the vhost.

Example:
-> generated urls look like this: http://mysite.com/...
-> incoming request http://mysite.com/ on a click on a generated link
-> proxy to <a href="http://localhost:PORT/foo">http://localhost:PORT/foo to your Iliad app

That can be done with ILUrlBuilder>>addRewriteRule:. It takes a one arg
block as parameter.

With GST, To put the counter example to http://mysite.com, I would do
something like this:

Iliad.ILUrlBuilder addRewriteRule: [:string |
    string copyReplaceAllRegex: '^\/' with: 'http://mysite.com'].

To reach an Iliad app with a specific path (let's say
'examples/counters') to '/', add another rewrite rule:

Iliad.ILUrlBuilder addRewriteRule: [:string |
    string
        copyReplaceAllRegex: 'http://mysite.com/examples/counters' 
        with: 'http://mysite.com']

With this, Iliad will write correct URLs that match the vhost for you.

Then the vhost part in Apache looks like this:

<VirtualHost>
   
    #Serve all static files from this directory
    <Directory /var/www/static/files>
        Order deny,allow
        Allow from all
    </Directory>
   
    ServerName mysite.com
    DocumentRoot /var/www/static/files

    RewriteEngine On

    #Proxy to Iliad if no static file was found
    RewriteCond /var/www/static/files/%{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ <a href="http://localhost:PORT/examples/counters/$1">http://localhost:PORT/examples/counters/$1
[proxy,last]

</VirtualHost>

HTH,
Nico

Le dimanche 31 octobre 2010 à 23:20 +0100, Stefan Schmiedl a écrit :

> Am 31.10.2010 18:48, schrieb Steven Costiou:
> > Hi,
> > I have a small question.
> >
> > I'm looking for a way to redirect a specific domain name, like
> > "www.mydomain.com" to an Iliad application adress, like
> > "<a href="http://myServerIp:myPort/myApp/myController/whatever">http://myServerIp:myPort/myApp/myController/whatever".
>
> If you want to redirect to a complete URL instead of "just" a virtual
> host, you'll probably
> need to do some rewriting in the webserver handling www.mydomain.com.
> Search for
> (reverse) proxy in your webserver's docs.
>
> >
> > How can i do that ? Is that even easily possible ?
>
> Sure. IIRC there are lots of examples floating around.
>
> >
> > By the way, it may not be the best place to ask, but i'm using an
> > apache server to host my Iliad applications data, and i've not been
> > able yet to authorize access from the outside (Fedora 13 64bits).
> > Anyone knows how to do that ? To be more specific, local access
> > works, but the server is not reachable from an external client (i
> > guess its a question of firewalls and/or port configurations but i
> > know nothing about that stuff).
>
> check with "netstat -lpnt" on which ip addresses and ports your web
> server is listening
> if it is listening on a "local" address like 127.0.0.1 or 192.168.1.1
> or 10.0.1.1, you'll
> need to add a "Listen {external ip address}" to the configuration or
> bribe your firewall
> admin to do some port forwarding magic.
>
> if netstat reports "0.0.0.0" or "::" as IP addresses, your server
> should be reachable
> from the world; if it is not, bribe your firewall's sysadmin to plow a
> route for you.
>
> anyways, bribing your local firewall admin is always a good idea :-)
>
> s.


Reply | Threaded
Open this post in threaded view
|

Re: Question about Iliad access urls/adresses

Steven Costiou
Hi guys,
thanks for the help =)

I'll try it as soon as i can - seems a bit hard however =p

-Steven Costiou-



2010/11/1 Nicolas Petton <[hidden email]>
Hi Steven,

You may also need to rewrite Iliad's URLs to match your vhost settings.
The idea is that an Iliad app is reachable at /foo (its path). Your
vhost must redirect incoming url to /foo/(.*). On the other hand, your
website is available at http://mysite.com , so Iliad must rewrite urls
to match the vhost.

Example:
-> generated urls look like this: http://mysite.com/...
-> incoming request http://mysite.com/ on a click on a generated link
-> proxy to http://localhost:PORT/foo to your Iliad app

That can be done with ILUrlBuilder>>addRewriteRule:. It takes a one arg
block as parameter.

With GST, To put the counter example to http://mysite.com, I would do
something like this:

Iliad.ILUrlBuilder addRewriteRule: [:string |
   string copyReplaceAllRegex: '^\/' with: 'http://mysite.com'].

To reach an Iliad app with a specific path (let's say
'examples/counters') to '/', add another rewrite rule:

Iliad.ILUrlBuilder addRewriteRule: [:string |
   string
       copyReplaceAllRegex: 'http://mysite.com/examples/counters'
       with: 'http://mysite.com']

With this, Iliad will write correct URLs that match the vhost for you.

Then the vhost part in Apache looks like this:

<VirtualHost>

   #Serve all static files from this directory
   <Directory /var/www/static/files>
       Order deny,allow
       Allow from all
   </Directory>

   ServerName mysite.com
   DocumentRoot /var/www/static/files

   RewriteEngine On

   #Proxy to Iliad if no static file was found
   RewriteCond /var/www/static/files/%{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ http://localhost:PORT/examples/counters/$1
[proxy,last]

</VirtualHost>

HTH,
Nico

Le dimanche 31 octobre 2010 à 23:20 +0100, Stefan Schmiedl a écrit :
> Am 31.10.2010 18:48, schrieb Steven Costiou:
> > Hi,
> > I have a small question.
> >
> > I'm looking for a way to redirect a specific domain name, like
> > "www.mydomain.com" to an Iliad application adress, like
> > "http://myServerIp:myPort/myApp/myController/whatever".
>
> If you want to redirect to a complete URL instead of "just" a virtual
> host, you'll probably
> need to do some rewriting in the webserver handling www.mydomain.com.
> Search for
> (reverse) proxy in your webserver's docs.
>
> >
> > How can i do that ? Is that even easily possible ?
>
> Sure. IIRC there are lots of examples floating around.
>
> >
> > By the way, it may not be the best place to ask, but i'm using an
> > apache server to host my Iliad applications data, and i've not been
> > able yet to authorize access from the outside (Fedora 13 64bits).
> > Anyone knows how to do that ? To be more specific, local access
> > works, but the server is not reachable from an external client (i
> > guess its a question of firewalls and/or port configurations but i
> > know nothing about that stuff).
>
> check with "netstat -lpnt" on which ip addresses and ports your web
> server is listening
> if it is listening on a "local" address like 127.0.0.1 or 192.168.1.1
> or 10.0.1.1, you'll
> need to add a "Listen {external ip address}" to the configuration or
> bribe your firewall
> admin to do some port forwarding magic.
>
> if netstat reports "0.0.0.0" or "::" as IP addresses, your server
> should be reachable
> from the world; if it is not, bribe your firewall's sysadmin to plow a
> route for you.
>
> anyways, bribing your local firewall admin is always a good idea :-)
>
> s.