tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Abhilash V. Sonwane" <abhil...@elitecore.com>
Subject RE: How can I place servlets in a directory different from tomcat/webapps?
Date Thu, 07 Sep 2000 12:49:34 GMT
In the error log I keep getting messages like this:
[Wed Sep 06 14:53:13 2000] [error] [client 192.168.0.231] File does not
exist: c:/bb_projekt/byg/servlets/bygsetupservlet

Well the file does not exist but the file

c:\bb_projekt\byg\servlets\bygsetupservlet exists

got it
replace / with \ for windows file path separator




-----Original Message-----
From: MBP [mailto:mbp@back-bone.dk]
Sent: Wednesday, September 06, 2000 8:47 PM
To: tomcat-user@jakarta.apache.org
Subject: How can I place servlets in a directory different from
tomcat/webapps?


Hi
I know several people has asked about this before, but all the threads seem
to end before a clear answer emerges. At least they never get clear enough
for me to understand.

Problem:
I would like to place my servlets in C:\bb_projekt\byg\servlets
html files, images etc. go in C:\bb_projekt\byg\htdocs

Attempts:
After getting myself confused reading Tomcat's User guide, Tomcat
Minimalistic User Guide, part of Servlet specifications and an uncounted
number of mails in mailing lists, I now know I have to edit server.xml,
httpd.conf, tomcat-apache.conf and possibly web.xml.

In httpd.conf I add a virtual server:

NameVirtualHost 192.168.0.231:80
<VirtualHost 192.168.0.231>
    ServerAdmin mbp@bb.dk
    DocumentRoot /bb_projekt/byg/htdocs
    ServerName mbp.byg.int

    <Directory />
       Options FollowSymLinks
       AllowOverride None
    </Directory>
    <Directory "C:/bb_projekt/byg/htdocs">
       Options Indexes FollowSymLinks MultiViews
       AllowOverride None
       Order allow,deny
       Allow from all
    </Directory>

    ScriptAlias /cgi-bin/ "C:/bb_projekt/byg/cgi-bin/"

    <Directory "C:/bb_projekt/byg/cgi-bin">
       AllowOverride None
       Options None
    </Directory>

    ErrorLog logs/byg_error.log
    CustomLog logs/byg_access.log common

</VirtualHost>


In Tomcat-apache.conf I copy one of the example mappings and edit it:

### Byg servlets mapping
Alias /byg "C:/bb_projekt/byg"
<Directory "C:/bb_projekt/byg">
    Options Indexes FollowSymLinks
</Directory>
ApJServMount /byg/servlets  /byg
<Location /byg/servlets/ >
    AllowOverride None
    deny from all
</Location>


In server.xml I add a new context:

        <Context path="/byg" docBase="c:/bb_projekt/byg/servlets" debug="0"
reloadable="true" >
        </Context>

In C:\bb_projekt\byg\servlets there is a bygsetupservlet.class



What works:
The virtual host is working fine.
I can run Tomcat HelloWorldExample servlet in both Tomcat and thru Apache
I can run my own servlet thru Apache if I place it in the Tomcat examples
directory


What doesn't work:
Any servlet placed in c:\bb_projekt\byg\servlets
In the error log I keep getting messages like this:
[Wed Sep 06 14:53:13 2000] [error] [client 192.168.0.231] File does not
exist: c:/bb_projekt/byg/servlets/bygsetupservlet



So my question is: am I just stupid, have I missed some obscure detail or is
this really hard to get to work?

Whatever the answer to that is, what can I do to get this thing to work?

TIA

Best regards
Michael


Michael Bjerregaard Pedersen, senior software engineer
------------------------------------------------------
Backbone Digital Systems
Ryesgade 19A
DK-2200 Copenhagen N
Tlf. 35 245 245




Mime
View raw message