Page 1 of 2

Web GUI folder configuration

Posted: Sat Apr 10, 2021 9:23 pm
by nospitters
hi,

with default settings the web UI browser access is like that
http://127.0.0.1:51000

but i want something like that:
http://127.0.0.1:51000/MyWebGui

how to setup such a folder-structure? (in apache i would create an alias in the config...)

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 8:43 am
by timurhai
Hi!
I can't check it right now, but whether some custom GUI works not on:
http://127.0.0.1:51000/MyWebGui/my_index.html ?

If it works, you are asking for afserver to provide some index.html, if just folder specified?

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 10:00 am
by nospitters
i refer to afserver and its configuration in "../afanasy/config_default.json".
afserver always looks into "../afanasy/browser/index.html" (hardcoded?) and sets this as a httpd root-directory...
i.e. if i move the "browser" folder to other location like "..MyWebGui/browser/", i cant define "../MyWebGui/" as a httpd root directory, so that in firefox the adress looks like "http://server_ip/browser/"...hope its clear what i mean...

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 10:39 am
by timurhai
Aserver httpd root folder is the entire CGRU root folder, and can't be other, as some scripts and icons are global (used by various cgru tools, not only web gui).
If get request is empty it returns /afanasy/browser/index.html - this is hardcoded, but it is not a big deal to make it configurable.
But the entire root folder is configurable:
https://github.com/CGRU/cgru/blob/maste ... t.json#L13

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 11:12 am
by nospitters
i see...
my intension was to serve the WebGui over the internet, so users can reach the WebGui in a browser-adress like "http://www.host.com:51000/WebGui/index.html"
and NOT "http://www.host.com:51000", since "host.com" has also several internet pages to show...

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 12:31 pm
by timurhai
Now i does not see... ))
Why now you can't use http://www.host.com:51000/WebGui/index.html ?

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 1:54 pm
by nospitters
???
i think we misunderstood...

i try to explain:
by default the Web Interface is configured that it looks to "../afanasy/browser/index.html", wich is the dokument root of the WebGui...
this is mapped for a internet-browser so that the adress looks like "http://www.host.com:51000"
when i change the "af_http_serve_dir" to "c:/xxx/xxx" then it looks to "../xxx/xxx/afanasy/browser/index.html" but is also mapped to "http://www.host.com:51000". (btw. this doesnt work, because i cant move the browser folder to other location...)
so i need something like an alias folder wich has a name i.e. "MyWebGui" and looks into ""../afanasy/browser/" as the dokument root, so it can map the adress to "http://www.host.com:51000/MyWebGui"

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 4:00 pm
by timurhai
So, if you could configure what afserver should return on an empty request (now it is build in):
https://github.com/CGRU/cgru/blob/maste ... nasy.h#L49
It will fit your needs?

You what to configure any site root location and to return just index.html (not /afanasy/browser/index.html)?

Or misunderstanding again? ))

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 4:31 pm
by nospitters
i think you misunderstand...(or maybe i misunderstand?)
but this can be override at the moment with "af_http_serve_dir" in the config, right?

nevertheless whatever i will put inside it will always return the "root" internet-adress "http://host:51000" and NOT a subfolder like "http://host:51000/SubFolder/"
(i mean i want to reach the index.html from a subfolder inside the internet-browser...)

in apache httpd.conf there is the ability to configure a root-dir (which is accessed as "http://host:80") AND a alias folder i.e. named WebGUI (which is accessed as "http://host:80/WebGUI")

Re: Web GUI folder configuration

Posted: Mon Apr 12, 2021 6:05 pm
by timurhai
It will return any location w/o any change, for example http://host:51000/SubFolder/
But on empty location http://host:51000 it returns http://host:51000/afanasy/browser/index.html

AfServer is not Apache, it is just a 177 code lines web server:
https://github.com/CGRU/cgru/blob/maste ... ttpget.cpp
( the simplest, i think )