I am Using wthttpd only no Apache.
I Think I finally figured out what my problem is with Static Files, the
url to the path does not matter, it always resolves to docroot, which is
hard coded,
what I have is an app that has multiple domains or URLs,
I want each domain or URL to have its own docroot, or some folder it can
resolve to relative to the URL,
since it does not take the URL into consideration when resolving the
docroot path,
because in the source of let say an image i.e.
src="http://domain1.tdl/image.png"
src="http://domain2.tdl/image.png"
will both resolve to the same physical location, because docroot is a
virtual folder, which seems to be unchangeable at run time,
so it is where ever docroot is defined in the /etc/wt/wt_config.xml for
resourcesURL,
or the --docroot="./doc_root;/media" switch at run time, regardless of
the URL,
whereas in Apache, I can change my document root based on the URL,
and I always assumed this was not different,
which is why I have been asking stupid questions about this issue, I did
not fully understand it,
I do not see a way to do this in code.
Is my thinking on this issue clear, because I think I finally wrapped my
mind around this whole docroot, approot and resourcesURL issue,
if I am right, all paths in Wt with wthttpd are relative, and docroot,
approot and resources are hard coded at run time with no way to change
them at run time,
this concept is based on a Virtual Folder so the URL does not effect it,
which is why src="http://domain1.tdl/image.png" or
src="http://domain2.tdl/image.png",
both point to the same image, regardless of the URL,
I can define --docroot="./doc_root;/media" at run time, but its hard
corded.
Possible solutions:
I base my folders on users in the system so I can assign FTP folders,
which I suppose I could configure the users home path to be inside
docroot, or resources,
but I still have the issue about how to change the docroot to something
like:
.--docroot="./doc_root;/media/domain.tdl"
src="/media/domain.tdl/image.png"
I read ever document I can find on this matter, and could not resolve
this issue on my own,
so I hope someone has a workaround,
or maybe I still am confused,
after programming in C for 34 years, I make more rookie mistakes now
then I did 20 years ago,
having a Traumatic Brain Injury on top of getting old,
may be the reason I am struggling so much with this,
but I believe my main problem is lack of examples,
and the things I am trying to do are not very well documented,
but over all I am happy with the Documents I can find,
and I will eventually learn how to create a CMS using this library,
but I now know why a lot of people tried to steer me away from using
this Library for a CMS,
but I will not let that stop me,
at this point it looks like I might have to write a patch for
WApplication to allow the dynamic changing of either docroot or
resources,
if that is the case which one would be easier and better to hack for
this problem,
if you have any suggestions I would be grateful,
I am so close to getting this working, but this issue is a show stopper,
because if I can not find a way to do this, I can not create a CMS using
this Library,
which would be a shame, because this Library Rocks.
Project home website
http://wittywizard.org:8060/ww/en
https://github.com/WittyWizard/install
Other websites running off the same Web App, to show I can connect to
databases, and change folder to templates, and other features a CMS
needs
http://greywizzard.com:8060/ww/
http://thedarkwizzard.com:8060/ww/
Content and Themes suck, but its just a concept at this point,
right now I have the docroot pointing to a folder that has all my
video's in it for testing, so they will resolve,
haproxy is off, I am having issues with it.
Thanks
On Fri, 2014-06-27 at 14:30 +0400, Nagaev Boris wrote:
> Hello!
>
> http://wittywizard.org/media/lw/light-wizzard-in-the-flesh/00-00-G-IAM/image/credits.png
> works for me.
>
>
> Do you use haproxy (latest lines of your message)?
>
>
> To share same files between several WtHttp instances, use symbolic
> links. For example, link /usr/share/Wt/resources from ./doc_root.
>
>
> Try changing "baseURL" property in wt_config.xml to host whole
> application not on "/", but on "/w". Easier way is to use (sub)domains
> rather than subpaths.
>
>
>
>
> -
> Best regards,
> Boris Nagaev
>
>
>
>
> On Fri, Jun 27, 2014 at 5:48 AM, Jeffrey Scott Flesher Gmail
> <jeffrey.scott.fles...@gmail.com> wrote:
>
> I use httpd only, no Apache or other web server is loaded.
>
> I have a folder structure like this:
> Root (/home/userName) this is where the Executable is
> - app_root this is where my configuration xml files are
> -doc_root this is where my resources are
> -resources
> -media
>
> Now, I have a resource file (*.js, *.png...) and I have it in
> an HTML file that I connect via an iframe, if I use a run
> command like this:
> ./WittyWizard.wt --docroot "./doc_root;/media"
> --approot="./app_root" --deploy-path="/ww"
> --http-address="0.0.0.0" --http-port="8060"
> and in my HTML I do this:
> <img
>
> src="/media/lw/light-wizzard-in-the-flesh/00-00-G-IAM/image/credits.png" ...
> it works fine
> but if I do this
> <img
>
> src="http://wittywizard.org/media/lw/light-wizzard-in-the-flesh/00-00-G-IAM/image/credits.png"
> ...
> it does not work
> My problem is that I want to share files between various apps,
> so the url may not be the same, and currently this does not
> work, I have to host all the data per account and use relative
> paths, is there a way around this behavior?
>
> Also on the --deploy-path regarding ?_= vs /ww
> ./WittyWizard.wt --docroot "./doc_root;/media"
> --approot="./app_root" --deploy-path="/"
> --http-address="0.0.0.0" --http-port="8060"
> Why doesn't this work? I get ?_=
> whereas
> ./WittyWizard.wt --docroot "./doc_root;/media"
> --approot="./app_root" --deploy-path="/ww"
> --http-address="0.0.0.0" --http-port="8060"
> works
>
> My biggest issues is how do I turn http:wittywizard.org into
> http:wittywizard.org/w
> I have been looking for an haproxy way but do not know how to
> get this to work
> acl has_ww_uri path_beg -i /ww
> redirect location /ww code 301 if !has_ww_uri
> or
> reqirep ^([^\ :]*)\ /(.*) \1\ /ww\2 if !has_ww_uri
> Any idea's, how do you do it?
>
> Thanks
>
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java
> and Eclipse
> Turn processes into business applications with Bonita BPM
> Community Edition
> Quickly connect people, data, and systems into organized
> workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awards
> http://p.sf.net/sfu/Bonitasoft
> _______________________________________________ witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest