简体   繁体   English

更改端口后,Apache命名的虚拟主机不起作用

[英]Apache named virtual host not working after changing port

I have a jboss server and an apache web server on the same machine. 我在同一台机器上有一个jboss服务器和一个Apache Web服务器。 Jboss has to stay listening on port 80, so I had to switch which port apache listened on. Jboss必须继续监听端口80,因此我不得不切换监听哪个端口apache。 Before, when it was listening on port 80, everything worked fine. 以前,当它在端口80上侦听时,一切正常。 I set up a virtual host for a website I'm working on, and I was able to use the URL for that site as a I defined it in the virtual host file and my hosts file (I'm using Windows). 我为正在处理的网站设置了虚拟主机,并且能够使用该站点的URL,因为我在虚拟主机文件和主机文件(我使用Windows)中定义了该URL。 After I changed the port it listened on, I get the following error: 更改监听端口后,出现以下错误:

Problem loading page: Unable to connect 问题加载页面:无法连接

I've restarted the server, restarted my machine, changed the port to several different numbers that weren't being used for anything else, and I even tried changing the localhost IP address from 127.0.0.1 to 127.0.0.2 to see if that would help, but none of this has worked. 我重新启动了服务器,重新启动了机器,将端口更改为其他未使用的其他数字,甚至尝试将localhost IP地址从127.0.0.1更改为127.0.0.2,以查看是否可以帮助,但这些都没有奏效。 I changed the port in both httpd.conf and httpd-vhosts.conf, but nothing has really worked. 我同时更改了httpd.conf和httpd-vhosts.conf中的端口,但没有任何效果。 I checked the IP address for the site with ping, and it showed that I'm using the right one. 我通过ping检查了该站点的IP地址,它表明我使用的是正确的IP地址。 I would really appreciate some help because nothing is working. 我将不胜感激,因为没有任何帮助。

Likely a local firewall issue. 可能是本地防火墙问题。 You should only need to change Listen, ServerName and <virtualhost>. 您只需要更改Listen,ServerName和<virtualhost>。 You can use lsof or netstat to confirm the listening port. 您可以使用lsof或netstat确认监听端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM