我需要在Windows 7机器上本地启动tomcat在端口80上的示例应用程序,如下所示:http://localhost:80/examples/
。
我遵循这个伟大而简单的tutorial 并且在尝试任何教程的结果时效果很好:
http://localhost:7000/examples/servlets ,Try Tomcat's servlet examples via Apache
http://localhost:7000/examples/jsp ,Try Tomcat's JSP examples via Apache
http://localhost:7000/examples ,Try Tomcat's examples via Apache
http://localhost:8181/ws ,Access ws from Tomcat directly (ws is a dummy custom app)
http://localhost:7000/ws ,Access ws via Apache
当我从
更改 httpd.conf 文件时收听127.0.0.1:7000 -----> 127.0.0.1:80
localhost:80 works --> apache main page
localhost/examples/ --->it just wont work!!(url not found)
出于某种原因,当httpd被设置为任何其他80端口时,它将与tomcat进行通信,如教程所示,但当端口为80时,它就像拒绝与tomcat联系一样。 为什么?
mod_jk.conf
LoadModule jk_module modules/mod_jk.so
JkWorkersFile C:\apache-tomcat-7.0.8\conf\workers.properties
JkLogFile C:\apache-tomcat-7.0.8\logs\mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"
JkMount /ws ajp13
JkMount /ws/* ajp13
JkMount /examples ajp13
JkMount /examples/* ajp13
server.xml中
<Connector port="8181" protocol="HTTP/1.1" connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
的httpd.conf
Listen localhost:80
include C:\apache-tomcat-7.0.8\conf\mod_jk.conf
error.log中
[Tue Aug 26 22:26:01.599679 2014] [ssl:warn] [pid 1780:tid 548] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 26 22:26:04.984885 2014] [ssl:warn] [pid 1780:tid 548] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 26 22:26:05.000485 2014] [mpm_winnt:notice] [pid 1780:tid 548] AH00455: Apache/2.4.10 (Win32) OpenSSL/1.0.1h mod_jk/1.2.40 configured -- resuming normal operations
[Tue Aug 26 22:26:05.016085 2014] [mpm_winnt:notice] [pid 1780:tid 548] AH00456: Apache Haus VC9 Server built: Jul 15 2014 20:34:18
[Tue Aug 26 22:26:05.016085 2014] [core:notice] [pid 1780:tid 548] AH00094: Command line: 'C:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Tue Aug 26 22:26:06.061287 2014] [mpm_winnt:notice] [pid 1780:tid 548] AH00418: Parent: Created child process 3480
[Tue Aug 26 22:26:09.025292 2014] [ssl:warn] [pid 3480:tid 496] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 26 22:26:09.540093 2014] [ssl:warn] [pid 3480:tid 496] AH01909: localhost:443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 26 22:26:10.413694 2014] [mpm_winnt:notice] [pid 3480:tid 496] AH00354: Child: Starting 64 worker threads.
的access.log
::1 - - [26/Aug/2014:22:58:27 +0300] "GET /examples HTTP/1.1" 404 206
127.0.0.1 - - [26/Aug/2014:23:14:43 +0300] "GET /examples HTTP/1.1" 404 206
mod_jk.log
Tue Aug 26 22:26:01 2014][1780:1784] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cachesize' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:01 2014][1780:1784] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cache_timeout' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:03 2014][1780:1784] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized
[Tue Aug 26 22:26:04 2014][1780:1784] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cachesize' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:04 2014][1780:1784] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cache_timeout' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:05 2014][1780:1784] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized
[Tue Aug 26 22:26:09 2014][3480:3484] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cachesize' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:09 2014][3480:3484] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cache_timeout' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:09 2014][3480:3484] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized
[Tue Aug 26 22:26:09 2014][3480:3484] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cachesize' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:09 2014][3480:3484] [warn] jk_map_validate_property::jk_map.c (419): The attribute 'worker.ajp13.cache_timeout' is deprecated - please check the documentation for the correct replacement.
[Tue Aug 26 22:26:09 2014][3480:3484] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized
catalina_t /吨/ t.log
Αυγ 26, 2014 10:35:44 ΜΜ org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Windows\System32;C:\ant\bin;C:\maven\apache-maven-3.0.4\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ant\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PostgreSQL\9.2\bin;C:\Program Files\PostgreSQL\9.2\lib;;C:\ant\bin;C:\maven\apache-maven-3.0.4\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ant\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PostgreSQL\9.2\bin;C:\Program Files\PostgreSQL\9.2\lib;;C:\ant\bin;C:\maven\apache-maven-3.0.4\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ant\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PostgreSQL\9.2\bin;C:\Program Files\PostgreSQL\9.2\lib;C:\Users\Papatheodorou\RailsInstaller\Git\cmd;C:\Users\Papatheodorou\RailsInstaller\Ruby1.9.3\bin;c:\jruby-1.7.10\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Program Files\Java\jdk1.7.0_04\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;\;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\Windows\System32;C:\ant\bin;C:\maven\apache-maven-3.0.4\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ant\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PostgreSQL\9.2\bin;C:\Program Files\PostgreSQL\9.2\lib;;C:\ant\bin;C:\maven\apache-maven-3.0.4\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ant\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PostgreSQL\9.2\bin;C:\Program Files\PostgreSQL\9.2\lib;;C:\ant\bin;C:\maven\apache-maven-3.0.4\bin;C:\Program Files (x86)\Windows Live\Shared;C:\ant\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\PostgreSQL\9.2\bin;C:\Program Files\PostgreSQL\9.2\lib;;C:\ant\bin;C:\maven\apache-maven-3.0.4\bin;.
Αυγ 26, 2014 10:35:45 ΜΜ org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8181"]
Αυγ 26, 2014 10:35:45 ΜΜ org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
Αυγ 26, 2014 10:35:45 ΜΜ org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2670 ms
Αυγ 26, 2014 10:35:46 ΜΜ org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Αυγ 26, 2014 10:35:46 ΜΜ org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.8
Αυγ 26, 2014 10:35:46 ΜΜ org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ch08download.xml from C:\apache-tomcat-7.0.8\conf\Catalina\localhost
Αυγ 26, 2014 10:35:46 ΜΜ org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Αυγ 26, 2014 10:35:47 ΜΜ org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
Αυγ 26, 2014 10:35:47 ΜΜ org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory host-manager
Αυγ 26, 2014 10:35:47 ΜΜ org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory manager
Αυγ 26, 2014 10:35:47 ΜΜ org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Αυγ 26, 2014 10:35:48 ΜΜ org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory temp
Αυγ 26, 2014 10:35:48 ΜΜ org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8181"]
Αυγ 26, 2014 10:35:48 ΜΜ org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
Αυγ 26, 2014 10:35:48 ΜΜ org.apache.catalina.startup.Catalina start
INFO: Server startup in 2265 ms
答案 0 :(得分:0)
问题出在我从以下网址下载的apache发行版:http://www.apachehaus.com/cgi-bin/download.plx。该版本是Apache 2.4.10。我从appache的官方网站安装了所有东西,一切都像魅力一样:)