<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>i.justrealized &#187; host</title> <atom:link href="http://i.justrealized.com/tag/host/feed/" rel="self" type="application/rss+xml" /><link>http://i.justrealized.com</link> <description>All things observable</description> <lastBuildDate>Thu, 29 Jul 2010 02:55:48 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>How to set up VirtualHost in Ubuntu</title><link>http://i.justrealized.com/2008/11/30/how-to-set-up-virtualhost-in-ubuntu/</link> <comments>http://i.justrealized.com/2008/11/30/how-to-set-up-virtualhost-in-ubuntu/#comments</comments> <pubDate>Sat, 29 Nov 2008 16:50:04 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[configuration]]></category> <category><![CDATA[host]]></category> <category><![CDATA[how to]]></category> <category><![CDATA[server]]></category> <category><![CDATA[ubuntu]]></category> <category><![CDATA[virtualhost]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=1207</guid> <description><![CDATA[My environment is Ubuntu 8.1 Intrepid Ibex. I also written a guide on how to set up virtual hosts in Windows XP or Windows Vista. 0. Introduction Sometimes, we have multiple projects and we would like to access the Project 1&#8242;s website by typing &#8216;http://project1/&#8217; in the browser address bar. And Project 2 may be [...]]]></description> <content:encoded><![CDATA[<p>My environment is Ubuntu 8.1 Intrepid Ibex. I also written a guide on <a
href="http://i.justrealized.com/2008/05/16/how-to-set-up-virtualhost-in-xampp-for-windows/">how to set up virtual hosts in Windows XP or Windows Vista</a>.</p><h3>0. Introduction</h3><p>Sometimes, we have multiple projects and we would like to access the Project 1&#8242;s website by typing &#8216;http://project1/&#8217; in the browser address bar. And Project 2 may be at &#8216;http://project2/&#8217;. Virtual hosts are what you need for your development work. This guide requires you to have basic knowledge of Apache. This guide assumes you haven&#8217;t done additional configuration to your Apache. You must have already got Apache2 installed.</p><p>Also remember that you should always do a backup of every configuration file you change.</p><h3>1. Add a new host in Ubuntu</h3><p>You should only be adding new hosts if you want to develop multiples sites in your local computer. Skip this section to go to Section 2 if you just want to add virtual hosts to a remote server.</p><p>Type in the following command into your terminal, you need to sudo here:<span
id="more-1207"></span></p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw2">sudo</span> <span
class="kw2">nano</span> <span
class="sy0">/</span>etc<span
class="sy0">/</span>hosts</div></div><p>You should see something like this:</p><div
class="codesnip-container" ><div
class="ini codesnip" style="font-family:monospace;">127.0.0.1 &nbsp; &nbsp; &nbsp; localhost<br
/> 127.0.1.1 &nbsp; &nbsp; &nbsp; kahwee-desktop</p><p># some addition ipv6 stuff</p></div></div><p>Add an additional line so that it looks this way:</p><div
class="codesnip-container" ><div
class="ini codesnip" style="font-family:monospace;">127.0.0.1 &nbsp; &nbsp; &nbsp; localhost<br
/> 127.0.1.1 &nbsp; &nbsp; &nbsp; kahwee-desktop<br
/> 127.0.0.1 &nbsp; &nbsp; &nbsp; project1</p><p># some addition ipv6 stuff</p></div></div><p>That way, we can now access http://project1/ through the browser. We&#8217;ll have to tell Apache what to do when someone visits that page.</p><h3>2. Additional Apache configuration</h3><p>Apache2&#8242;s configuration is located in /etc/apache2/apache2.conf. To edit it:</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw2">sudo</span> <span
class="kw2">nano</span> <span
class="sy0">/</span>etc<span
class="sy0">/</span>apache2<span
class="sy0">/</span>apache2.conf</div></div><p>We want to use virtual hosts so we add the following lines to the end of the configuration file:</p><div
class="codesnip-container" ><div
class="ini codesnip" style="font-family:monospace;">ServerName localhost</div></div><p>Now we can</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw2">sudo</span> <span
class="kw2">nano</span> <span
class="sy0">/</span>etc<span
class="sy0">/</span>apache2<span
class="sy0">/</span>ports.conf</div></div><h3>3. Create a new site for Apache</h3><p>Apache allows you to specify sites so that you can enable and disable sites. Go to the sites-available directory:</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw3">cd</span> <span
class="sy0">/</span>etc<span
class="sy0">/</span>apache2<span
class="sy0">/</span>sites-available<span
class="sy0">/</span></div></div><p>These are the sites available for me. Yours may differ:</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;">kahwee<span
class="sy0">@</span>kahwee-desktop:<span
class="sy0">/</span>etc<span
class="sy0">/</span>apache2<span
class="sy0">/</span>sites-available$ <span
class="kw2">ls</span><br
/> default &nbsp;default-ssl &nbsp;kahwee &nbsp;kahwee~</div></div><p>We are going to create a new site by creating a new file for it:</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw2">sudo</span> <span
class="kw2">nano</span> project1</div></div><p>Paste the following into your newly created site (&#8216;project1&#8242;).</p><div
class="codesnip-container" ><div
class="apache codesnip" style="font-family:monospace;">&lt;<span
class="kw3">VirtualHost</span> *:80&gt;<br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">ServerAdmin</span> webmaster@localhost<br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">ServerName</span> project1</p><p>&nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">DocumentRoot</span> /home/kahwee/projects/project1</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;<span
class="kw3">Directory</span> /home/kahwee/projects/project1&gt;<br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">Options</span> <span
class="kw2">Indexes</span> <span
class="kw2">FollowSymLinks</span> MultiViews<br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">AllowOverride</span> <span
class="kw2">None</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">Order</span> <span
class="kw1">allow</span>,<span
class="kw1">deny</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">allow</span> from <span
class="kw2">all</span><br
/> &nbsp; &nbsp; &nbsp; &nbsp; &lt;/<span
class="kw3">Directory</span>&gt;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">LogLevel</span> warn<br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">ErrorLog</span> &nbsp;/home/kahwee/projects/project1/log/error.log<br
/> &nbsp; &nbsp; &nbsp; &nbsp; <span
class="kw1">CustomLog</span> /home/kahwee/projects/project1/log/access.log combined<br
/> &lt;/<span
class="kw3">VirtualHost</span>&gt;</div></div><p>Some things to note:</p><ul><li>ServerName is the same name to added to your host file. In the beginning of this guide, we used &#8216;project1&#8242; as our hostname.</li><li>DocumentRoot is the folder Apache would load when the user visits http://project1/</li><li>Remember to replace the rest of the folders to the correct locations.</li></ul><p>We&#8217;ve specified the basic configuration for the site &#8216;project1&#8242;. You can save the file with Ctrl+O in nano.</p><p><script type="text/javascript">google_ad_client = "pub-1497720434432681";
google_ad_slot = "6711626597";
google_ad_width = 468;
google_ad_height = 60;</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </p><p>Now we have an additional site:</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;">kahwee<span
class="sy0">@</span>kahwee-desktop:<span
class="sy0">/</span>etc<span
class="sy0">/</span>apache2<span
class="sy0">/</span>sites-available$ <span
class="kw2">ls</span><br
/> default &nbsp;default-ssl &nbsp;kahwee &nbsp;kahwee~ &nbsp;project1</div></div><h3>4. Enabling the site we&#8217;ve just created</h3><p>Now that the site is created, we have to enable it. The following command enables the site named &#8216;project1&#8242; (filename):</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw2">sudo</span> a2ensite project1</div></div><p>To disable the site, you basically give the following command:</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw2">sudo</span> a2dissite project1</div></div><p>You may notice that enabling the site basically copy the &#8216;project1&#8242; file from /etc/apache2/sites-available to /etc/apache2/sites-enabled. Disabling the site removes the corresponding file from /etc/apache2/sites-enabled.</p><p>After you enable or disable the site, you&#8217;ll be prompted to do a restart:</p><div
class="codesnip-container" ><div
class="bash codesnip" style="font-family:monospace;"><span
class="kw2">sudo</span> <span
class="sy0">/</span>etc<span
class="sy0">/</span>init.d<span
class="sy0">/</span>apache2 reload</div></div><p>If the server did not manage to restart successfully, it is likely that there is error with the configuration files. You may try disabling the site and reloading it again to test if it&#8217;s with the site file.</p><h3>5. It&#8217;s done!</h3><p>It&#8217;s done so test it out in your browser by visiting http://project1/.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2008/11/30/how-to-set-up-virtualhost-in-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to set up VirtualHost in XAMPP for Windows</title><link>http://i.justrealized.com/2008/05/16/how-to-set-up-virtualhost-in-xampp-for-windows/</link> <comments>http://i.justrealized.com/2008/05/16/how-to-set-up-virtualhost-in-xampp-for-windows/#comments</comments> <pubDate>Fri, 16 May 2008 12:54:55 +0000</pubDate> <dc:creator>KahWee</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[apache]]></category> <category><![CDATA[configuration]]></category> <category><![CDATA[development]]></category> <category><![CDATA[host]]></category> <category><![CDATA[server]]></category> <category><![CDATA[virtualhost]]></category> <category><![CDATA[windows]]></category> <category><![CDATA[xampp]]></category><guid
isPermaLink="false">http://i.justrealized.com/?p=239</guid> <description><![CDATA[My environment is Windows Vista but these instructions work for Windows XP as well. I also written a guide on how to set up virtual hosts in Ubuntu. 0. Introduction Sometimes, we have multiple projects and we would like to access the Project 1&#8242;s website by typing &#8216;http://project1/&#8217; in the browser address bar. And Project [...]]]></description> <content:encoded><![CDATA[<p>My environment is Windows Vista but these instructions work for Windows XP as well. I also written a guide on <a
href="http://i.justrealized.com/2008/11/30/how-to-set-up-virtualhost-in-ubuntu/">how to set up virtual hosts in Ubuntu</a>.</p><h3>0. Introduction</h3><p>Sometimes, we have multiple projects and we would like to access the Project 1&#8242;s website by typing &#8216;http://project1/&#8217; in the browser address bar. And Project 2 may be at &#8216;http://project2/&#8217;. This is how we can configure Windows and Apache to do just that. While this guide is written for XAMPP&#8217;s Apache, if the instruction applies pretty much to Apache too. You can put your configuration into &#8216;httpd.conf&#8217;.</p><h3>1. Add a new host in Windows</h3><p>First go to your hosts file, it is located at C:\Windows\System32\drivers\etc\hosts for most people. If you&#8217;re using Windows Vista, you need to run command prompt as administrator. Type &#8216;cmd&#8217; into the search bar and right click on the &#8216;cmd&#8217; search result to point to &#8216;Run as administrator&#8217;.<span
id="more-239"></span></p><p><img
src="http://justrealized.s3.amazonaws.com/media/2008/05/running-command-prompt-as-administrator.png" alt="Running command prompt as administrator" title="Running command prompt as administrator" width="281" height="534" class="alignnone size-full wp-image-240" /></p><p>Type in the following command into your command prompt:</p><div
class="codesnip-container" ><div
class="dos codesnip" style="font-family:monospace;">notepad C:\Windows\System32\drivers\etc\hosts</div></div><p>You will see notepad open and your hosts file looking something like this:</p><div
class="codesnip-container" ><div
class="ini codesnip" style="font-family:monospace;">127.0.0.1 &nbsp; &nbsp; &nbsp; localhost<br
/> ::<span
class="nu0">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; localhost</div></div><p>Add an additional line so that it looks this way:</p><div
class="codesnip-container" ><div
class="ini codesnip" style="font-family:monospace;">127.0.0.1 &nbsp; &nbsp; &nbsp; localhost<br
/> 127.0.0.1 &nbsp; &nbsp; &nbsp; project1<br
/> ::<span
class="nu0">1</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; localhost</div></div><p>Order doesn&#8217;t matter, I just want it to look nicer. &#8216;::1&#8242; is for IPv6&#8242;s localhost by the way.</p><h3>2. Add VirtualHost into Apache&#8217;s configuration</h3><p>Now edit our httpd-vhosts.conf. It should be located in C:\xampp\apache\conf\extra\httpd-vhosts.conf.</p><p>Uncomment the NameVirtualHost line and add new virtual hosts. I add &#8216;project1&#8242; and &#8216;localhost&#8217;:</p><div
class="codesnip-container" ><div
class="apache codesnip" style="font-family:monospace;"><span
class="kw1">NameVirtualHost</span> *:80</p><p>&lt;<span
class="kw3">VirtualHost</span> *:80&gt;<br
/> &nbsp; &nbsp; <span
class="kw1">DocumentRoot</span> <span
class="st0">&quot;C:/projects/project1&quot;</span><br
/> &nbsp; &nbsp; <span
class="kw1">ServerName</span> project1<br
/> &lt;/<span
class="kw3">VirtualHost</span>&gt;</p><p>&lt;<span
class="kw3">Directory</span> <span
class="st0">&quot;C:/projects/project1&quot;</span>&gt;<br
/> &nbsp; &nbsp; <span
class="kw1">Options</span> <span
class="kw2">Indexes</span> <span
class="kw2">FollowSymLinks</span> <span
class="kw2">Includes</span> ExecCGI<br
/> &nbsp; &nbsp; <span
class="kw1">AllowOverride</span> <span
class="kw2">All</span><br
/> &nbsp; &nbsp; <span
class="kw1">Order</span> <span
class="kw1">allow</span>,<span
class="kw1">deny</span><br
/> &nbsp; &nbsp; <span
class="kw1">Allow</span> from <span
class="kw2">all</span><br
/> &lt;/<span
class="kw3">Directory</span>&gt;</p><p>&lt;<span
class="kw3">VirtualHost</span> *:80&gt;<br
/> &nbsp; &nbsp; <span
class="kw1">DocumentRoot</span> <span
class="st0">&quot;C:/webroot&quot;</span><br
/> &nbsp; &nbsp; <span
class="kw1">ServerName</span> localhost<br
/> &lt;/<span
class="kw3">VirtualHost</span>&gt;</p><p>&lt;<span
class="kw3">Directory</span> <span
class="st0">&quot;C:/webroot&quot;</span>&gt;<br
/> &nbsp; &nbsp; <span
class="kw1">Options</span> <span
class="kw2">Indexes</span> <span
class="kw2">FollowSymLinks</span> <span
class="kw2">Includes</span> ExecCGI<br
/> &nbsp; &nbsp; <span
class="kw1">AllowOverride</span> <span
class="kw2">All</span><br
/> &nbsp; &nbsp; <span
class="kw1">Order</span> <span
class="kw1">allow</span>,<span
class="kw1">deny</span><br
/> &nbsp; &nbsp; <span
class="kw1">Allow</span> from <span
class="kw2">all</span><br
/> &lt;/<span
class="kw3">Directory</span>&gt;</div></div><p>We&#8217;ll have to add localhost in our httpd-vhosts.conf file so that the localhost to continue working. You can add as many virtual hosts as you want in any order. You can even add hosts like &#8216;project2.localhost&#8217;.</p><p><script type="text/javascript">google_ad_client = "pub-1497720434432681";
google_ad_slot = "6711626597";
google_ad_width = 468;
google_ad_height = 60;</script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script> </p><h3>3. That&#8217;s all</h3><p>Oh yeah, and remember to restart your Apache server so that your new settings can be reflected. Hope it helps.</p> ]]></content:encoded> <wfw:commentRss>http://i.justrealized.com/2008/05/16/how-to-set-up-virtualhost-in-xampp-for-windows/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using apc
Page Caching using apc (user agent is rejected)
Database Caching 8/31 queries in 0.024 seconds using apc
Content Delivery Network via Amazon Web Services: S3: justrealized.s3.amazonaws.com

Served from: i.justrealized.com @ 2010-07-29 18:57:36 -->