logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: virtual host configuration help please
Author
shaggy



Joined: 15 Nov 2005
Posts: 82
Location: Dundee, Michigan

PostPosted: Tue 09 Jan '07 1:32    Post subject: virtual host configuration help please Reply with quote

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

PostPosted: Tue 09 Jan '07 2:54    Post subject: Reply with quote

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: 7294
Location: Germany, Next to Hamburg

PostPosted: Tue 09 Jan '07 10:37    Post subject: Reply with quote

Please read the manual

http://httpd.apache.org/docs/2.2/en/vhosts/name-based.html

If there are any questions left, please ask again.
Back to top
strigoi



Joined: 15 Dec 2005
Posts: 36

PostPosted: Wed 17 Jan '07 11:36    Post subject: hmmm Reply with quote

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

PostPosted: Thu 25 Jan '07 5:42    Post subject: Where in http.conf? Reply with quote

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

PostPosted: Sun 28 Jan '07 3:08    Post subject: httpd Reply with quote

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

PostPosted: Sun 28 Jan '07 15:45    Post subject: Reply with quote

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

PostPosted: Mon 29 Jan '07 3:21    Post subject: yup Reply with quote

anytime
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7294
Location: Germany, Next to Hamburg

PostPosted: Mon 29 Jan '07 16:17    Post subject: Reply with quote

That solution works only local. Wink
Back to top


Reply to topic   Topic: virtual host configuration help please View previous topic :: View next topic
Post new topic   Forum Index -> Apache