Port Used For The Virtualhost Is Not An Apache Listen Port

By | June 4, 2022
Ad

If the Listen directive specifies just one port number, then Apache listens to that one port across all interfaces. If an IP address is given, along with a port, then the server listens to the given port and the interface. The Listen directive instructs Apache to only accept incoming requests on the given port, or on an address-port combination.

BindAddress is used to limit a server to listening at one address, and it can be used to allow multiple Apache servers on a single machine to listen at different IP addresses. The one thing that this setup does not really work on is when you are serving different content, depending on the differing IP addresses or ports. This is a configuration that you will want to use for pretty much any situation where the VM is named. Note that creating a virtual hosting configuration on an Apache server does not magically result in DNS entries being created for these host names.

Edit any non-SSL virtual host files within the installdir/apache2/conf/vhosts/ directory, and edit values specified by the VirtualHost directive. Edit the installdir/apache2/conf/httpd.conf file and modify the value specified in the Port directive. If you also want to keep your SSL port free, use the “Change Apache SSL port” parameter and change it to something other than 443. Either delete the software and release the port, or change the port on your Apache servers from 80 to something else that does not interfere with any other software.

Ad

Here, we will show how to figure out what may be using port 80 on your machine, and what to do if you need to change port 80 to something else in the software of Apache server. A few months ago, I ran into a situation where I needed to set up my personal site running Apache to use more ports. When setting up a local Web Server, an issue that can prevent it from running is that anything else can be using system ports which are required for Apache to work.

Listen When Apache starts, Apache connects to a few ports and addresses on your local computer and waits for requests. The server machine can be made to answer both internal and external requests with the same content, using only one section of the VirtualHost. The Apache configuration entries can be right, but the server will lack SSL-module support. The server will accept connections over port 443 only when the firewall allows the incoming traffic as well. If servers are listening correctly on port 443, that means that problem is in the network firewall.

When firewall programs such as UFW blocks access on port, we need to run ufw allow 443, which fixes underlying issue. In a nutshell, the common reasons why Apache was not listening on port 443 included incorrect configuration settings, network firewalls, etc. Today, let us take a look at how the engineers at Bobcares fixed port 443 connectivity and made the protected websites working again. Upon inspection, Bobcare was able to see that /etc/apache2/ports.conf had one additional Listen on 443 entry.

In this case, process is Skype.exe, with this information, we could try to get Skype to use a different port, and have our Apache server use port 80 instead. You could also simply swap out the old port number for the alternative if you do not want your site to be available on two ports. Fortunately, you can fix this problem fast just by changing the port numbers, rather than disabling or removing any services.

If you are going to place servers in their own ports, you should not define namedVirtualHosts on these ports. The default virtualhost will never service a request sent to the address/port used by the named virtualhost. Using default_vhost_default_vhost on all ports captures any request that is sent to an unspecified IP address and port, i.e., to an address/port combination not used by any other virtual hosts.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Ad