<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Virtual on Notes</title>
    <link>https://www.simplicidade.org/tags/virtual/index.xml</link>
    <description>Recent content in Virtual on Notes</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <managingEditor>melo@simplicidade.org (Pedro Melo)</managingEditor>
    <webMaster>melo@simplicidade.org (Pedro Melo)</webMaster>
    <copyright>(c) 2016 Pedro Melo.</copyright>
    <atom:link href="/tags/virtual/index.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsuhhubbub.superfeedr.com/"/>
    
    <item>
      <title>Virtual hosts via Apple Rendezvous: solution</title>
      <link>https://www.simplicidade.org/notes/2004/08/20/virtual-hosts-via-apple-rendezvous-solution/</link>
      <pubDate>Fri, 20 Aug 2004 22:34:43 +0000</pubDate>
      <author>melo@simplicidade.org (Pedro Melo)</author>
      <guid>https://www.simplicidade.org/notes/2004/08/20/virtual-hosts-via-apple-rendezvous-solution/</guid>
      <description>&lt;p&gt;Just finish writing a hint to &lt;a href=&#34;http://www.macosxhints.com/&#34;&gt;MacOS X Hints&lt;/a&gt;, about publishing virtual hosts via rendezvous.&lt;/p&gt;

&lt;p&gt;Here is a copy, in case it&#39;s not accepted. I&#39;m using this as we speak.&lt;/p&gt;

&lt;p&gt;In a &lt;a href=&#34;http://www.macosxhints.com/article.php?story=20030222015415664&#34;&gt;previous hint&lt;/a&gt; it was described how to use the RegisterResource of mod_apple_rendezvous to publish additional paths of your local server via Rendezvous.&lt;/p&gt;

&lt;p&gt;Virtual hosts are more complicated because you cannot send the hostname via rendezvous, apparently.&lt;/p&gt;

&lt;p&gt;But that&#39;s easy to solve with mod_rewrite. To do it, create a file (I named mine virtualhosts.conf) and place it in &lt;code&gt;/etc/httpd/users&lt;/code&gt;. Place the following inside:&lt;/p&gt;

&lt;pre&gt;
# you can put anything after /.vh/ as longs as
# it starts with the site name followed by an 
# optional path
RegisterResource &#34;MacOS X Hints&#34; /.vh/www.macosxhints.com/
RegisterResource &#34;Send me one, please!&#34; /.vh/www.apple.com/displays/

# Add other RegisterResource as above to add more sites

# Magic.....
RewriteEngine On
RewriteRule /\.vh/(.+) http://$1 [R]
&lt;/pre&gt;

&lt;p&gt;and then restart your Apache webserver:&lt;/p&gt;

&lt;pre&gt;
$ sudo apachectl stop
$ sudo apachectl start
&lt;/pre&gt;

&lt;p&gt;You can also restart with &lt;code&gt;sudo apachectl restart&lt;/code&gt; or even &lt;code&gt;sudo apachectl graceful&lt;/code&gt;. I prefer stop/start.&lt;/p&gt;

&lt;p&gt;That&#39;s it. Check you Rendezvous menu in the Bookmarks Bar and you&#39;ll find &#34;MacOS X Hints&#34; that will redirect to this site.&lt;/p&gt;

&lt;p&gt;We can also use this method to support HTTPS. Just add this line to the file:&lt;/p&gt;

&lt;pre&gt;
RewriteRule /\.vhs/(.+) https://$1 [R]
&lt;/pre&gt;

&lt;p&gt;and register resources as:&lt;/p&gt;

&lt;pre&gt;
RegisterResource &#34;Amazon&#34; /.vhs/www.amazon.com/
&lt;/pre&gt;

&lt;p&gt;We use a prefix, &lt;code&gt;/.vh/&lt;/code&gt; (and &lt;code&gt;/.vhs/&lt;/code&gt;), that should be unused in most configurations. If you happen to use it in your own configuration, change all the occurrences to something else, like &lt;code&gt;/.idontusethis/&lt;/code&gt;.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>