I have a standard Apache/2.4.7 setup on Ubuntu 14.04.3 LTS. It has a few virtual hosts.
I changed from an old config for this virtual host to a new one by
a2ensite the new and
a2dissite the old. The contents aren't important but I'll include them for completeness:
old-thing.conf did a redirect
<VirtualHost *:80> ServerName thing.mysite.com Redirect permanent / http://otherthing.mysite.com/ <Location /> Order allow,deny Allow from all </Location> </VirtualHost>
new-thing.conf does a reverse proxy
<VirtualHost *:80> ServerName thing.mysite.com ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass / http://123.123.123:80/ ProxyPassReverse / http://123.123.123:80/ <Location /> Order allow,deny Allow from all </Location> </VirtualHost>
I have restarted Apache. When I run
apachectl -S I see:
port 80 namevhost thing.mysite.com (/etc/apache2/sites-enabled/new-thing.conf:1)
This tells me that Apache is using the new configuration file. But when I fetch the domain I see the redirect as it was specified in
$ curl -v http://thing.mysite.com > GET / HTTP/1.1 > User-Agent: curl/7.35.0 > Host: thing.mysite.com > Accept: */* > < HTTP/1.1 301 Moved Permanently < Date: Wed, 23 Mar 2016 18:36:34 GMT * Server Apache/2.4.7 (Ubuntu) is not blacklisted < Server: Apache/2.4.7 (Ubuntu) < Location: http://thing.mysite.com/ < Content-Length: 329 < Content-Type: text/html; charset=iso-8859-1 < < etc...
I am puzzled. The old config is long gone. I have restarted Apache and there is no cache in the client as I'm using curl. There is another test virtualhost (shown by
apache -S) which is also not recognised. Something weird is going on. Could it somehow be caching the old config?
I do not understand how it can be using the old configuration.