Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tomcat and apache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
eamonn
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2003
Posts: 118

PostPosted: Fri Mar 04, 2005 5:47 pm    Post subject: tomcat and apache Reply with quote

i have emerged tomcat and i go to http://192.168.70.28:8080/ and it shows tomcat as up. i go to http://192.168.70.28:8080/manager/status and it doesnt work. i get HTTP Status 403 - Access to the requested resource has been denied.


any ideas?


i am very new to tomcat and i have an app that works on a friends tomcat server that i want to use. i have searched the forums and followed a couple of guide and nothing seems to work on my setup. is there any working guides on how to use tomcat and how to use it as an apache2 module please?
Back to top
View user's profile Send private message
marcolovato
n00b
n00b


Joined: 13 Sep 2004
Posts: 39
Location: Porto Alegre/RS/Brasil

PostPosted: Sat Mar 05, 2005 1:13 am    Post subject: Reply with quote

Hi. I think you are going too fast!!!

1) Tomcat is installed and running. Good.
2) Did you create a new context? The "manager" one is used for another purpose... You should create one for your new app.
3) Once did that, you can configure apache to act as a proxy, so your requests go to 80 and apache redirects them internally.
4) ... as an Apache2 module???

You CAN use "manager", but since you are in "learning-mode", you should start by the right way.

Give me more details, and I can provide you some help...

Marco
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Sat Mar 05, 2005 10:42 am    Post subject: Reply with quote

I suggest using mod_jk, ebuild can be found in Bugzilla.
Back to top
View user's profile Send private message
Sorcerer'sApprentice
Tux's lil' helper
Tux's lil' helper


Joined: 15 Jan 2005
Posts: 121
Location: Jesus College, Cambridge, England

PostPosted: Sat Mar 05, 2005 5:43 pm    Post subject: Reply with quote

Have you tried https://192.168.70.28:8080/manager/status ? Maybe it will only let you access admin pages over a secure connection.
_________________
"One of the major problems encountered in time travel is not that of accidentally becoming your own father or mother ... The major problem is quite simply one of grammar..."

Douglas Adams
Back to top
View user's profile Send private message
marcolovato
n00b
n00b


Joined: 13 Sep 2004
Posts: 39
Location: Porto Alegre/RS/Brasil

PostPosted: Mon Mar 07, 2005 2:36 am    Post subject: Reply with quote

j-m wrote:
I suggest using mod_jk, ebuild can be found in Bugzilla.


Yeah. JK works pretty well.
Back to top
View user's profile Send private message
eamonn
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2003
Posts: 118

PostPosted: Mon Mar 07, 2005 10:02 am    Post subject: Reply with quote

i have created the ebuild file as:


touch mod_jk-1.28.8.ebuild

nano -w mod_jk-1.28.8.ebuild

c&p from https://bugs.gentoo.org/attachment.cgi?id=50889&action=view to the file

chmod a+x mod_jk-1.28.8.ebuild

ebuild mod_jk-1.28.8.ebuild install


and i get
Code:

!!! aux_get(): ebuild path for '/mod_jk-1.28.8' not specified:
!!!            None
!!! aux_get(): ebuild path for '/mod_jk-1.28.8' not specified:
!!!            None
Back to top
View user's profile Send private message
moldarion
n00b
n00b


Joined: 07 Mar 2005
Posts: 2
Location: Hamburg, Germany

PostPosted: Mon Mar 07, 2005 10:51 am    Post subject: Re: tomcat and apache Reply with quote

eamonn wrote:
i have emerged tomcat and i go to http://192.168.70.28:8080/ and it shows tomcat as up. i go to http://192.168.70.28:8080/manager/status and it doesnt work. i get HTTP Status 403 - Access to the requested resource has been denied.


The manager application bundled with Tomcat can only be accessed by a user with the role "manager". By default no such user exists (for obvious security reasons), so you'll have to create a new user in /etc/tomcat5/tomcat-users.xml like this:
Code:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="yourunsername" password="yourpassword" roles="manager"/>
</tomcat-users>
Back to top
View user's profile Send private message
j-m
Retired Dev
Retired Dev


Joined: 31 Oct 2004
Posts: 975

PostPosted: Mon Mar 07, 2005 10:53 am    Post subject: Reply with quote

eamonn wrote:
i have created the ebuild file as:


touch mod_jk-1.28.8.ebuild

nano -w mod_jk-1.28.8.ebuild

c&p from https://bugs.gentoo.org/attachment.cgi?id=50889&action=view to the file

chmod a+x mod_jk-1.28.8.ebuild

ebuild mod_jk-1.28.8.ebuild install


Check how to create a custom ebuild at Gentoo Wiki. The way you tried can´t work.
Back to top
View user's profile Send private message
eamonn
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2003
Posts: 118

PostPosted: Mon Mar 07, 2005 11:15 am    Post subject: Reply with quote

i put it in /usr/portage/net-www/

and did

ebuild ....mod_jk-1.2.8.ebuild digest


then

ebuild .......mod_jk-1.2.8.ebuild merge


do i need to patch it with that file and do i need those conf files??
Back to top
View user's profile Send private message
marcolovato
n00b
n00b


Joined: 13 Sep 2004
Posts: 39
Location: Porto Alegre/RS/Brasil

PostPosted: Mon Mar 07, 2005 1:12 pm    Post subject: Reply with quote

I think this is easier...

a) download my mod_jk.conf
b) download my workers.properties
c) edit mod_jk.conf and put it in /etc/apache2/conf
d) edit workers.properties and put it in /etc/apache2/conf
e) Add this line to your apache2.conf
Code:
Include conf/mod_jk.conf

f) download mod_jk.so
g) put this file in /usr/lib/apache2/modules

And it is done.
You have to proper edit those config files to get what you really want.
My configuration adds a /mbweb/ virtual folder to main server, and binds it to 192.168.10.101 (localhost!) on port 8009 (this is default for tomcat)
You can add this to a VirtualHost too... It is very similar.

This works for all distros, including windows (but then you have to download mod_jk.dll instead)

Marco
Back to top
View user's profile Send private message
eamonn
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2003
Posts: 118

PostPosted: Thu Mar 10, 2005 11:01 am    Post subject: Reply with quote

thnx for your help so far

i have tried that and it didnt work

i have gone to the url in my web browser too and get HTTP Status 404 - Servlet is not available


when i go the servlet in the normal way localhost:8080/servletname it still doesnt work. any ideas please??
Back to top
View user's profile Send private message
eamonn
Tux's lil' helper
Tux's lil' helper


Joined: 18 Mar 2003
Posts: 118

PostPosted: Wed Apr 06, 2005 4:01 pm    Post subject: Reply with quote

marcolovato wrote:
I think this is easier...

a) download my mod_jk.conf
b) download my workers.properties
c) edit mod_jk.conf and put it in /etc/apache2/conf
d) edit workers.properties and put it in /etc/apache2/conf
e) Add this line to your apache2.conf
Code:
Include conf/mod_jk.conf

f) download mod_jk.so
g) put this file in /usr/lib/apache2/modules

And it is done.
You have to proper edit those config files to get what you really want.
My configuration adds a /mbweb/ virtual folder to main server, and binds it to 192.168.10.101 (localhost!) on port 8009 (this is default for tomcat)
You can add this to a VirtualHost too... It is very similar.

This works for all distros, including windows (but then you have to download mod_jk.dll instead)

Marco


I got tomcat working.. finally. ebuild didnt work for me!!! but then i did this and it worked first time!! This is a great post! thanks
Back to top
View user's profile Send private message
Zebbeman
n00b
n00b


Joined: 14 Jun 2003
Posts: 69

PostPosted: Tue May 31, 2005 11:07 pm    Post subject: Reply with quote

Great post, thanks!
This may not be related, but does anyone knows how to enable .jsp-pages in apache's web root directory?
This is my config:
Code:

# nano -w /usr/lib/apache2/conf/modules.d/80_mod_jk.conf
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
JkWorkersFile /etc/apache2/conf/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkMount /*.jsp default

And:
Code:

# nano -w /etc/apache2/conf/workers.properties
workers.apache_home=/etc/apache2
workers.tomcat_home=/opt/tomcat5
workers.java_home=/opt/sun-jdk-1.4.2.08
ps=/
worker.list=default
worker.default.type=ajp13
worker.default.host=localhost
worker.default.port=8009
worker.default.lbfactor=50
worker.default.cachesize=10
worker.default.cache_timeout=600
worker.default.socket_keepalive=1
worker.default.reclycle_timeout=300

When I try to access any .jsp like http://localhost/test.jsp it looks in /opt/tomcat5/webapps/ROOT/. I would like to put my .jsp in the same directory as the rest of the web application - is that possible?
Back to top
View user's profile Send private message
cleber
n00b
n00b


Joined: 05 Aug 2003
Posts: 74
Location: São Paulo - Brazil

PostPosted: Fri Jun 10, 2005 3:04 am    Post subject: Re: tomcat and apache Reply with quote

moldarion wrote:
eamonn wrote:
i have emerged tomcat and i go to http://192.168.70.28:8080/ and it shows tomcat as up. i go to http://192.168.70.28:8080/manager/status and it doesnt work. i get HTTP Status 403 - Access to the requested resource has been denied.


The manager application bundled with Tomcat can only be accessed by a user with the role "manager". By default no such user exists (for obvious security reasons), so you'll have to create a new user in /etc/tomcat5/tomcat-users.xml like this:
Code:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
</tomcat-users>


As a mater of fact, you got to have a valid username on there (not on your system, but on the app), so you have to get a user root, as seen:

Code:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager"/>
  <role rolename="admin"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
  <user username="root" password="yourpassword" roles="admin,manager"/>
</tomcat-users>

_________________
Saru mo ki kara ochiru - Japanese proverb.
Cleber Mori Home Page: http://www.2ks.com.br
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum