You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Tommy Pham <to...@gmail.com> on 2013/03/21 18:23:15 UTC
virtual directory
Hi,
I'm trying to setup my virtual directory wwwroot as
http://localhost/wwwroot/ mapped to d:\wwwroot but I'm getting
HTTP Status 404 - /wwwroot/
type Status report
message /wwwroot/
description The requested resource (/wwwroot/) is not available.
Apache Tomcat/7.0.26
My wwwroot.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context path="/wwwroot" docBase="D:/wwwroot" debug="0" privileged="true">
</Context>
and the localhost log:
Mar 21, 2013 10:14:38 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Mar 21, 2013 10:14:38 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor
D:\apache-tomcat-7.0.26\conf\Catalina\localhost\wwwroot.xml
Mar 21, 2013 10:14:38 AM
org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug'
to '0' did not find a matching property.
Mar 21, 2013 10:14:39 AM org.apache.catalina.util.SessionIdGenerator
createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation
using [SHA1PRNG] took [145] milliseconds.
Mar 21, 2013 10:14:39 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache-tomcat-7.0.26\webapps\docs
Did I misread the doc [1]?
Thanks,
Tommy
[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: virtual directory
Posted by André Warnier <aw...@ice-sa.com>.
Tommy Pham wrote:
> On Thu, Mar 21, 2013 at 11:10 AM, André Warnier <aw...@ice-sa.com> wrote:
>> Manuel Fernández Panzuela wrote:
>>> To publish your wwwdoc directory you must edit sever.xml and look for
>>> <Host>
>>> tag. Inside this block write a line like::
>>>
>>> <Context docBase="D:/wwwroot" path="/wwwroot" reloadable="true" />
>>>
>> Hi.
>> Don't top-post.
>> And the page which the original poster apparently mis-read, also says (in
>> bold) :
>>
>> It is NOT recommended to place <Context> elements directly in the server.xml
>> file.
>>
>> https://tomcat.apache.org/tomcat-7.0-doc/config/context.html
>>
>
>
> Hi André,
>
> Thanks for the feedback. I'm still getting the 404 error with this wwwroot.xml:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <Context docBase="D:/wwwroot">
> </Context>
>
> And the catalina log shows:Mar 21, 2013 11:46:27 AM
>
> org.apache.catalina.core.StandardEngine startInternal
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
> Mar 21, 2013 11:46:27 AM org.apache.catalina.startup.HostConfig deployDescriptor
> INFO: Deploying configuration descriptor
> D:\apache-tomcat-7.0.26\conf\Catalina\localhost\wwwroot.xml
> Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory D:\apache-tomcat-7.0.26\webapps\docs
> Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory
> D:\apache-tomcat-7.0.26\webapps\examples
>
Like Christopher, I would have expected this to work.
So, a few stupid questions (but one never knows) :
- is there actually something in D:\wwwroot ? if yes, what ?
- is your browser (window) opened on the same host as where you have tomcat installed ?
- is it this tomcat that is listening on port 80 ?
- do you have more than 1 (uncommented) <Host> in your server.xml ?
- can you call up http://localhost/docs ?
- what happens if you copy what is now in D:\wwwroot, to
D:\apache-tomcat-7.0.26\webapps\wwwroot ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: virtual directory
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Tommy,
On 3/21/13 5:00 PM, Tommy Pham wrote:
> Silly me... I figured out what was the issue. I didn't have the
> index page defined in Tomcat's web.xml within the D:\wwwroot. The
> eventual content of this folder will be images anyway. Would I
> need to code an interceptor to detect 404 error and path to
> redirect the visitor to another URL instead of Tomcat's default 404
> error?
I would just configure an <error-page> in web.xml like usual.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJRTN40AAoJEBzwKT+lPKRYcYoP/18xFmCLD04KOyGoge2uhjYw
xB6TWT/VHf5pPGk9xY2TJp+nkkIfGiKwPqCovAemV/JdzAYXocsx3P/cbt0Jvzw7
ltVk+Y1non8o6KhrlxAsXpObLYcZzhnLpkefkHIp3awYIwzrgVi4k1GTIKucozzs
4/7QWAjCznxdL0WJln6eJ//pgwOfaSpuNGbXocjY00vy3R3cBveQ94YaxzoyTKvy
s85ubbMSZtvbufof2thvO3c+GWWRRyJpaYCrQZ2Sw0TpUBBj78D3jknenAHssfat
R1qtFi2K0HT2SNHfloYOzgmAyjnpbdOMU6QNXkdc4ckjQzRVO9PczOgj+VMx9h8c
gB4jFzBZFja9i/u9GwR2mBjHJBM1kCjDdfD7Oi0mgj4Mg17CHUGcU4DF9NWJ9Cfb
TMYbNHK53QxFm1Bjb4JiVERdPf1x9UfRg8uv7XResUXTmUHg3Rv/hoMdW4JPN+GZ
oPEc0VcGGz+qXexOoSdgvTqBEOOGvIhl0wcy5j9zh0O7p2fQFx8RcsFQj88hlkGq
UzY/DvWzviErDRGS1FIOCzALnZ2KeRI0uWdAW0nMqXq7X/gATfmnpVakfEtBILUH
Vag9KCQBWWcqynrOy1Svo5vwjuz31CU+Cb8hBruSzF1+9Ei+QG85HVdwjjAxEsTS
SEYdeu5+Y3QGeEi41zrN
=cdDP
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: virtual directory
Posted by Tommy Pham <to...@gmail.com>.
Hi Chuck and Andre,
Silly me... I figured out what was the issue. I didn't have the index
page defined in Tomcat's web.xml within the D:\wwwroot. The eventual
content of this folder will be images anyway. Would I need to code an
interceptor to detect 404 error and path to redirect the visitor to
another URL instead of Tomcat's default 404 error?
Thanks for your time,
Tommy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: virtual directory
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Tommy Pham [mailto:tommyhp2@gmail.com]
> Subject: Re: virtual directory
> I'm still getting the 404 error with this wwwroot.xml:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <Context docBase="D:/wwwroot">
> </Context>
In addition to the questions André asked, one very critical one: where is that wwwroot.xml file located?
- 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 unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: virtual directory
Posted by Tommy Pham <to...@gmail.com>.
On Thu, Mar 21, 2013 at 11:10 AM, André Warnier <aw...@ice-sa.com> wrote:
> Manuel Fernández Panzuela wrote:
>>
>> To publish your wwwdoc directory you must edit sever.xml and look for
>> <Host>
>> tag. Inside this block write a line like::
>>
>> <Context docBase="D:/wwwroot" path="/wwwroot" reloadable="true" />
>>
> Hi.
> Don't top-post.
> And the page which the original poster apparently mis-read, also says (in
> bold) :
>
> It is NOT recommended to place <Context> elements directly in the server.xml
> file.
>
> https://tomcat.apache.org/tomcat-7.0-doc/config/context.html
>
Hi André,
Thanks for the feedback. I'm still getting the 404 error with this wwwroot.xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<Context docBase="D:/wwwroot">
</Context>
And the catalina log shows:Mar 21, 2013 11:46:27 AM
org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
Mar 21, 2013 11:46:27 AM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor
D:\apache-tomcat-7.0.26\conf\Catalina\localhost\wwwroot.xml
Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory D:\apache-tomcat-7.0.26\webapps\docs
Mar 21, 2013 11:46:28 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory
D:\apache-tomcat-7.0.26\webapps\examples
Thanks,
Tommy
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: virtual directory
Posted by André Warnier <aw...@ice-sa.com>.
Manuel Fernández Panzuela wrote:
> To publish your wwwdoc directory you must edit sever.xml and look for <Host>
> tag. Inside this block write a line like::
>
> <Context docBase="D:/wwwroot" path="/wwwroot" reloadable="true" />
>
Hi.
Don't top-post.
And the page which the original poster apparently mis-read, also says (in bold) :
It is NOT recommended to place <Context> elements directly in the server.xml file.
https://tomcat.apache.org/tomcat-7.0-doc/config/context.html
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: virtual directory
Posted by Manuel Fernández Panzuela <ma...@gmail.com>.
To publish your wwwdoc directory you must edit sever.xml and look for <Host>
tag. Inside this block write a line like::
<Context docBase="D:/wwwroot" path="/wwwroot" reloadable="true" />
Don't use "debug" as André says
:)
Un abrazo
2013/3/21 André Warnier <aw...@ice-sa.com>
> Tommy Pham wrote:
>
>> Hi,
>>
>> I'm trying to setup my virtual directory wwwroot as
>> http://localhost/wwwroot/ mapped to d:\wwwroot but I'm getting
>>
>> HTTP Status 404 - /wwwroot/
>>
>> type Status report
>>
>> message /wwwroot/
>>
>> description The requested resource (/wwwroot/) is not available.
>> Apache Tomcat/7.0.26
>>
>>
>>
>> My wwwroot.xml:
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>> <Context path="/wwwroot" docBase="D:/wwwroot" debug="0" privileged="true">
>> </Context>
>>
>> and the localhost log:
>>
>> Mar 21, 2013 10:14:38 AM org.apache.catalina.core.**StandardEngine
>> startInternal
>> INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
>> Mar 21, 2013 10:14:38 AM org.apache.catalina.startup.**HostConfig
>> deployDescriptor
>> INFO: Deploying configuration descriptor
>> D:\apache-tomcat-7.0.26\conf\**Catalina\localhost\wwwroot.xml
>> Mar 21, 2013 10:14:38 AM
>> org.apache.catalina.startup.**SetContextPropertiesRule begin
>> WARNING: [SetContextPropertiesRule]{**Context} Setting property 'debug'
>> to '0' did not find a matching property.
>> Mar 21, 2013 10:14:39 AM org.apache.catalina.util.**SessionIdGenerator
>> createSecureRandom
>> INFO: Creation of SecureRandom instance for session ID generation
>> using [SHA1PRNG] took [145] milliseconds.
>> Mar 21, 2013 10:14:39 AM org.apache.catalina.startup.**HostConfig
>> deployDirectory
>> INFO: Deploying web application directory D:\apache-tomcat-7.0.26\**
>> webapps\docs
>>
>> Did I misread the doc [1]?
>>
>> Thanks,
>> Tommy
>>
>> [1] http://tomcat.apache.org/**tomcat-7.0-doc/config/context.**html<http://tomcat.apache.org/tomcat-7.0-doc/config/context.html>
>>
>>
> Well, you seem to have.
>
> path : This attribute must only be used when statically defining a Context
> in server.xml. In all other circumstances, the path will be inferred from
> the filenames used for either the .xml context file or the docBase.
>
> debug : doesn't exist, as your log messages indicate
>
> privileged : are you sure ?
>
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.**apache.org<us...@tomcat.apache.org>
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
Re: virtual directory
Posted by André Warnier <aw...@ice-sa.com>.
Tommy Pham wrote:
> Hi,
>
> I'm trying to setup my virtual directory wwwroot as
> http://localhost/wwwroot/ mapped to d:\wwwroot but I'm getting
>
> HTTP Status 404 - /wwwroot/
>
> type Status report
>
> message /wwwroot/
>
> description The requested resource (/wwwroot/) is not available.
> Apache Tomcat/7.0.26
>
>
>
> My wwwroot.xml:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <Context path="/wwwroot" docBase="D:/wwwroot" debug="0" privileged="true">
> </Context>
>
> and the localhost log:
>
> Mar 21, 2013 10:14:38 AM org.apache.catalina.core.StandardEngine startInternal
> INFO: Starting Servlet Engine: Apache Tomcat/7.0.26
> Mar 21, 2013 10:14:38 AM org.apache.catalina.startup.HostConfig deployDescriptor
> INFO: Deploying configuration descriptor
> D:\apache-tomcat-7.0.26\conf\Catalina\localhost\wwwroot.xml
> Mar 21, 2013 10:14:38 AM
> org.apache.catalina.startup.SetContextPropertiesRule begin
> WARNING: [SetContextPropertiesRule]{Context} Setting property 'debug'
> to '0' did not find a matching property.
> Mar 21, 2013 10:14:39 AM org.apache.catalina.util.SessionIdGenerator
> createSecureRandom
> INFO: Creation of SecureRandom instance for session ID generation
> using [SHA1PRNG] took [145] milliseconds.
> Mar 21, 2013 10:14:39 AM org.apache.catalina.startup.HostConfig deployDirectory
> INFO: Deploying web application directory D:\apache-tomcat-7.0.26\webapps\docs
>
> Did I misread the doc [1]?
>
> Thanks,
> Tommy
>
> [1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
>
Well, you seem to have.
path : This attribute must only be used when statically defining a Context in server.xml.
In all other circumstances, the path will be inferred from the filenames used for either
the .xml context file or the docBase.
debug : doesn't exist, as your log messages indicate
privileged : are you sure ?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: virtual directory
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Tommy,
On 3/21/13 1:23 PM, Tommy Pham wrote:
> I'm trying to setup my virtual directory wwwroot as
> http://localhost/wwwroot/ mapped to d:\wwwroot but I'm getting
>
> HTTP Status 404 - /wwwroot/
>
> type Status report
>
> message /wwwroot/
>
> description The requested resource (/wwwroot/) is not available.
> Apache Tomcat/7.0.26
>
>
> My wwwroot.xml:
>
> <?xml version="1.0" encoding="ISO-8859-1"?> <Context
> path="/wwwroot" docBase="D:/wwwroot" debug="0" privileged="true">
> </Context>
I would have expected this to work, though you should take André's
suggestions and clean-up that file. What is in D:\wwwroot?
Where did you put wwwroot.xml?
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQIcBAEBCAAGBQJRS1kaAAoJEBzwKT+lPKRYLL0P/0ThqoCuRoep+QJFHsYHdGWS
5QUpzPBXrvG9o1oEdnUJrz1/Y854waF/XzvTNYFKDyeFvkD2M3TV610vwcEB7A2v
/8CPZAuB56084TYU6MbJkwivOkUPBPEphLjrkMavuNYlfVH8Mifp7d4ZwKJ7mwJz
xGly9NeqfzyVjXXxjwn8FGxvlnqLxcZyTwxvleiDnllk7HxXrfx1a9+ELpU8l+A0
Tzmn87hNmNrdpwqfJ8g3EKH/r6bitRYhqDld2Q/agzNDmPLiYwby7HWg3Tmh3gfK
MQkQekYhp3kY48VhrNI1g79+m4Pt0LJQaCElwe+GaYkX3lZLB2TR61EVUG9V31b2
cRcCqgbnBbfYHOREvC+FTb5URUmrXgG9/5NZ/t/EaHSsHlArOWCSSS/g8cDL9NjE
pSDF4elWrclUGHzcPKE9p925/lMRHWDC9NpBf97o+z2SIPzBufeFSZ8AxKHlO6Yj
Ytb0geE3I3hiuSfdYq668gvMV+UA6+fhZ7CZHdSCM9Ul3YSf8xAJQE1B1csghF+0
zHwZTFR3K2dXUwm7InqscmSUh/I+94fBs7m2z6aQ3BuKCF7dZeycROoddu8YJucw
1byxSWRtnIU1FQbzT62Fufbb6y5ycbrw8j/jptJ9XU14I/2l7GDO5Y0aelkrh84n
VUB5SVTZs3Hgevz2k4Of
=YHLS
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org