As said in the title, I discovered yesterday that all my virtual hosts are redirected to the last (alphabetically, if it matters) virtual host.
I have been checking, and did not see any changes made recently to the different .conf
files, and I do NOT use .htaccess
I am on Ubuntu. Everything looks right in my settings. Like I said, I did not change anything lately there.
I just noticed that on the last apt-get upgrade
(or apt-get dist-upgrade
) there was a question about updating some configuration in Apache2. I asked to see the comparison, did not looks like anything regarding Virtual hosts, so I said OK.
Anybody has an idea where I should look at, or, how could I roll back that very recent Apache upgrade?
Thanks for your help, I am puzzled by this one.
Here is an example:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName ecritsduchateau.fr
ServerAlias www.ecritsduchateau.fr
DocumentRoot /var/www/ecritsduchateau/public_html
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/ecrits_du_chateau_error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/ecrits_du_chateau_access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
I have been checking with Fiddler, to see if it would give me some hints. Here is the raw answer:
HTTP/1.1 301 Moved Permanently
Date: Thu, 21 Apr 2016 17:59:26 GMT
Server: Apache/2.4.20 (Ubuntu)
X-Pingback: http://lebearcnc.com/xmlrpc.php
Location: http://lebearcnc.com/
Content-Length: 0
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/html; charset=UTF-8
If it helps you to see a reason, great, as it does not help me much.... :-)
/etc/apache2/apache2.conf
, is there a line at the end withIncludeOptional sites-enabled/*.conf
? Also when you accessecritsduchateau.fr
, does an entry get logged in the${APACHE_LOG_DIR}/ecrits_du_chateau_access.log
log file (I recommend runningcurl ecritsduchateau.fr
to test this, as your browser might have cached the 301 redirect already)?IncludeOptional sites-enabled/*.conf
is there, but the only access log file modified is the one forlebearcnc.com
.ecrits_du_chateau_access.log
, this means that the virtual host is not being loaded at all. Make sure that the site is enabledsudo a2ensite ecritsduchateau
and the restart apache.