[root@l6ocalhost webapps]# rpm -qa | grep
tomcat
tomcat6-el-2.1-api-6.0.24-90.el6.x86_64
tomcat6-webapps-6.0.24-90.el6.x86_64
tomcat6-6.0.24-90.el6.x86_64
tomcat6-servlet-2.5-api-6.0.24-90.el6.x86_64
tomcat6-admin-webapps-6.0.24-90.el6.x86_64
tomcat6-jsp-2.1-api-6.0.24-90.el6.x86_64
tomcatjss-2.1.0-3.el6.noarch
apache-tomcat-apis-0.1-1.el6.noarch
tomcat6-lib-6.0.24-90.el6.x86_64
vi /etc/tomcat6/tomcat-users.xml
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="role1"/>
<user username="tomcat" password="tomcat"
roles="tomcat"/>
<user username="both" password="tomcat"
roles="tomcat,role1"/>
<user username="role1" password="tomcat"
roles="role1"/>
<!-- The host manager webapp is
restricted to users with role "admin" -->
<user
name="tomcat" password="password" roles="admin"
/>
<!-- The manager webapp is restricted to
users with role "manager" -->
<user
name="tomcat" password="password" roles="manager"
/>
</tomcat-users>
[root@localhost ~]# wget
ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/adesso/CentOS_CentOS-6/x86_64/apache2-mod_jk-1.2.37-4.1.x86_64.rpm
--2015-12-22 16:57:35--
ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/adesso/CentOS_CentOS-6/x86_64/apache2-mod_jk-1.2.37-4.1.x86_64.rpm
=> “apache2-mod_jk-1.2.37-4.1.x86_64.rpm”
Resolving ftp.pbone.net... 85.14.85.4
Connecting to
ftp.pbone.net|85.14.85.4|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1)
/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/adesso/CentOS_CentOS-6/x86_64
... done.
==> SIZE
apache2-mod_jk-1.2.37-4.1.x86_64.rpm ... 152920
==> PASV ... done. ==> RETR
apache2-mod_jk-1.2.37-4.1.x86_64.rpm ... done.
Length: 152920 (149K) (unauthoritative)
100%[==============================================================================================================================>]
152,920 53.8K/s in 2.8s
2015-12-22 16:57:42 (53.8 KB/s) -
“apache2-mod_jk-1.2.37-4.1.x86_64.rpm” saved [152920]
[root@localhost ~]# rpm -ivh apache2-mod_jk-1.2.37-4.1.x86_64.rpm
warning:
apache2-mod_jk-1.2.37-4.1.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID
67fb4f35: NOKEY
Preparing... ###########################################
[100%]
1:apache2-mod_jk
########################################### [100%]
[root@localhost ~]# cd /etc/httpd/
alias/
conf/ conf.d/ logs/
modules/ run/
[root@localhost ~]# cd /etc/httpd/modules/
[root@localhost modules]# ls
mod_jk.so
[root@localhost conf]# vi
/etc/httpd/conf/httpd.conf
LoadModule
jk_module modules/mod_jk.so
[root@localhost
conf]# service httpd restart
Stopping httpd:
[ OK ]
Starting httpd: httpd: Could not reliably
determine the server's fully qualified domain name, using localhost.localdomain
for ServerName
[ OK ]
[root@localhost conf]# rpm -ql
tomcat6-webapps
/var/lib/tomcat6/webapps/
[root@localhost conf]# cd
/var/lib/tomcat6/webapps
[root@localhost webapps]# mkdir tomcat-demo
[root@localhost webapps]# mkdir tomcat-demo/helloworld
#vim
tomcat-demo/helloworld/index.jsp
<HTML>
<HEAD>
<TITLE>Hello World</TITLE>
</HEAD>
<BODY>
<H1>Hello World</H1>
Today is: <%= new java.util.Date().toString() %>
</BODY>
</HTML>
[root@localhost webapps]# vi
/etc/tomcat6/server.xml
<Connector
port="8009"protocol="AJP/1.3"redirectPort="8443"
/>
[root@localhost webapps]# vi
/etc/httpd/conf/worker.properties
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
[root@localhost webapps]# vi
/etc/httpd/conf/jk.conf
JkWorkersFile
/etc/httpd/conf/workers.properties
[root@localhost webapps]# service tomcat6
restart
Stopping tomcat6: waiting for processes
7364 to exit
[ OK ]
Starting tomcat6: [
OK ]
server configurat [root@localhost webapps]#
vi /etc/httpd/conf/httpd.conf
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
[FAILED]
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
[root@localhost webapps]# cd
/etc/httpd/conf
conf/
conf.d/
[root@localhost webapps]# cd
/etc/httpd/conf/
httpd.conf jk.conf magic worker.properties
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
[root@localhost webapps]# service httpd
restart
Stopping httpd:
[FAILED]
Starting httpd: httpd: Could not reliably
determine the server's fully qualified domain name, using localhost.localdomain
for ServerName
[ OK ]
[root@localhost webapps]# service httpd
restart
Stopping httpd:
[ OK ]
Starting httpd: httpd: Could not reliably
determine the server's fully qualified domain name, using localhost.localdomain
for ServerName
[ OK ]
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
[root@localhost webapps]# service httpd
restart
Stopping httpd:
[ OK ]
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
[root@localhost webapps]# service httpd
restart
Stopping httpd: [FAILED]
Starting httpd: Syntax error on line 1017
of /etc/httpd/conf/httpd.conf:
JkMount takes 1-2 arguments, A mount point
from a context to a Tomcat worker
[FAILED]
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
[root@localhost webapps]# service httpd
restart
Stopping httpd:
[FAILED]
Starting httpd: Syntax error on line 1017
of /etc/httpd/conf/httpd.conf:
JkMount takes 1-2 arguments, A mount point
from a context to a Tomcat worker
[FAILED]
[root@localhost webapps]# vi
/etc/httpd/conf/httpd.conf
JkWorkersFile
"/etc/httpd/conf/worker.properties"
JkLogFile "/var/log/httpd/mod_jk.log"
JkRequestLogFormat "%w %V %T"
JkOptions +ForwardKeySize
+ForwardURICompat -ForwardDirectories
JkLogLevel info
JkLogStampFormat "[%a %b %d
%H:%M:%S %Y]"
#JkMount
/tomcat-demo worker1 (allow for
all project)
JkMount
/tomcat-demo* worker1
[root@localhost webapps]# service httpd
restart
Stopping httpd:
[FAILED]
Starting httpd: httpd: Could not reliably
determine the server's fully qualified domain name, using localhost.localdomain
for ServerName
[ OK ]
[root@localhost webapps]# service httpd
restart
Stopping httpd:
[ OK ]
Starting httpd: httpd: Could not reliably
determine the server's fully qualified domain name, using localhost.localdomain
for ServerName
[ OK ]
[root@localhost webapps]#
http://192.168.190.157/tomcat-demo/helloworld/index.jsp
Hello World
Today is: Tue
Dec 22 17:42:16 IST 2015
http://192.168.190.157:8080/tomcat-demo/helloworld/index.jsp
Hello World
Today is: Tue
Dec 22 18:03:04 IST 2015
Comments
Post a Comment