cancel
Showing results for 
Search instead for 
Did you mean: 

Not 'seeing' live

setheridge
Champ in-the-making
Champ in-the-making
Hi all

I am running wcmqs quite happily and I have been changing templates and making other changes and publishing as I go along.  However I notice that when I go to

http://localhost:8080/kstest/

I am seeing the editorial version (slightly different title which is how I know).  I thought that in theory I was supposed to be seeing the live.  I did a wcmqs from scratch and I notice that for both editorial and live the context is the same (/wcmqs).  I changed the context and war file name to kstest earlier which has been working fine, but I am not seeing the live website, just the editorial.

Any ideas what I am doing wrong?

Thanks

Steve
4 REPLIES 4

bremmington
Champ on-the-rise
Champ on-the-rise
The site that you see is decided by the combination of the requested host, port, and context. These are properties defined on each website instance ("Quick Start Editorial" and "Quick Start Live", for instance). If you are seeing the editorial site then the host, port, and context that you are requesting must be the ones defined on the editorial website.

setheridge
Champ in-the-making
Champ in-the-making
Thanks Brian

That's what I thought, but I am now bemused as to why the Editorial and Live quick start "out of the box" have the same values for host, port and context - I find that quite confusing for a beginner.

So the question now is how can I have a different context for Live from Editorial when the jar file (or subdirectory) in the webapp directory will have the same name (in my case kstest)?  I have tried changing the context for live (to kstestlive) and that gets a standard Tomcat resource not found page which from my earlier experiments has to be fixed by having a jar file to back up 'kstestlive'.  I am obviously missing something but I am not sure what?  I would be grateful for any help.

Kind regards

Stephen

bremmington
Champ on-the-rise
Champ on-the-rise
Out of the box the editorial and live instances have different host names: "localhost" and "127.0.0.1" respectively. The syntactic difference is important.

Normally it will be either host name, port, or both that will be used to differentiate between editorial and live. For instance, on Linux you can forward port 80 onto port 8080 using iptables, and then configure the live instance so that it is mapped to requests on port 80 and editorial so that it is mapped to requests on port 8080. Note that it is the context of the request that is important, not the instance of Tomcat or the webapp that services the request. It is perfectly possible to have one webapp running in one Tomcat servicing many different websites.

For example, assume I have a server with IP address 222.222.222.222 and I've mapped a host name of "my.example.com" to that IP address. Assume also that I have Tomcat running on that server listening on port 8080 and I have the WQS webapp installed in that Tomcat instance mapped to the context "/wcmqs".

I'm going to configure my editorial site to map to requests received at "my.example.com:8080/wcmqs", so I edit the properties on the "Quick Start Editorial" website folder to be:

  Host = my.example.com
  Port = 8080
  Web Context = wcmqs

Now I'm going to forward port 80 onto port 8080 on my server (this is common on Linux systems - you may have to configure Tomcat to listen on two ports with an additional connector on Windows):

iptables -A PREROUTING -t nat -i eth0 -p tcp –dport 80 -j REDIRECT –to-port 8080

I now want my live site to map to requests received at "my.example.com/wcmqs", so I edit the properties on the "Quick Start Live" website folder to be:

  Host = my.example.com
  Port = 80
  Web Context = wcmqs

Note that I still have just one webapp running in just one Tomcat instance.

Now I'm going to map another host name to my server: "another.example.com" => 222.222.222.222

With that done, I can now install another WQS website into my repo and set the editorial and live properties on it like this:

Editorial:
  Host = another.example.com
  Port = 8080
  Web Context = wcmqs

Live:
  Host = another.example.com
  Port = 80
  Web Context = wcmqs

This will still use the same webapp in the same Tomcat instance, but will deliver the new site structure. If I create a new template in the webapp then that will be available for use on both of my websites.

Does that help to clarify things at all?

setheridge
Champ in-the-making
Champ in-the-making
Ah, now I think I get it!  I had not noticed the subtle difference between localhost and 127.0.0.1!

Thanks Brian, now I just have to work out how to forward 80 to 8080 on windows Tomcat for the dev.  The production environment is Linux so that is straightforward as you have shown.

Thanks again.

Steve