Environment
- Ubuntu 12.10
- Apache 2.2.22
Background
I'm using name-based virtual hosting. During some point in the setup I added a port 5001 to the virtual hosts list, and successfully accessed the site with this port in the url. I later removed this from the virtual hosts list, and opted for accessing the site based on the ServerAlias directive and using the same port. The list now looks like this:
<VirtualHost *:80>
ServerAdmin webmaster@example1
DocumentRoot /home/example1/public_html
Servername example1.org
ServerAlias *.example1.org
ServerAlias example1.org
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@example2
DocumentRoot /home/example2/public_html
ServerName example2.com
ServerAlias *.example2.com
ServerAlias example2.com
</VirtualHost>
Problem
Despite removing port 5001 from the virtual host list and restarting Apache numerous times, visiting the site www.example2.com results in a redirect to www.example2.com:5001. What I would like is for Apache to know which root folder to go to based on the ServerAlias only. However, it seems Apache is saving this port and redirecting the URL to the same URL plus port 5001.
I've tried clearing the cache on my client, and I've tried accessing this site from different devices all with the same result.
Question
- What are some reasons that Apache would save a previous virtual host configuration?
- Is there a cache that can be cleared in Apache?