cancel
Showing results for 
Search instead for 
Did you mean: 

Preview Website: Is this a Bug?

sacco
Champ in-the-making
Champ in-the-making
In the course of investigating
http://forums.alfresco.com/viewtopic.php?t=8207
I discovered that I can Create a new Webapp Folder
within a Web Project, and that I can subsequently
select a Current Webapp Folder with which to
work in the Web Client.  (I'm not yet sure exactly
how or whether I intend to use this, but…)

However, whenever I select a Current Webapp Folder
other than ROOT and try to Preview Website, Tomcat
returns HTTP Status 404 and tells me that the requested resource is unavailable. 
I'm guessing that Alfresco's path-mangling for the
Virtualisation Server has not actually been set up to deal with multiple
webapps and that it is just looking for a directory under the
ROOT webapp instead, but I don't actually know what the intended
behaviour is here.
6 REPLIES 6

sacco
Champ in-the-making
Champ in-the-making
P.S.

Is there any chance we could have an option to switch to
mangling the path-part of the URL rather than the host-part.
I have several situations where host-mangling is simply a
complete non-starter (sometimes for multiple reasons).

Failing that, is there somewhere I can find definitive
documentation of all the structure and patterns of Virtual
host-names that can be generated as, if we are going to
try to use the preview feature, I will probably have to fake a
path-mangling solution by proxying and (yuck) filtering pages.

OK, so path-mangling isn't going to handle paths starting with
'/'without some co-operation from the webapp, but without that
kind of co-operation host-mangling isn't going to take you too
much further (and in some cases will fail first). 
For example, any page containing an ordinary <base > tag will break
host-mangling, and given that, just for example, several mobile
Internet providers (stupidly, in my opinion) mangle base tags and
hostnames in order to reduce latency by pre-caching, that could
end up being pretty much every page!

kvc
Champ in-the-making
Champ in-the-making
Sacco:

Your ROOT web app does need to have some content in it.  This is true to the servlet standard.  If you have at least some content within your ROOT web app, and you upload content or an entire web app into a second web app folder, preview should work.  The virtualization server was designed and built to support multiple web apps per web project.

If you have an empty ROOT folder and simply add your WAR to a newly created web app folder, yes, this will not work. 

Kevin

sacco
Champ in-the-making
Champ in-the-making
Thanks for the quick response, Kevin.

OK.

I create a webapp called  'dummy' and within it an extra Webapp Folder called
'sampleTarget'.

I put an index.html in each (& submit and approve it),  and mount the AVM filesystem.

Here's what I see:


[root@cspc15 extension]# ls /srv/alfresco/cifs_2.1-a/AVM/dummy/HEAD/DATA/www/avm_webapps/
total 0
drwxr-x–x  256 root root 0 Aug 20 18:05 ROOT/
drwxr-x–x    1 root root 0 Aug 20 18:06 sampleTarget/
[root@cspc15 extension]# ls /srv/alfresco/cifs_2.1-a/AVM/dummy/HEAD/DATA/www/avm_webapps/ROOT/
total 1
-rw-r—–  1 root root 30 Aug 20 18:05 index.html
-rw-r—–  1 root root 32 Aug 20 18:05 index2.html
[root@cspc15 extension]# ls /srv/alfresco/cifs_2.1-a/AVM/dummy/HEAD/DATA/www/avm_webapps/sampleTarget/
total 1
-rw-r—–  1 root root 23 Aug 20 18:06 index.html
[root@cspc15 extension]#

With Current Webapp Folder: ROOT, Preview Website takes me to the following URL where I see the expected page:

http://dummy.www--sandbox.avm.alfresco-21-a.DOMAIN.TLD:8180/

However, with Current Webapp Folder: sampleTarget, Preview Website takes me to the following URL where I get:

[size=150]HTTP Status 404 - /sampleTarget[/size]
"The requested resource (/sampleTarget) is not available."

http://dummy.www--sandbox.avm.alfresco-21-a.DOMAIN.TLD:8180/sampleTarget

I've just repeated this again in a hurry, so I'll check it again later when I have more time to see if there seems to be anything else that could be affecting the situation, but this is essentially the same result as I had this morning.

By the way, the  index.html  in 'sampleTarget' can be downloaded via
Browse Website — it's just the Preview that doesn't
seem to work.

Thanks,
t/s

jcox
Champ in-the-making
Champ in-the-making
Until recently (a few minutes ago),  after you created
a non-ROOT webapp within a web project, you had
to hit "Refresh" on the sandbox manually.

This usability bug has been filed in JIRA,
and has been fixed on the soon-to-be-released
2.1 ENTERPRISE branch.    For more details, see:
http://issues.alfresco.com/browse/WCM-768

For the time being, just hit 'Refresh' on the sandbox
manually after you add a non-ROOT webapp to a project,
and you should be all set.


  - Cheers,
   Jon

sacco
Champ in-the-making
Champ in-the-making
Great, thanks.

Strange, though, I could have sworn that I'd tried that, but I guess I was
probably trying out several other things at the same time and never
hit the button at the right time.  It's been a long day!

sacco
Champ in-the-making
Champ in-the-making
You may already have fixed it, but I just thought I'd better mention that
the refresh is also required to preview a non-ROOT webapp in copy
deployed to an Alfresco server.

Cheers,