Tomcat不会显示包含集群和apache的页面

时间:2015-12-14 14:19:45

标签: java apache tomcat servlets

我正在进行群集配置而且我读了所有内容但是我遇到了一个大问题,我做了所有配置并且我在网上阅读了所有信息,但我还有问题。 我的问题是当我尝试使用时 http://192.168.56.101/examples 它向我显示了带有示例的页面,但是当我点击任何示例,例如Servlet时,我得到错误404,例如当我单击servlet时 http://192.168.56.101/servlets我收到404错误。 如果我按下F5的刷新效果很好,但我使用的任何按钮都会得到404 喜欢它不知道其他页面。 我正在使用Tomcat8附带的示例来测试集群Tomcat8 + Java8 + Apache 2.4+ DEbian 7

有任何线索吗?

2 个答案:

答案 0 :(得分:0)

enter code here


<IfModule jk_module>

JkWorkersFile /etc/apache2/workers.properties

JkLogFile /var/log/apache2/mod_jk.log

# Our JK log level (trace,debug,info,warn,error)
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# Our JK shared memory file
JkShmFile /var/log/apache2/jk-runtime-status

JkWatchdogInterval 60

<Location /jk-status>
    # Inside Location we can omit the URL in JkMount
    JkMount jk-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>
<Location /jk-manager>
    # Inside Location we can omit the URL in JkMount
    JkMount jk-manager
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>

JkMount  /* loadbalancer
</IfModule>

答案 1 :(得分:0)

ps=/
worker.list=jk-status
worker.jk-status.type=status
worker.jk-status.read_only=true

worker.list=jk-manager
worker.jk-manager.type=status

worker.list=loadbalancer

worker.server1.port=8009
worker.server1.host=localhost
worker.server1.type=ajp13
worker.server1.lbfactor=1

worker.server2.port=8010
worker.server2.host=localhost
worker.server2.type=ajp13
worker.server2.lbfactor=1

worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=server1,server2
worker.jkstatus.type=status

----- Virtalhost apache --------

<VirtualHost *:80>

JkMountCopy On

ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>