Traditionally,we use tomcat which is a container as server to parse servlet and jsp,but as we know,apache can handle some staticl pages like html,shtml faster than tomcat,so usually we use them together for our website,but there is another configuration which is normally used by apache without tomcat,can we use them all together for our website?to be honest,I think you can,here is the configration about apache:
(1)apache with tomcat:# BEGIN This is for tomcat server
# load the jk_mode
LoadModule jk_module modules/mod_jk-1.2.26-httpd-2.2.4.so
# set the configure file for jk
JkWorkersFile conf/workers.properties
# Where to put jk shared memory
# Update this path to match your local state directory or logs directory
#JkShmFile /var/log/httpd/mod_jk.shm
# Where to put jk logs
# Update this path to match your logs directory location (put mod_jk.log next to access_log)
JkLogFile logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel info
# Select the timestamp log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# set the forward
JkMount /*.jsp worker1
JkMount /*.do worker1
# Alias EarthData
Alias /vc_EarthMap/ "/usr/virtualchina/EarthData/"
Alias /vc_Model/ "/usr/virtualchina/data/"
Alias /vc_Texture/ "/usr/virtualchina/data/"
Alias /vc_File/sohu/ "/usr/virtualchina/sohu/"
Alias /v/ "E:/WebApp/virtualchina/webapp/"
# Alias the root dir to /
#JkAutoAlias "C:/Program Files/apache-tomcat-6.0.14/webapps/ROOT"
#JkMount /* worker1
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options FollowSymLinks
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
#
# Controls who can get stuff from this server.
#
Order allow,deny
allow from all
Options FollowSymLinks
AllowOverride None
Order allow,deny
allow from all
# protect the WEB-INF dir
AllowOverride None
Order deny,allow
Deny from all
AllowOverride None
Order deny,allow
Deny from all
# END
#put this to the beginning of the httpd.conf
(2)enable ssi:
remove the comments for these two lines:
# AddType text/html .shtml
# AddOutputFilter INCLUDES .shtml
changed to be:
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
add "Includes" to the end of this line
Options Indexes FollowSymLinks
to be
Options Indexes FollowSymLinks Includes
(3)add a file named workers.properties under apache2.2\conf ,the content is:
# 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
tomcat:
(1)
Rename $CATALINA_BASE/server/lib/servlets-ssi.renametojar to $CATALINA_BASE/server/lib/servlets-ssi.jar.
(2)
To use the SSI servlet, remove the XML comments from around the SSI servlet and servlet-mapping configuration in $CATALINA_BASE/conf/web.xml.
(3)
To use the SSI filter, remove the XML comments from around the SSI filter and filter-mapping configuration in $CATALINA_BASE/conf/web.xml
(4)open the $CATALINA_BASE/conf/context.xml
add a property for the first line
that is all the steps I did,hope it can help you,cheers!
所有特殊符号
-
░ ▒ ▬ ♦ ◊ ◦ ♠ ♣ ▣ ۰•● ❤ ●•۰
► ◄ ▧ ▨ ♨ ◐ ◑ ↔ ↕ ▪ ▫ ☼ ♦
♧♡♂♀♠♣♥❤☜☞☎☏⊙◎ ☺☻☼▧▨♨◐◑↔↕▪ ▒ ◊◦▣▤▥ ▦▩◘ ◈◇♬♪♩♭♪の★☆→あぃ£Ю〓§♤♥▶¤๑⊹⊱⋛⋌⋚⊰⊹
≈ ๑۩۩.. ..۩۩๑ ๑۩۞۩๑ ✲ ❈ ✿ ✲ ❈ ➹ ...
16 years ago
No comments:
Post a Comment