| Author |  | 
| shaggy 
 
  
 Joined: 15 Nov 2005
 Posts: 82
 Location: Dundee, Michigan
 
 | 
|  Posted: Tue 09 Jan '07 1:32    Post subject: virtual host configuration help please |   |  
| 
 |  
| ok i've been messing with this now for awhile.  And really need a six pack instead of instructions..........lol.  I think what I'm trying to do is impossible so here goes: 
 One computer
 One apache
 Just installed bind if that makes a difference
 Server is on a "public" ip address 192.168.0.1
 Computer name is both localhost and server01
 I've edited the crap out of files and can't seem to do it it properly
 
 Here's what I wanna do:
 http://here.server01/ = c:\path to apache\htdocs\folder #1
 http://here2.server01/ = c:\path to apache\htdocs\folder #2
 Were "here" and "here2" is at are TWO DIFFERENT LOCATIONS <dirs> and two totally different pages.
 
 Different pages are for example: (not on my server just off the top of my head):
 C:\web\htdocs\forum\<folder> = phpBB = http://forum.server01/
 C:\web\htdocs\biz\<folder> = OSCommerence = http://biz.server01/ -or even- http://store.server01/
 
 Any help on how on earth to code that into apache?
 |  | 
| Back to top |  | 
| shaggy 
 
  
 Joined: 15 Nov 2005
 Posts: 82
 Location: Dundee, Michigan
 
 | 
|  Posted: Tue 09 Jan '07 2:54    Post subject: |   |  
| 
 |  
| part 2: The reason why i said http://here.server01/ is cuz i would like it to be served acrossed my network cuz if I do http://here.localhost/ it'll be only for that computer.  thanks for the advice and the help on this aggrivating situation
 |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 |  | 
| Back to top |  | 
| strigoi 
 
 
 Joined: 15 Dec 2005
 Posts: 36
 
 
 | 
|  Posted: Wed 17 Jan '07 11:36    Post subject: hmmm |   |  
| 
 |  
| why not edit the hosts file on the pc your on 
 # Copyright (c) 1993-1999 Microsoft Corp.
 #
 # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
 #
 # This file contains the mappings of IP addresses to host names. Each
 # entry should be kept on an individual line. The IP address should
 # be placed in the first column followed by the corresponding host name.
 # The IP address and the host name should be separated by at least one
 # space.
 #
 # Additionally, comments (such as these) may be inserted on individual
 # lines or following the machine name denoted by a '#' symbol.
 #
 # For example:
 #
 #      102.54.94.97     rhino.acme.com          # source server
 #       38.25.63.10     x.acme.com              # x client host
 
 127.0.0.1       localhost
 
 192.168.0.1       mine.com
 192.168.0.1       mine2.com
 
 if i understand correctly, these sites are for LAN only correct ??
 as per your example 192.168.0.1 is NOT a public (wan) ip.
 
 then its a simple vhost setup
 
 #
 # Use name-based virtual hosting.
 #
 NameVirtualHost *
 
 #
 # VirtualHost example:
 # Almost any Apache directive may go into a VirtualHost container.
 # The first VirtualHost section is used for requests without a known
 # server name.
 #
 <VirtualHost *>
 ServerName mine.com
 ServerAlias www.mine.com
 DocumentRoot "c:/program files/apache group/apache2/htdocs/mine1/"
 </VirtualHost>
 
 <VirtualHost *>
 ServerName mine2.com
 ServerAlias www.mine2.com
 DocumentRoot "c:/program files/apache group/apache2/htdocs/mine2/"
 </VirtualHost>
 |  | 
| Back to top |  | 
| slanetx 
 
 
 Joined: 25 Jan 2007
 Posts: 2
 
 
 | 
|  Posted: Thu 25 Jan '07 5:42    Post subject: Where in http.conf? |   |  
| 
 |  
| I am trying to setup 2 virtual hosts using the following: #
 NameVirtualHost *:80
 
 #
 # VirtualHost example:
 # Almost any Apache directive may go into a VirtualHost container.
 # The first VirtualHost section is used for all requests that do not
 # match a ServerName or ServerAlias in any <VirtualHost> block.
 #
 <VirtualHost *:80>
 ServerAdmin webmaster@shadowmountainranch.com
 DocumentRoot D:/smr/
 ServerName shadowmountainranch.com
 ServerAlias www.shadowmountainranch.com *.shadowmountainranch.com
 ErrorLog logs/shadowmountainranch.com-error_log
 CustomLog logs/shadowmountainranch.com-access_log common
 </VirtualHost>
 
 <VirtualHost *:80>
 ServerAdmin webmaster@navarroquail.org
 DocumentRoot D:/wnbri/
 ServerName navarroquail.org
 ServerAlias www.navarroquail.org *.navarroquail.org
 ErrorLog logs/navarroquail.org-error_log
 CustomLog logs/navarroquail.orgs-access_log common
 </VirtualHost>
 
 Where in http.conf do I place the above? Befor or after 'Main' Server Configuration?
 
 Thanks
 |  | 
| Back to top |  | 
| strigoi 
 
 
 Joined: 15 Dec 2005
 Posts: 36
 
 
 | 
|  Posted: Sun 28 Jan '07 3:08    Post subject: httpd |   |  
| 
 |  
| if you scroll down, youll see the virtual host config section, towards the bottom, thats a good a place as any. |  | 
| Back to top |  | 
| slanetx 
 
 
 Joined: 25 Jan 2007
 Posts: 2
 
 
 | 
|  Posted: Sun 28 Jan '07 15:45    Post subject: |   |  
| 
 |  
| I just went to the bottom of the file and inserted there and it worked. 
 Thanks
 |  | 
| Back to top |  | 
| strigoi 
 
 
 Joined: 15 Dec 2005
 Posts: 36
 
 
 | 
|  Posted: Mon 29 Jan '07 3:21    Post subject: yup |   |  
| 
 |  
| anytime |  | 
| Back to top |  | 
| James Blond Moderator
 
  
 Joined: 19 Jan 2006
 Posts: 7442
 Location: EU, Germany, Next to Hamburg
 
 | 
|  Posted: Mon 29 Jan '07 16:17    Post subject: |   |  
| 
 |  
| That solution works only local.  |  | 
| Back to top |  |