You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Mansour <ma...@ownmail.net> on 2006/08/28 19:57:55 UTC

Re: configuring mod_jk - can any one help, please ??

I still need help in this, please!!

Mansour wrote:

> Hi every body:
> I 've been trying to get things working, however, I believe I need a 
> little help in this.
> I configured apache' Virtual host. and installed tomcat and mod_jk 
> succefully. Now I am trying to run apache for static contents, and 
> tomcat for *.jsp , therefore, I have put a test page "hello.jsp" in 
> the "root of my virtual host"
> When I point my browser to http://virtualhost I get the static pages 
> I'm expecting.
> same thing with http://virtualhost:8080, I get what I am expecting 
> (tomcat welcome page).  No problem up tp here.
>
> Now when I try to access http://virtualhost/hello.jsp, I get error 
> 404. So I copied hello.jsp to $CATALINA/webapps/ROOT and tried again 
> http://virtualhost/hello.jsp and It worked. Now how do i get around 
> this??  I need to modify the webapp/Root to reflect the content of the 
> virtual host directory. right??
> If yes. what file and modification I have to add to get this working ??
> Thank you
>
>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: configuring mod_jk - can any one help, please ??

Posted by Eric Berry <el...@gmail.com>.
I have a setup on a dev machine that is similiar to what you are
trying. Here's how I have mine setup.

-------httpd.conf
LoadModule              jk_module modules/mod_jk.so
JkWorkersFile           /opt/apps/tomcat/conf/workers.properties
JkLogFile               /opt/apps/tomcat/logs/mod_jk.log
JkLogLevel              info
JkLogStampFormat        "[%a %b %d %H:%M:%S %Y] "

<VirtualHost *:80>
        DocumentRoot /opt/projects/virtualhost/web
        ServerName virtualhost
        JkMount /*.jsp worker1
        JkMount /*.do worker1
</VirtualHost>

-------server.xml
<Host appBase="/opt/projects/virtualhost/web"
        name="virtualhost">
        <Context path="" docBase="/opt/projects/virtualhost/web" />
</Host>

This is just one way to do it, I know there are others. I urge you to
read up some more on the configuration settings.

If you're going to have more than one virtualhost per machine, you'll
most likely want to have multiple instances of tomcat running - check
the RUNNING.txt that comes with your install for more information
regarding this.

Also, check the recent discussions on this mailing list as I know
there was a thread within the last few weeks discussing this type of
configuration.
http://tomcat.apache.org/lists.html
http://marc.theaimsgroup.com/?l=tomcat-user (searchable)

Eric


On 8/28/06, Mansour <ma...@ownmail.net> wrote:
> I just tried what you suggested and it didn't work.
> I replcaed the modified version of server.xml with the original as
> Mladen suggested to deleted the newly added lines.
> Now the server.xml is the default one that came with tomcat.
> What changes you want me to try ??
>
>
>
> Eric Berry wrote:
>
> > From my understanding found here:
> > http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
> >
> > "The Document Base (also known as the Context Root) directory for this
> > web application, or the pathname to the web application archive file
> > (if this web application is being executed directly from the WAR
> > file). You may specify an absolute pathname for this directory or WAR
> > file, or a pathname that is relative to the appBase directory of the
> > owning Host."
> >
> > Since you've declared your host's documents to start in
> > /path/to/virtualhost, and you've said your default context (default
> > meaning there isn't a path specified - path="") starts in webapp1. I
> > would think that you're actually telling tomcat to locate jsps based
> > on this path /path/to/virtualhost/webapp1
> >
> > If this is the case, then I think you should put you hello.jsp in
> > /path/to/virtualhost/webapp1. Someone please correct me if I'm wrong.
> >
> > Eric
> >
> > On 8/28/06, Mansour <ma...@ownmail.net> wrote:
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Learn from the past. Live in the present. Plan for the future.

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


Re: configuring mod_jk - can any one help, please ??

Posted by Mansour <ma...@ownmail.net>.
I just tried what you suggested and it didn't work.
I replcaed the modified version of server.xml with the original as 
Mladen suggested to deleted the newly added lines.
Now the server.xml is the default one that came with tomcat.
What changes you want me to try ??



Eric Berry wrote:

> From my understanding found here:
> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>
> "The Document Base (also known as the Context Root) directory for this
> web application, or the pathname to the web application archive file
> (if this web application is being executed directly from the WAR
> file). You may specify an absolute pathname for this directory or WAR
> file, or a pathname that is relative to the appBase directory of the
> owning Host."
>
> Since you've declared your host's documents to start in
> /path/to/virtualhost, and you've said your default context (default
> meaning there isn't a path specified - path="") starts in webapp1. I
> would think that you're actually telling tomcat to locate jsps based
> on this path /path/to/virtualhost/webapp1
>
> If this is the case, then I think you should put you hello.jsp in
> /path/to/virtualhost/webapp1. Someone please correct me if I'm wrong.
>
> Eric
>
> On 8/28/06, Mansour <ma...@ownmail.net> wrote:


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


Re: configuring mod_jk - can any one help, please ??

Posted by Eric Berry <el...@gmail.com>.
>From my understanding found here:
http://tomcat.apache.org/tomcat-5.5-doc/config/context.html

"The Document Base (also known as the Context Root) directory for this
web application, or the pathname to the web application archive file
(if this web application is being executed directly from the WAR
file). You may specify an absolute pathname for this directory or WAR
file, or a pathname that is relative to the appBase directory of the
owning Host."

Since you've declared your host's documents to start in
/path/to/virtualhost, and you've said your default context (default
meaning there isn't a path specified - path="") starts in webapp1. I
would think that you're actually telling tomcat to locate jsps based
on this path /path/to/virtualhost/webapp1

If this is the case, then I think you should put you hello.jsp in
/path/to/virtualhost/webapp1. Someone please correct me if I'm wrong.

Eric

On 8/28/06, Mansour <ma...@ownmail.net> wrote:
> Mladen Turk wrote:
>
> > Mansour wrote:
> >
> >>
> Now I removed these lines and deleted the auto created file
> /etc/httpd/conf.d/mod_jk.conf
>
> >>
> >> And I added to server.xml these lines
> >>
> >> <Host name="virtualhost" appBase="/path/to/virtualhost">
> >> <Context path="" docBase="webapp1" debug="0"/>
> >> </Host>
> >>
> >> the file mod_jk.conf is generated automatically:
> >>
> >
> Yes I can access any file in the root directory of my virtual host
>
> > You don't need that. Remove any autoconf generation
> > directives. You need only to map the *.jsp, right?
> >
> >>
> >> Now, pointing my browser to http://virtualhost/hello.jsp gives error
> >> 404.
> >> What did I do wrong ?? and what other files I have to edit. Please I
> >> really need help in this??
> >>
> >
> > I suppose you have your 'virtualhost' defined inside httpd.conf
> > as well.
> > Can you access http://virtualhost/index.html ?
> >
> > Regards,
> > Mladen.
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Learn from the past. Live in the present. Plan for the future.

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


Re: configuring mod_jk - can any one help, please ??

Posted by Mansour <ma...@ownmail.net>.
Mladen Turk wrote:

> Mansour wrote:
>
>>
Now I removed these lines and deleted the auto created file 
/etc/httpd/conf.d/mod_jk.conf

>>
>> And I added to server.xml these lines
>>
>> <Host name="virtualhost" appBase="/path/to/virtualhost">
>> <Context path="" docBase="webapp1" debug="0"/>
>> </Host>
>>
>> the file mod_jk.conf is generated automatically:
>>
>
Yes I can access any file in the root directory of my virtual host

> You don't need that. Remove any autoconf generation
> directives. You need only to map the *.jsp, right?
>
>>
>> Now, pointing my browser to http://virtualhost/hello.jsp gives error 
>> 404.
>> What did I do wrong ?? and what other files I have to edit. Please I 
>> really need help in this??
>>
>
> I suppose you have your 'virtualhost' defined inside httpd.conf
> as well.
> Can you access http://virtualhost/index.html ?
>
> Regards,
> Mladen.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: configuring mod_jk - can any one help, please ??

Posted by Mladen Turk <ml...@jboss.com>.
Mansour wrote:
> 
> 
> And I added to server.xml these lines
> 
> <Host name="virtualhost" appBase="/path/to/virtualhost">
> <Context path="" docBase="webapp1" debug="0"/>
> </Host>
> 
> the file mod_jk.conf is generated automatically:
>

You don't need that. Remove any autoconf generation
directives. You need only to map the *.jsp, right?

> 
> Now, pointing my browser to http://virtualhost/hello.jsp gives error 404.
> What did I do wrong ?? and what other files I have to edit. Please I 
> really need help in this??
>

I suppose you have your 'virtualhost' defined inside httpd.conf
as well.
Can you access http://virtualhost/index.html ?

Regards,
Mladen.

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


Re: configuring mod_jk - can any one help, please ??

Posted by Mansour <ma...@ownmail.net>.
Thank you for writing me back:
Here's some of my code. It shows what I have doen so far.

I have added this to my httpd.conf:
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkRequestLogFormat "%w %V %T"
JkMount /*.jsp worker1

Here's my workers.properties:
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009


And I added to server.xml these lines

<Host name="virtualhost" appBase="/path/to/virtualhost">
<Context path="" docBase="webapp1" debug="0"/>
</Host>

the file mod_jk.conf is generated automatically:

JkWorkersFile "/etc/httpd/conf/workers.properties"
JkLogFile "/etc/httpd/logs/mod_jk.log"
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

Now, pointing my browser to http://virtualhost/hello.jsp gives error 404.
What did I do wrong ?? and what other files I have to edit. Please I 
really need help in this??


Mladen Turk wrote:

> Mansour wrote:
>
>> I still need help in this, please!!
>>
>
> Nobody can help you unless you post some
> configuration you are using.
>
> The tip is to use JkUnMount *.jsp worker
> for static content mime types.
>
> Regards,
> Mladen.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: configuring mod_jk - can any one help, please ??

Posted by Mladen Turk <ml...@jboss.com>.
Mansour wrote:
> I still need help in this, please!!
>

Nobody can help you unless you post some
configuration you are using.

The tip is to use JkUnMount *.jsp worker
for static content mime types.

Regards,
Mladen.

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