phpeveryday.com

The best tutorial of php, php framework, php strategies, object oriented oriented,


Virtual host - Part 2: "www.mysite.com" to special folder in your local

Tag: dns, virtual host   Category: Apache, Hosting
post: 09 Oct 2007 read: 2,222


Virtual Host Tutorial:You have known how to make www.mysite.com in your local computer (you can read this article at here). Now, I will show to you how to link www.mysite.com to special folder in your local web server folder. I mean, if you access www.mysite.com, automatically access folder mysite (for example) in your root folder.

Follow this step:
1. Open your httpd.conf (may be below Apache2\conf).
2. add following code at end of text:

NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
  DocumentRoot "C:\AppServ\www"
  ServerName   localhost
</VirtualHost>

<VirtualHost 127.0.0.1:80>
  DocumentRoot "C:\AppServ\www\mysite"
  ServerName   www.mysite.com
</VirtualHost>
3. Restart your apache

Wow, now you can have your own virtual host!


Series this article:
Virtual Host - Part 1: Make "www.yoursite.com" in your local computer
Virtual host - Part 2: "www.mysite.com" to special folder in your local

| Give Your Opinion | Recommend
Share and Bookmark to: These icons link to social bookmarking sites where readers can share and discover new web pages.
digg del.icio.us technorati Ma.gnolia BlinkList

Recommended articles by other readers:
Web Services: How PHP Kiss VB.NET? (Part 1)
Chart: How to Build Cool Animation Real Time Chart
Joomla: Fast Road to Understand Component Programming
Email: Send Attachement Mail
mod_rewrite - Part 1: create your "fantasy" URL

What do You Think?
Your Name *:
Email *:
(Will not be published)
Website/URL:
Your Comment *:
* Required


615
posting