curl -I(大写i)选项查看响应头部信息,试试:??





- 选择一个版本下载即可,把压缩包解压到自己想放的位置将httpd.exe位置配置进系统环境变量
(在conf文件夹里)配置httpd.conf文件

修改端口
httpd -t //测试配置是否合法如果出现”AH00558: httpd: Could not reliably determine the server's fully qualified domain name.......”的报错,则继续配置httpd.conf文件
修改"#ServerName www.example.com:80"为"ServerName localhost:80"
httpd -k install -n Apache2.4 //其中-n后的参数是自定义安装的服务名成功显示如下,Errors是正常提示
PS:如果443端口被占用需要同时修改httpd.conf以及httpd-ssl.conf中所有443为442
出现问题先移除服务再重试
httpd -k uninstallhttpd -k start -n Apache2.4打开网页http://localhost:90/index.html(端口根据自己设置的填写)
指路:https://www.php.cn/apache/427478.html
在tomcat官网下载一个压缩包版本,解压成两个文件夹tomcat1和tomcat2
在tomcat1的目录下打开tomcat1/conf/server.xml,修改HTTP/1.1端口号为:8081,修改AJP
<Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <Connector protocol="AJP/1.3" port="8009" redirectPort="8443" /> 在tomcat1的目录下打开tomcat2/conf/server.xml,修改HTTP/1.1端口号为:8082,修改AJP,修改server port为8006
<Connector port="8082" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8444" /><Connector protocol="AJP/1.3" port="8010" redirectPort="8444" />修改一下tomcat/conf/logging.properties,把编码改成GBK,防止乱码
点击bin/startup.bat启动服务,查看http://localhost:8081,启动成功。
此时可以替换两个tomcat中webapps的index文件改为自己的index.html 如下
http://localhost:8081/sample1/index.html
http://localhost:8082/sample2/index.html
mod_jk模块,Apache与tomcat集成是能够经过AJP协议也能够经过HTTP协议,能够使用mod_jk(AJP)和mod_proxy+mod_proxy_ajp(AJP)集成也能够使用mod_proxy+mod_proxy_http(HTTP),这里使用是mod_proxy+mod_proxy_http。
Apache本身并没有mod_jk.so,是由tomcat提供的,
mod_jk.so下载地址[http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/],根据自身apache版本找一个放在modules下面。
接下来修改httpd.conf,加载mod_proxy.so、mod_proxy_http.so模块前去掉#
在httpd.conf最后,脱离结束括号后的下一行,加入下面内容:(需要根据自己前面配置内容修改)
ProxyPass "/sample1" "http://localhost:8081/sample1"ProxyPassReverse "/sample1" "http://localhost:8081/sample1"ProxyPass "/sample2" "http://localhost:8082/sample2"ProxyPassReverse "/sample2" "http://localhost:8082/sample2"(http://localhost:90/sample2/)
(http://localhost:90/sample1/)

(学习原文:https://blog.csdn.net/weixin_34367257/article/details/91829500 )