<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    <title>Daniel Lange's blog (Entries tagged as apache)</title>
    <link>http://daniel-lange.com/</link>
    <description>Life, IT, Managers, Cars...</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5.3 - http://www.s9y.org/</generator>
    <pubDate>Wed, 02 Sep 2009 11:53:32 GMT</pubDate>

    <image>
        <url>http://daniel-lange.com/templates/bulletproof/img/s9y_banner_small.png</url>
        <title>RSS: Daniel Lange's blog - Life, IT, Managers, Cars...</title>
        <link>http://daniel-lange.com/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Multiple Apache VHosts on the same IP and port</title>
    <link>http://daniel-lange.com/archives/2-Multiple-Apache-VHosts-on-the-same-IP-and-port.html</link>
            <category>Apache</category>
    
    <comments>http://daniel-lange.com/archives/2-Multiple-Apache-VHosts-on-the-same-IP-and-port.html#comments</comments>
    <wfw:comment>http://daniel-lange.com/wfwcomment.php?cid=2</wfw:comment>

    <slash:comments>7</slash:comments>
    <wfw:commentRss>http://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=2</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;I just learned yesterday again, what I knew a few years ago, but since had forgotten:&lt;/p&gt;

&lt;p&gt;You cannot put multiple SSL-enabled virtual Apache hosts onto the same IP and port.&lt;/p&gt;

&lt;p&gt;Apache cannot identify which VirtualHost to serve a request from because the payload is encrypted in its entirety. So a&lt;/p&gt;

&lt;pre&gt;Host: servertwo.tld&lt;/pre&gt;

&lt;p&gt;header cannot be parsed until the encryption has been removed. Which requires the key, which is listed in the VHost section that could not be identified in the first place...
So a name-based VirtualHost-configuration like this won&#039;t work:&lt;/p&gt;

&lt;div class=&quot;apache geshi&quot; style=&quot;text-align: left&quot;&gt;&lt;ol&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #00007f;&quot;&gt;Listen&lt;/span&gt; &lt;span style=&quot;color: #ff0000;&quot;&gt;443&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&lt;span style=&quot;color: #00007f;&quot;&gt;NameVirtualHost&lt;/span&gt; *:&lt;span style=&quot;color: #ff0000;&quot;&gt;443&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight:bold;&quot;&gt;virtualhost&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;SSLEngine &lt;span style=&quot;color: #0000ff;&quot;&gt;On&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #00007f;&quot;&gt;ServerName&lt;/span&gt; serverone.tld:&lt;span style=&quot;color: #ff0000;&quot;&gt;443&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;SSLCertificateFile /etc/apache2/ssl/serverone.crt&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;SSLCertificateKeyFile /etc/apache2/ssl/serverone.key&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;[...]&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;lt;/&lt;span style=&quot;color: #000000; font-weight:bold;&quot;&gt;virtualhost&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;lt;&lt;span style=&quot;color: #000000; font-weight:bold;&quot;&gt;virtualhost&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;SSLEngine &lt;span style=&quot;color: #0000ff;&quot;&gt;On&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;&lt;span style=&quot;color: #00007f;&quot;&gt;ServerName&lt;/span&gt; servertwo.tld:&lt;span style=&quot;color: #ff0000;&quot;&gt;443&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;SSLCertificateFile /etc/apache2/ssl/servertwo.crt&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;SSLCertificateKeyFile /etc/apache2/ssl/servertwo.key&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;#160; &amp;#160;[...]&lt;/div&gt;&lt;/li&gt;&lt;li style=&quot;font-weight: normal; vertical-align:top;&quot;&gt;&lt;div style=&quot;font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;&quot;&gt;&amp;lt;/&lt;span style=&quot;color: #000000; font-weight:bold;&quot;&gt;virtualhost&lt;/span&gt;&amp;gt;&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;

&lt;p&gt;It will just serve any request out of the first VirtualHost (serverone.tld) regardless of the hostname in the request headers.&lt;/p&gt;

&lt;p&gt;There is some light at the end of this tunnel though:
&lt;a target=&quot;_blank&quot; title=&quot;RFC 4366&quot; href=&quot;http://www.ietf.org/rfc/rfc4366.txt&quot;&gt;RFC4366&lt;/a&gt; describes an optional field to the TLS (&lt;a target=&quot;_blank&quot; title=&quot;Wikipedia:Transport Layer Security - TLS&quot; href=&quot;http://en.wikipedia.org/wiki/Transport_Layer_Security&quot;&gt;Transport Layer Security&lt;/a&gt;) client request called &amp;quot;Server Name Indication&amp;quot; (SNI). With this the client just includes a list of ServerNames (usually one) that it&#039;s trying to contact. Apache can easily match the supplied name from the client against a ServerName (or ServerAlias) directive from it&#039;s configuration files.&lt;/p&gt;

&lt;p&gt;SNI will be supported with &lt;a target=&quot;_blank&quot; title=&quot;OpenSSL Homepage&quot; href=&quot;http://openssl.org&quot;&gt;OpenSSL&lt;/a&gt; v0.9.9 in mod_ssl. Sometime in the future. There is a backport to v0.9.8 available from Steven Henson linked &lt;a target=&quot;_blank&quot; title=&quot;Blog Entry: Mozillazine - gerv&quot; href=&quot;http://weblogs.mozillazine.org/gerv/archives/2007/08/virtual_hosting_ssl_and_sni.html&quot;&gt;here&lt;/a&gt;. Or you can use mod_gnutls as described by George Notaras in a recent &lt;a target=&quot;_blank&quot; title=&quot;Blog entry: SSL-enabled Name-based Apache Virtual Hosts with mod_gnutls&quot; href=&quot;http://www.g-loaded.eu/2007/08/10/ssl-enabled-name-based-apache-virtual-hosts-with-mod_gnutls/&quot;&gt;blog entry&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In either cases the above configuration snippet will &amp;quot;just work&amp;quot; once SNI is understood by Apache.&lt;/p&gt;

&lt;p&gt;Currently Internet Explorer 7 (on Vista only, wanna upgrade &lt;img src=&quot;http://daniel-lange.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt;), Mozilla Firefox 2+, Opera 7.6+, KDE Konqueror 3.5+ support sending the SNI. You can test your browser at Kaspar Brand&#039;s &lt;a target=&quot;_blank&quot; title=&quot;https://sni.velox.ch/&quot; href=&quot;https://sni.velox.ch/&quot;&gt;SNI testpage&lt;/a&gt;. He also has a patch available to make Apache 2.2 mod_ssl SNI capable when compiled against a CVS-version of OpenSSL.&lt;/p&gt;

&lt;p&gt;I&#039;m rather sure that spreading SNI capable hosts will also provide new hacking opportunities:
Let&#039;s assume a system serves both Intranet and Internet traffic. A client contacts the Internet IP with SSL but specifies the Intranet Hostname in it&#039;s TLS SNI entry. Guess what will happen? Yup.&lt;/p&gt;

&lt;h2&gt;Update&lt;/h2&gt;

&lt;p&gt;02.09.2009: Gee, after two years people still read this blog entry. So I&#039;ll point you to a few updates. 2009 is not 2007 &lt;img src=&quot;http://daniel-lange.com/templates/default/img/emoticons/smile.png&quot; alt=&quot;:-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; SNI has made some slow progress since the original article. But major steps forward only came this summer: Apache has official support for SNI since 2.2.12 (&lt;a href=&quot;https://issues.apache.org/bugzilla/show_bug.cgi?id=34607&quot; title=&quot;Apache bugtracker bug 34607 - Support for Server Name Indication&quot;&gt;tracking bug&lt;/a&gt;). Gentoo has been early to support SNI and &lt;a href=&quot;http://dev.gentoo.org/~dertobi123/&quot; title=&quot;Tobias&#039; Gentoo dev page&quot;&gt;Tobias Scheerbaum&lt;/a&gt; has written a blog entry on &lt;a href=&quot;http://blog.scherbaum.info/2008/07/20/apache-ssl-und-sni/&quot; title=&quot;Tobias Scheerbaum&#039;s blog entry (in GERMAN)&quot;&gt;Apache, SSL und SNI in Gentoo (in German)&lt;/a&gt; summarizing how it works out of the box. Support for SNI has also been added to Debian (&lt;a href=&quot;http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=461917&quot; title=&quot;Debian bugtracker bug 461917 - Apache 2.2 TLS-SNI support,Package: apache2&quot;&gt;tracking bug&lt;/a&gt;) but for now the default config files don&#039;t reflect SNI capability yet. Ubuntu will see SNI in Karmic Koala, the release scheduled for next month i.e. &quot;9.10&quot; (&lt;a href=&quot;https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/184131&quot; title=&quot;Ubuntu bugtracker bug 184131 - Apache 2.2 SNI support&quot;&gt;tracking bug&lt;/a&gt;). Fedora has a SNI enabled Apache from httpd-2.2.13-1.fc11 onwards (&lt;a href=&quot;https://bugzilla.redhat.com/show_bug.cgi?id=443513&quot; title=&quot;Red Hat bugtracker bug 443513 - SNI support for mod_ssl&quot;&gt;tracking bug&lt;/a&gt;). Tobias also states that SP3 for Windows XP enables IE6 to send the SNI (SP2 is not sufficient).&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Sat, 13 Oct 2007 14:00:00 +0200</pubDate>
    <guid isPermaLink="false">http://daniel-lange.com/archives/2-guid.html</guid>
    <category>apache</category>
<category>sni</category>
<category>ssl</category>
<category>updated</category>
<category>virtualhost</category>

</item>
<item>
    <title>Apache fails to start at boot, but works when started manually</title>
    <link>http://daniel-lange.com/archives/1-Apache-fails-to-start-at-boot,-but-works-when-started-manually.html</link>
            <category>Apache</category>
            <category>Gentoo</category>
    
    <comments>http://daniel-lange.com/archives/1-Apache-fails-to-start-at-boot,-but-works-when-started-manually.html#comments</comments>
    <wfw:comment>http://daniel-lange.com/wfwcomment.php?cid=1</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://daniel-lange.com/rss.php?version=2.0&amp;type=comments&amp;cid=1</wfw:commentRss>
    

    <author>nospam@example.com (Daniel Lange)</author>
    <content:encoded>
    &lt;p&gt;Since a baselayout update Apache fails to start on Gentoo at (re-)boot of a server if that server has unused ethernet interfaces.&lt;/p&gt;

&lt;p&gt;The symptom is that Apache fails to start on boot although it has been added to the runlevel with&lt;br /&gt;&lt;font face=&quot;courier new,courier,monospace&quot;&gt; rc-update add apache default&lt;/font&gt;&lt;/p&gt;

&lt;p&gt;This is caused by recent baselayouts not working properly with more than one eth and not all of them being up.&lt;br /&gt;&lt;br /&gt;Thus changing &lt;font face=&quot;courier new,courier,monospace&quot;&gt;depend() { need net ... }&lt;/font&gt; into&lt;br /&gt;&lt;font face=&quot;courier new,courier,monospace&quot;&gt;depend() { need net&lt;b&gt;.eth0&lt;/b&gt; ... }&lt;/font&gt; at the top of /etc/init.d/apache2 will help.&lt;br /&gt;&lt;br /&gt;While you&#039;re at it you could also add an nice &lt;font face=&quot;courier new,courier,monospace&quot;&gt;after urandom&lt;/font&gt; to the existing &lt;font face=&quot;courier new,courier,monospace&quot;&gt;depend ()&lt;/font&gt; construct&lt;br /&gt;and make sure apr and apache are emerged with flag urandom set. Reading from /dev/random to initialize the digest authentication mechanism (or SSL for that matter) might cause apache to block otherwise if there is not enough entropy in the random pool.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
 
    </content:encoded>

    <pubDate>Wed, 03 Oct 2007 16:26:28 +0200</pubDate>
    <guid isPermaLink="false">http://daniel-lange.com/archives/1-guid.html</guid>
    <category>apache</category>
<category>baselayout</category>
<category>bug</category>
<category>eth</category>
<category>gentoo</category>
<category>init.d</category>
<category>network</category>

</item>

</channel>
</rss>