Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

Confused about virtual hosts and namve vs IP hosting

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Next:  what would my ip adress be ?  
Author Message
abuse6

External


Since: Jun 07, 2004
Posts: 18



(Msg. 1) Posted: Mon Jun 07, 2004 2:56 pm
Post subject: Confused about virtual hosts and namve vs IP hosting
Archived from groups: alt>apache>configuration (more info?)

I am an Apache newbie. I have been using IIS for many years and have
only been using Apache on my hosted sites.

I now am using Apache on my home machine, which is slowly switching
from Windows NT 5 to Linux.

Under NT, I had IIS 4 running. All my web projects were under my
x:\projects folder, with various sub folders for each. For example,the
index.php file for my site <a style='text-decoration: underline;' href="http://www.perfectreign.com" target="_blank">www.perfectreign.com</a> website is on my
home (and work) machines as F:\projects\pr_v3\website\index.php

Under IIS to setup a new site on my machine, I'd just click on the
config tool, to to the "Default Web Site", right-click, click on New
-> Virtual Directory, give the directory an alias and a path, set the
default document and I'm set. On my work machine, for example, my
perfectreign website is http:\\MyWorkComputer\pr3.
At home, since I'm dual-booting for the moment, I've setup the
projects folder under the NTFS volume as \mnt\drvf\projects.

I've read the Apache documentation and the tutorial at:
<a style='text-decoration: underline;' href="http://www.serverwatch.com/tutorials/article.php/1127571" target="_blank">http://www.serverwatch.com/tutorials/article.php/1127571</a>

What I'm wondering is, what do I need to setup to allow the same
behavior to happen at my home machine. I currently have the
development perfectreign at home running at http:\\lilly\pr It is
physically located at f:\projets\pr_v3\website, which would be
/mnt/drvf/projects/pr_v3/website in Linux.

Do I set this up as a Name-Based Virtual Host? If so would my conf
file look like:


<VirtualHost pr>
DocumentRoot /mnt/drvf/projects/pr_v3/website
ServerName lilly
</VirtualHost>


and then for my FileSite development, which is at
/mnt/projects/fsv2/website and should be accessed by typing in
<a style='text-decoration: underline;' href="http://lilly/fsv2," target="_blank">http://lilly/fsv2,</a> I would add:

 
<VirtualHost fsv2>
DocumentRoot /mnt/drvf/projects/fsv2/website
ServerName lilly
</VirtualHost>

-OR-

Would I use IP based resolution? Since I only have one static IP (I
am on DSL and behind a NAT router.) I would want to point all sites
to the same IP?

<VirtualHost 192.168.1.1>
ServerName lilly
DocumentRoot /mnt/drvf/projects/pr_v3/website
ServerAlias pr
</VirtualHost>

<VirtualHost 192.168.1.1>
ServerName lilly
DocumentRoot /mnt/drvf/projects/fsv2/website
ServerAlias fsv2
</VirtualHost>



Thanks in advance!!

K<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Confused about virtual hosts and namve vs IP hosting 
Back to top
Login to vote
hans1

External


Since: Mar 29, 2004
Posts: 672



(Msg. 2) Posted: Tue Jun 08, 2004 12:55 am
Post subject: Re: Confused about virtual hosts and namve vs IP hosting [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

"filesiteguy" <abuse RemoveThis @127.0.0.1> schreef in bericht
news:tfd9c0poorh32kk6lcc2qbnhqlaeoe5sdq@4ax.com...
 > Would I use IP based resolution? Since I only have one static IP (I
 > am on DSL and behind a NAT router.) I would want to point all sites
 > to the same IP?
 > <VirtualHost 192.168.1.1>
 > ServerName lilly
 > DocumentRoot /mnt/drvf/projects/pr_v3/website
 > ServerAlias pr
 > </VirtualHost>
 >
 > <VirtualHost 192.168.1.1>
 > ServerName lilly
 > DocumentRoot /mnt/drvf/projects/fsv2/website
 > ServerAlias fsv2
 > </VirtualHost>
 >
<a style='text-decoration: underline;' href="http://httpd.apache.org/docs-2.0/mod/core.html#namevirtualhost" target="_blank">http://httpd.apache.org/docs-2.0/mod/core.html#namevirtualhost</a>
Add a <namevirtualhost 192.168.1.1 above the first <virtualhost ..>,
change the ServerNames to pr and fsv2 and remove the ServerAlias
and you'll be in pritty good shape for name based hosting.
(Have both names available in your local DNS of hosts file)
(Replace the IP by an * and have it work on any of the machines IPs)

HansH<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: Confused about virtual hosts and namve vs IP hosting 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Virtual Hosts - Hi everyone, I am new to apache, so if my question is answered in the groups faq, or on the apache web site, feel free to tell me to f**k off and read there. However I have looked through the manual, and cant find any reference to the issues im having...

Virtual hosts and SSL? - Hello I'm trying to setup this apache 1.3 server for virtual hosts, with ssl. I've got the normal port 80 working, but the SSL is a bit of a mess. If I have the SSL pages in the real part of the server, ie, https://www.example.com/fred/index.htm then....

Virtual Hosts? - I'm wanting to use one IP address to host multiple domains, ie web hosting. I assume that "virtual hosts" are the thin I need to focus on here and is this basically a similar concept to Host Headers in IIS 5.0? I'm running Windows 2000 with Apa...

Virtual Hosts Trouble - Hi out there. I'm trying to set up apache so that i can access different sites (that are under development) by typing, for example, "http://website1/" and "http://website2/." in the httpd.conf file i have: DocumentRoot /usr/local...

Virtual hosts mod_rewrite - I have succesfully implemented a mod_rewrite for virtual hosts using an external hosts map file, using the code below: ---- RewriteEngine on RewriteMap lowercase int:tolower RewriteMap vhost txt:/etc/apache/vhost.map RewriteCond ..
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]