Re: How does one configure Plain host domain url to run web app?

2007-04-07 Thread John Moore

Folks,

I found the solution and it was embarrassingly simple.. (an often 
occurrence..)


All I had to do was set the DocumentRoot to where I wanted the 
index.html to be run from.


(I found it when I was deleting all of the various test settings, 
Directory tags, Aliaes, redirects and left the DocumentRoot setting just 
for grins.  I then tested the site to see if the webapps were still 
working but quickly tried the domain root.. what the heck.. it worked..!!!)


So.. there you go..

John...



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-17 Thread Rashmi Rubdi
Thank you for adding the Virtual Hosting how-to, and it is very nicely written 
too.

I find it useful and easy to configure multiple apps in:
$CATALINA_HOME/conf/Catalina/ren/ROOT.xml
$CATALINA_HOME/conf/Catalina/stimpy/ROOT.xml  

rather than having the Context entries in server.xml , so now only the Hosts 
need to be configured in server.xml

-Rashmi

- Original Message 
From: Mark Thomas [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Friday, March 16, 2007 9:20:15 PM
Subject: Re: How does one configure Plain host domain url to run web app?


John Moore wrote:
 Thanks for any ideas or suggestions..

A how to has been added to the documentation.
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html

Mark


 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-16 Thread John Moore

Rashmi Rubdi wrote:

You are right, the set-up I've mentioned only works for one application.

Perhaps you want to configure multiple virtual hosts. 
  


I already use virtual hosts..

There's an example on that here: 
http://confluence.atlassian.com/display/DOC/Guide+to+using+Apache+Tomcat's+Virtual+Hosts
  

Interesting but.. I already do that, as best as I can tell..


You won't need Apache HTTP connector, just Tomcat is fine I think (not sure).
  
My understanding is that Tomcat by itself is not nearly as a robust and 
HTTP service.. At least that is what I used to hear, both here and in 
many other postings and books..





because the above configuration uses name-based virtual hosting, you need to have entries in your 
DNS server for app1 and app2 that point to the application server

  

.. yes I also do that already..

The problem I'm having is that a java web app is generally called via a 
context   Since there are MANY webapps in the system I can place a 
single webapp in the root..


therefore how do I map a single host.domain to a virtual host..

Currently I have

http://www.mydomain.com/mysite/thecontext

..where mysite is a sub-directory under webapps and thecontext is 
the context of that web application using JkMount


I would like to configure it so that..

http://www.mydomain.com

..also brings up that same webapp..

Make sense..???

I can currently do this by mapping

http://www.mydomain.com  to an Apache Htdocs virtual host service with a 
redirect to..


http://otherhost.mydomain.com/mysite/thecontext

..where otherhost is a DNS entry for that domain of which there is 
also a virtual host in Tomcat.


I was hopping I did not have to do this convolluted system, as it is 
easy to forget what is happening and someone (employee) could easily 
mess it up..


Is that clearer now..??

Thanks for any ideas or suggestions..

John..

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-16 Thread Mark Thomas
John Moore wrote:
 Thanks for any ideas or suggestions..

A how to has been added to the documentation.
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html

Mark


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread org

Hi John,

Ok, I'm going to try show you how I think about this stuff... and I'm often 
wrong ;)


Dont use a redirect... it goes back to the browser and its not cool.

Firstly make a servlet and have a look at the CONTEXT.XML file under 
META-INF


Change it to..
?xml version=1.0 encoding=UTF-8?
Context path=/

Now have a look at WEB.XML under WEB-INF

make sure the mapping is
   servlet-mapping
   servlet-nameNewServlet/servlet-name
   url-pattern/*/url-pattern
   /servlet-mapping

OK now that servlet will run for any URI from the domain name up ie 
www.host.com/ANYTHINGorNOTHING


You can play with the mapping if you dont want that... but let me show you 
how I do this sort of stuff, and then you can tweak it as you want.


Now in the servlet make this routine

   protected void displayPage(HttpServletRequest request, 
HttpServletResponse response, String thePage)

   throws ServletException, IOException {

   RequestDispatcher dispatch = 
request.getRequestDispatcher(thePage);

   dispatch.forward(request, response);
}

Now when the servlet is called in
   protected void processRequest(HttpServletRequest request, 
HttpServletResponse response)


do this

displayPage( request,  response,  index.jsp);

So all of a sudden you can direct any URL to any page without redirects 
can use the API to check the URL and use a case statement whatever.


OK... heres the final trick coz it looks like you trying to run behind 
Apache


put this in the servlet.xml file in Tomcat.conf

   Host name=www.site.com appBase=webapps

   unpackWARs=true autoDeploy=true

   xmlValidation=false xmlNamespaceAware=false

   !-- USE THIS FOR AUTO GEN OF JK MOD for Apache Forwarding to tomcat 
MODIFY PATHS FOR YOUR SYSTEM--


   Listener className=org.apache.jk.config.ApacheConfig append=true 
forwardAll=false modJk=D:/DEV/Apache2.2/modules/mod_jk.so/




   /Host

Now when you start Tomcat it will create a folder under conf/auto it puts 
all the stuff apache needs in a mod_jk.file


looks like this but its AUTOMATICALLY generated when tomcat starts.

   # Static files
   Alias /jsp-examples D:/DEV/Tomcat 5.5/webapps/jsp-examples

   Directory D:/DEV/Tomcat 5.5/webapps/jsp-examples
   Options Indexes FollowSymLinks
   DirectoryIndex index.html index.htm index.jsp
   /Directory


   # Deny direct access to WEB-INF and META-INF
   #
   Location /jsp-examples/WEB-INF/*
   AllowOverride None
   deny from all
   /Location

   Location /jsp-examples/META-INF/*
   AllowOverride None
   deny from all
   /Location
   #
   # Use Directory too. On Windows, Location doesn't work unless case 
matches

   #
   Directory D:/DEV/Tomcat 5.5/webapps/jsp-examples/WEB-INF/
   AllowOverride None
   deny from all
   /Directory

   Directory D:/DEV/Tomcat 5.5/webapps/jsp-examples/META-INF/
   AllowOverride None
   deny from all
   /Directory

   JkMount /jsp-examples/security/protected/j_security_check  ajp13
   JkMount /jsp-examples/forward/one.jsp  ajp13
   JkMount /jsp-examples/tagplugin/foreach.jsp  ajp13
   JkMount /jsp-examples/dates/date.jsp  ajp13
   JkMount /jsp-examples/jsp2/tagfiles/panel.jsp  ajp13
   JkMount /jsp-examples/xml/xml.jsp  ajp13
   JkMount /jsp-examples/jsp2/simpletag/repeat.jsp  ajp13
   JkMount /jsp-examples/CompressionTest  ajp13
   JkMount /jsp-examples/cal/cal2.jsp  ajp13
   JkMount /jsp-examples/sessions/carts.jsp  ajp13
   JkMount /jsp-examples/tagplugin/choose.jsp  ajp13
   JkMount /jsp-examples/jsptoserv/jsptoservlet.jsp  ajp13
   JkMount /jsp-examples/jsp2/misc/config.jsp  ajp13
   JkMount /jsp-examples/checkbox/checkresult.jsp  ajp13
   JkMount /jsp-examples/security/protected/login.jsp  ajp13
   JkMount /jsp-examples/jsp2/simpletag/book.jsp  ajp13
   JkMount /jsp-examples/forward/forward.jsp  ajp13
   JkMount /jsp-examples/jsp2/jspx/textRotate.jspx  ajp13
   JkMount /jsp-examples/simpletag/foo.jsp  ajp13
   JkMount /jsp-examples/security/protected/index.jsp  ajp13
   JkMount /jsp-examples/include/include.jsp  ajp13
   JkMount /jsp-examples/error/err.jsp  ajp13
   JkMount /jsp-examples/jsp2/el/basic-arithmetic.jsp  ajp13
   JkMount /jsp-examples/*.jspx  ajp13
   JkMount /jsp-examples/jsp2/jspx/basic.jspx  ajp13
   JkMount /jsp-examples/snp/snoop.jsp  ajp13
   JkMount /jsp-examples/error/errorpge.jsp  ajp13
   JkMount /jsp-examples/jsp2/jspattribute/jspattribute.jsp  ajp13
   JkMount /jsp-examples/include/foo.jsp  ajp13
   JkMount /jsp-examples/jsp2/el/functions.jsp  ajp13
   JkMount /jsp-examples/jsp2/tagfiles/products.jsp  ajp13
   JkMount /jsp-examples/jsp2/simpletag/hello.jsp  ajp13
   JkMount /jsp-examples/jsp2/el/basic-comparisons.jsp  ajp13
   JkMount /jsp-examples/colors/colrs.jsp  ajp13
   JkMount /jsp-examples/jsp2/jspattribute/shuffle.jsp  ajp13
   JkMount /jsp-examples/num/numguess.jsp  ajp13
   JkMount /jsp-examples/*.jsp  ajp13
   JkMount /jsp-examples/plugin/plugin.jsp  ajp13
   JkMount /jsp-examples/source.jsp  

RE: How does one configure Plain host domain url to run web app?

2007-03-13 Thread Caldarale, Charles R
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
 Subject: Re: How does one configure Plain host domain url to 
 run web app?
 
 Dont use a redirect... it goes back to the browser and its not cool.

Nothing wrong with redirects.  They're quite appropriate to allow the
browser to properly evaluate relative links in pages without the need
for the extra gyrations you're suggesting.

 Firstly make a servlet and have a look at the CONTEXT.XML file under 
 META-INF
 
 Now have a look at WEB.XML under WEB-INF

Watch out for case sensitivity here; both context.xml and web.xml must
be lower-case file names.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread John Moore

Rashmi Rubdi wrote:

I think an application runs on the root context / by default, if it's 
configured this way in server.xml :

Engine name=Catalina defaultHost=localhost
   Host name=localhost appBase=webapps/projectname
Context path= docBase=C:\dev\projects\projectname reloadable=true 
/
Logger className=org.apache.catalina.logger.FileLogger/
   /Host
/Engine
  

Thanks for replying..

I have that already and it does not help..

Other suggestions..??

John..



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread John Moore

[EMAIL PROTECTED] wrote:

Hi John,

Ok, I'm going to try show you how I think about this stuff... and I'm 
often wrong ;)


Dont use a redirect... it goes back to the browser and its not cool.

Firstly make a servlet and have a look at the CONTEXT.XML file under 
META-INF


Thank you for taking the time to explain your idea..   I actually often 
do it another way.. I create another host for the webapp and then 
place the plain domain www.mydomain.com as an Apache HTdocs and then 
redirect to the webapp host..


Problem with this an your solution is that is it messy.. We serve a LOT 
of webapps and need to keep it as simple as possible..  I will study 
your idea and see if it can help me on finding a cleaner solution..


John..

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread John Moore

Caldarale, Charles R wrote:
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Subject: Re: How does one configure Plain host domain url to 
run web app?


Dont use a redirect... it goes back to the browser and its not cool.



Nothing wrong with redirects.  They're quite appropriate to allow the
browser to properly evaluate relative links in pages without the need
for the extra gyrations you're suggesting.

  

 I agree...

Do you have any thoughts on a solution...

John..


Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread Rashmi Rubdi
If you place your application as ROOT.war , directly under Tomcat's webapps 
folder then Tomcat should load it on the root context / 

But if it's named anything else then it will be at the /ProjectName/ context.

I have mine set-up like this on a clean install of Tomcat 5.5 (with no 
additional configuration) and the web application loads on the root context.

If you place an index.jsp directly in the root folder of your project then, 
that takes care of hiding the directory listing and rendering the home page of 
your app.

Also configure welcome-file in your project's web.xml to index.jsp

-Rashmi

- Original Message 
From: John Moore [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, March 13, 2007 4:12:48 PM
Subject: Re: How does one configure Plain host domain url to run web app?


Rashmi Rubdi wrote:
 I think an application runs on the root context / by default, if it's 
 configured this way in server.xml :

 Engine name=Catalina defaultHost=localhost
Host name=localhost appBase=webapps/projectname
 Context path= docBase=C:\dev\projects\projectname 
 reloadable=true /
 Logger className=org.apache.catalina.logger.FileLogger/
/Host
 /Engine
   
Thanks for replying..

I have that already and it does not help..

Other suggestions..??

John..


 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread Hassan Schroeder

On 3/13/07, John Moore [EMAIL PROTECTED] wrote:


Problem with this an your solution is that is it messy..


Front-ending Tomcat with Apache is messy :-)

If you *must* use Apache for whatever reason, you'd be better off
using mod_proxy_ajp in conjunction with mod_rewrite to handle this
configuration.

FWIW,
--
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread John Moore

Hassan Schroeder wrote:

On 3/13/07, John Moore [EMAIL PROTECTED] wrote:


Problem with this an your solution is that is it messy..


Front-ending Tomcat with Apache is messy :-)


Really..   Why.. ??


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread John Moore

Thank you for replying..

This is one webapp among many on this server..  


So if I understand you correctly this will not be possible..

If I have miss understood.. could you clarify..??

John..

Rashmi Rubdi wrote:
If you place your application as ROOT.war , directly under Tomcat's webapps folder then Tomcat should load it on the root context / 


But if it's named anything else then it will be at the /ProjectName/ context.

I have mine set-up like this on a clean install of Tomcat 5.5 (with no 
additional configuration) and the web application loads on the root context.

If you place an index.jsp directly in the root folder of your project then, 
that takes care of hiding the directory listing and rendering the home page of 
your app.

Also configure welcome-file in your project's web.xml to index.jsp
  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread Hassan Schroeder

On 3/13/07, John Moore [EMAIL PROTECTED] wrote:


 Front-ending Tomcat with Apache is messy :-)

Really..   Why.. ??


By which I meant, httpd is an extraneous complication, unless you
really need to have something like PHP or other service outside of
Tomcat. Do you?

If that's the case, mod_proxy_ajp is far simpler to configure than mod_jk.
But if not, simplify your life :-)

--
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-13 Thread Rashmi Rubdi
You are right, the set-up I've mentioned only works for one application.

Perhaps you want to configure multiple virtual hosts. 

There's an example on that here: 
http://confluence.atlassian.com/display/DOC/Guide+to+using+Apache+Tomcat's+Virtual+Hosts

You won't need Apache HTTP connector, just Tomcat is fine I think (not sure).

On MS Windows , configure the hosts in the 
C:\WINDOWS\system32\drivers\etc\hosts , by adding this line:

127.0.0.1 pebble practice

Then configure these two apps in server.xml , as:

Engine name=Catalina defaultHost=pebble

Host name=pebble appBase=webapps/pebble
 Context path= docBase=C:/dev/projects/pebble reloadable=true /
Logger className=org.apache.catalina.logger.FileLogger/
/Host

Host name=practice appBase=webapps/practice
 Context path= docBase=C:/dev/projects/practice reloadable=true /
Logger className=org.apache.catalina.logger.FileLogger/
/Host

/Engine

Then you'll be able to call 2 different applications on the root context , for 
example http://pebble:8080/   and http://practice:8080/  , you might be 
able to do something similiar on Unix, and also might be able to change the 
port to 80 , from 8080.  

I give credit to Hassan for explaining the above configuration to me a few 
months ago.

Over here 
http://confluence.atlassian.com/display/DOC/Guide+to+using+Apache+Tomcat's+Virtual+Hosts
  it also says 
because the above configuration uses name-based virtual hosting, you need to 
have entries in your DNS server for app1 and app2 that point to the 
application server

-Rashmi

- Original Message 
From: John Moore [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, March 13, 2007 7:41:40 PM
Subject: Re: How does one configure Plain host domain url to run web app?


Thank you for replying..

This is one webapp among many on this server..  

So if I understand you correctly this will not be possible..

If I have miss understood.. could you clarify..??

John..

Rashmi Rubdi wrote:
 If you place your application as ROOT.war , directly under Tomcat's webapps 
 folder then Tomcat should load it on the root context / 

 But if it's named anything else then it will be at the /ProjectName/ 
 context.

 I have mine set-up like this on a clean install of Tomcat 5.5 (with no 
 additional configuration) and the web application loads on the root context.

 If you place an index.jsp directly in the root folder of your project then, 
 that takes care of hiding the directory listing and rendering the home page 
 of your app.

 Also configure welcome-file in your project's web.xml to index.jsp
   

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: How does one configure Plain host domain url to run web app?

2007-03-12 Thread Rashmi Rubdi
I think an application runs on the root context / by default, if it's 
configured this way in server.xml :

Engine name=Catalina defaultHost=localhost
   Host name=localhost appBase=webapps/projectname
Context path= docBase=C:\dev\projects\projectname 
reloadable=true /
Logger className=org.apache.catalina.logger.FileLogger/
   /Host
/Engine

server.xml is located at : ..\apache-tomcat-5.x\conf\ 

On Windows XP , you can try something similar in Unix.

-Rashmi

- Original Message 
From: John Moore [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, March 12, 2007 9:28:59 PM
Subject: How does one configure Plain host domain url to run web app?


(Tomcat 4.x)

I have the following url that runs an application (pseudo url for 
discussion only)


http://www.mydomain.com/mysite/thecontext

works fine..

I would like to configure it so that..

http://www.mydomain.com

gets me to the same place..

I can place a redirect html page at

http://www.mydomain.com/mysite/index.html

which redirects to

http://www.mydomain.com/mysite/thecontext

but have yet to get a plain

http://www.mydomain.com

to work.. I keep getting either the No Context configured. error 
or the dreaded index of the directory..

I've tried Aliaes, Document root, Directory, and various JkMount 
settings in the Virtual host conf file that seemed like it might work, 
but so far, no joy..  (Tried Googling it, but have not come up with the 
right key words..)

Some of the things I have tried  in the conf file..

==
Alias /mysite usr/tomcat/webapps/mysite
Alias / usr/tomcat/webapps/mysite

DocumentRoot /usr/local/tomcat/webapps/mysite/

Directory /usr/local/tomcat/webapps/mysite
Options Indexes FollowSymLinks
DirectoryIndex index.html index.htm index.jsp
  /Directory

JkMount /mysite/thecontext  ajp13
JkMount /mysite/*.jsp  ajp13

..variations of..
JkMount /*.jsp  ajp13  -- gives me a dreaded index of the correct 
directory
   JkMount /*.html  ajp13  -- same as above
   JkMount /*.  ajp13  -- blank document (strange)
   JkMount /*  ajp13  -- context error
=

Suggestions appreciated..

(all of my other machines are running Tomcat 5.. I will be moving this 
app next month.. so a Tomcat 5 suggestion would be welcome as well)

John..



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]