Virtual hosting oddity
Crossposted to
debian,
apache,
linuxsupport:
I know about LJ complaining about the code here - shouldn't the PRE and CODE tags have protected it?
I have a minor problem with a virtual host on an apache server at our company, and I am sure that someone here will instantly know the solution. In a nutshell, one of the virtual hosts keeps smacking another one. This is from a box running Sarge with Apache 2.0.54. Perhaps showing the configs first would make sense:
debian,
apache,
linuxsupport:I know about LJ complaining about the code here - shouldn't the PRE and CODE tags have protected it?
I have a minor problem with a virtual host on an apache server at our company, and I am sure that someone here will instantly know the solution. In a nutshell, one of the virtual hosts keeps smacking another one. This is from a box running Sarge with Apache 2.0.54. Perhaps showing the configs first would make sense:
File: /etc/apache2/sites-enabled/000-default
NameVirtualHost *
[Error: Irreparable invalid markup ('<virtualhost *>') in entry. Owner must fix manually. Raw contents below.]
<b>Crossposted to <lj user="debian">, <lj user="apache">, <lj user="linuxsupport">:</b>
<b><em>I know about LJ complaining about the code here - shouldn't the PRE and CODE tags have protected it?</em></b>
I have a minor problem with a virtual host on an apache server at our company, and I am sure that someone here will instantly know the solution. In a nutshell, one of the virtual hosts keeps smacking another one. This is from a box running Sarge with Apache 2.0.54. Perhaps showing the configs first would make sense:
<lj-cut>
<pre><code>
File: /etc/apache2/sites-enabled/000-default
NameVirtualHost *
<VirtualHost *>
ServerAdmin feedback@somewhere.com
ServerName genesis
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
snip
File /etc/apache2/sites-enabled/ace.conf:
NameVirtualHost ace:443
<VirtualHost ace:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/ace.pem
DocumentRoot /var/www/ace
ServerName ace
LogLevel Error
<Directory /var/www/ace>
snip
File /etc/apache2/sites-enabled/ventura.conf
NameVirtualHost ventura:443
<VirtualHost ventura:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/ventura.pem
DocumentRoot /var/www/ventura
ServerName ventura
LogLevel error
<Directory /var/www/ventura>
snip
</code></pre>
Everything works fine until I add this file:
<pre><code>
NameVirtualHost ventura:80
<VirtualHost ventura:80>
ServerName ventura:80
LogLevel Error
Redirect / https://ventura/
</VirtualHost>
</code></pre>
</code></pre>
</lj-cut>
Once Apache reloads, the ventura host takes over anything on port 80, so while it does indeed redirect to https://ventura, I can no longer get to the default site. https://ventura and https://ace are both working fine. I have checked all the usual suspects (name resolution, apache logs, changing lots of stuff in the config files) but am coming up with nothing. Does anyone know what stupid thing I have done wrong?
<b><em>I know about LJ complaining about the code here - shouldn't the PRE and CODE tags have protected it?</em></b>
I have a minor problem with a virtual host on an apache server at our company, and I am sure that someone here will instantly know the solution. In a nutshell, one of the virtual hosts keeps smacking another one. This is from a box running Sarge with Apache 2.0.54. Perhaps showing the configs first would make sense:
<lj-cut>
<pre><code>
File: /etc/apache2/sites-enabled/000-default
NameVirtualHost *
<VirtualHost *>
ServerAdmin feedback@somewhere.com
ServerName genesis
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
snip
File /etc/apache2/sites-enabled/ace.conf:
NameVirtualHost ace:443
<VirtualHost ace:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/ace.pem
DocumentRoot /var/www/ace
ServerName ace
LogLevel Error
<Directory /var/www/ace>
snip
File /etc/apache2/sites-enabled/ventura.conf
NameVirtualHost ventura:443
<VirtualHost ventura:443>
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/ventura.pem
DocumentRoot /var/www/ventura
ServerName ventura
LogLevel error
<Directory /var/www/ventura>
snip
</code></pre>
Everything works fine until I add this file:
<pre><code>
NameVirtualHost ventura:80
<VirtualHost ventura:80>
ServerName ventura:80
LogLevel Error
Redirect / https://ventura/
</VirtualHost>
</code></pre>
</code></pre>
</lj-cut>
Once Apache reloads, the ventura host takes over anything on port 80, so while it does indeed redirect to https://ventura, I can no longer get to the default site. https://ventura and https://ace are both working fine. I have checked all the usual suspects (name resolution, apache logs, changing lots of stuff in the config files) but am coming up with nothing. Does anyone know what stupid thing I have done wrong?