Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache & multiple host-names 1

Status
Not open for further replies.

roeiboot

Technical User
Feb 10, 2002
241
US
hi,

i have purchased a domain name & want to use different "names" on 1 pc (running win 2000 adv. server)
like: ( <- main one) and
xxx.myname.com, i believe this should be possible but it's not working.. here's a piece of my httpd.conf:
<VirtualHost *>
ServerAdmin name@mail.com
DocumentRoot &quot;D:/homepages/dir1&quot;
ServerName </VirtualHost>

<VirtualHost *>
ServerAdmin name@mail.com
DocumentRoot &quot;D:\homepages\dir2&quot;
ServerName xxx.myname.com
</VirtualHost>

what am i doing wrong ??

--
thx in advance,
rb.
 
Just alter the following file to point to your paths.

<VirtualHost *:80>
UseCanonicalName off
ServerName ServerAlias domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /whateverpath/dir
ScriptAlias /cgi-bin/ &quot;C:/whateverpath/dir/cgi-bin/&quot;
ServerSignature EMail
</VirtualHost>

then create another but change the domain to domain2

Hope this helps Wullie

 
tried this.. unfortunatly it doesn't help, keep in mind that i only purchased one domain-name & i want to 'change' the 'www' part with something else.. isn't there something more in the config-file i need to change to make this setup work ??

--
thanks,
rb.
 
<VirtualHost *:80>
UseCanonicalName off
ServerName ServerAlias whatever.domain.com
ServerAdmin webmaster@whatever.domain.com
DocumentRoot /whateverpath/dir2
ScriptAlias /cgi-bin/ &quot;C:/whateverpath/dir2/cgi-bin/&quot;
ServerSignature EMail
</VirtualHost>
<VirtualHost *:80>
UseCanonicalName off
ServerName ServerAlias domain.com
ServerAdmin webmaster@domain.com
DocumentRoot /whateverpath/dir
ScriptAlias /cgi-bin/ &quot;C:/whateverpath/dir/cgi-bin/&quot;
ServerSignature EMail
</VirtualHost> Wullie

 
grmbl :} .. this is what apache says to start with:
--
[Sun Feb 10 16:10:29 2002] [warn] _default_ VirtualHost overlap on port 80, the
first has precedence
--
and now only the first domain works (the whatever.domain)..
frusty :}

--
rgds,
rb.


ps. i'm using a small config-file now, d/l @
 
added the: namevirtualhost * ..but without succes, the error &quot;virtualhost overlap&quot; is fixed, but still not able to acces the 2nd site. and yes, i either restart apache or shut it down & start it again.
this is a pretty muchos strange problem..

thanks alot for all the tips sofar!

--
rgds,
rb.
 
sure, it's not that much work.. here it goes:
--
#
# httpd.conf (Server-Konfiguration)
#

ServerType standalone
Listen 80
ServerAdmin rudeboy@dwaalspoor.com
ServerName server.roeiboot.com
ServerRoot &quot;C:/program files/apache&quot;

BindAddress *

# Combined Logfile Format
#
CustomLog logs/access_log &quot;%h %l %u %t \&quot;%r\&quot; %>s %b \&quot;%{Referer}i\&quot; \&quot;%{User-agent}i\&quot;&quot;

ErrorLog logs/error_log
ScriptLog logs/script_log
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_status
#LockFile logs/accept.lock

Timeout 300
MaxClients 150
MaxRequestsPerChild 30
MinSpareServers 5
MaxSpareServers 10
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
IdentityCheck Off
HostnameLookups Off
ContentDigest On

BrowserMatch ^Mozilla/2 nokeepalive
BrowserMatch Java/1.0 force-response-1.0
BrowserMatch JDK/1.0 force-response-1.0
BrowserMatch &quot;RealPlayer 4.0&quot; force-response-1.0

NameVirtualHost *

<VirtualHost *>
UseCanonicalName off
ServerName ServerAlias sax.roeiboot.com
ServerAdmin webmaster@whatever.domain.com
DocumentRoot &quot;D:/homepages/sax&quot;
# ScriptAlias /cgi-bin/ &quot;C:/whateverpath/dir2/cgi-bin/&quot;
ServerSignature EMail
</VirtualHost>


<VirtualHost *>
UseCanonicalName off
ServerName ServerAlias roeiboot.com
ServerAdmin webmaster@domain.com
DocumentRoot &quot;D:/homepages/roeiboot.com&quot;
# ScriptAlias /cgi-bin/ &quot;C:/whateverpath/dir/cgi-bin/&quot;
ServerSignature EMail
</VirtualHost>

--
it's a (my) minimal config-file.. hope it can help to solve the 'error'.

--
bye,
rb.
 
yep, just put it back in.. @ first it gave an error since if you do it at one place you have to do it at all places,
(i mean if you put it behind the NameVirtualHost you also have to put it behind the VirtualHost.. but it doens't make a difference..
 
Try using the following, just copy it exactly as it is, make a backup of the previous one beforehand, you have it on the above thread anyway if you need it.

#
# httpd.conf (Server-Konfiguration)
#

ServerType standalone
#Listen 80

ServerAdmin rudeboy@dwaalspoor.com
# Port: The port to which the standalone server listens. Certain firewall
# products must be configured before Apache can listen to a specific port.
# Other running httpd servers will also interfere with this port. Disable
# all firewall, security, and other services if you encounter problems.
# To help diagnose problems use the Windows NT command NETSTAT -a

Port 80
ServerName localhost
ServerRoot &quot;C:/program files/apache&quot;

BindAddress *

# Combined Logfile Format
#
CustomLog logs/access_log &quot;%h %l %u %t \&quot;%r\&quot; %>s %b \&quot;%{Referer}i\&quot; \&quot;%{User-agent}i\&quot;&quot;

ErrorLog logs/error_log
ScriptLog logs/script_log
PidFile logs/httpd.pid
ScoreBoardFile logs/apache_status
#LockFile logs/accept.lock

Timeout 300
MaxClients 150
MaxRequestsPerChild 30
MinSpareServers 5
MaxSpareServers 10
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
IdentityCheck Off
HostnameLookups Off
ContentDigest On

BrowserMatch ^Mozilla/2 nokeepalive
BrowserMatch Java/1.0 force-response-1.0
BrowserMatch JDK/1.0 force-response-1.0
BrowserMatch &quot;RealPlayer 4.0&quot; force-response-1.0

NameVirtualHost *

<VirtualHost *:80>
UseCanonicalName off
ServerName ServerAlias sax.roeiboot.com
ServerAdmin webmaster@whatever.domain.com
DocumentRoot &quot;D:/homepages/sax&quot;
ScriptAlias /cgi-bin/ &quot;D:/homepages/sax/cgi-bin/&quot;
ServerSignature EMail
</VirtualHost>
<VirtualHost *:80>
UseCanonicalName off
ServerName ServerAlias roeiboot.com
ServerAdmin webmaster@domain.com
DocumentRoot &quot;D:/homepages/roeiboot.com&quot;
ScriptAlias /cgi-bin/ &quot;D:/homepages/roeiboot.com/cgi-bin/&quot;
ServerSignature EMail
</VirtualHost> Wullie

 
s--t.. doens't help either, output 'netstat -a' on the PC that runs Apache:

--
Active Connections

Proto Local Address Foreign Address State
TCP w2000-s:domain w2000-s:0 LISTENING
TCP w2000-s:http w2000-s:0 LISTENING
TCP w2000-s:nntp w2000-s:0 LISTENING
TCP w2000-s:epmap w2000-s:0 LISTENING
TCP w2000-s:microsoft-ds w2000-s:0 LISTENING
TCP w2000-s:563 w2000-s:0 LISTENING
TCP w2000-s:1025 w2000-s:0 LISTENING
TCP w2000-s:1027 w2000-s:0 LISTENING
TCP w2000-s:1030 w2000-s:0 LISTENING
TCP w2000-s:1031 w2000-s:0 LISTENING
TCP w2000-s:1035 w2000-s:0 LISTENING
TCP w2000-s:1038 w2000-s:0 LISTENING
TCP w2000-s:1666 w2000-s:0 LISTENING
TCP w2000-s:1801 w2000-s:0 LISTENING
TCP w2000-s:3372 w2000-s:0 LISTENING
TCP w2000-s:28704 w2000-s:0 LISTENING
TCP w2000-s:domain w2000-s:0 LISTENING
TCP w2000-s:hostname w2000-s:0 LISTENING
TCP w2000-s:domain w2000-s:0 LISTENING
TCP w2000-s:netbios-ssn w2000-s:0 LISTENING
TCP w2000-s:netbios-ssn WS#1:1183 ESTABLISHED
TCP w2000-s:1033 w2000-s:0 LISTENING
TCP w2000-s:1038 64.12.28.168:5190 ESTABLISHED
TCP w2000-s:1666 auto.search.msn.com:http ESTABLISHED
TCP w2000-s:2103 w2000-s:0 LISTENING
TCP w2000-s:2105 w2000-s:0 LISTENING
TCP w2000-s:2107 w2000-s:0 LISTENING
UDP w2000-s:epmap *:*
UDP w2000-s:snmp *:*
UDP w2000-s:microsoft-ds *:*
UDP w2000-s:1026 *:*
UDP w2000-s:1029 *:*
UDP w2000-s:1032 *:*
UDP w2000-s:1034 *:*
UDP w2000-s:3456 *:*
UDP w2000-s:3527 *:*
UDP w2000-s:domain *:*
UDP w2000-s:1028 *:*
UDP w2000-s:1607 *:*
UDP w2000-s:domain *:*
UDP w2000-s:netbios-ns *:*
UDP w2000-s:netbios-dgm *:*
UDP w2000-s:isakmp *:*
--
 
it is commented.. i just gave the output :} guess in your post it isn't commented because of the long-lines.. would it be worth to see if i can open one site thru another port or something ??
 
I think the best bet would be do try with the original httpd file that came with apache and just make the basic changes that need to be made.

Add the virtual host directives I gave you above and try that.

You can work from there if you want to remove things. You should make sure that it is working before you remove anything. Wullie

 
ehrrrrrrrrrrr... i don't think so :] on the machine where the webserver is running i have bind 8.2.x for w2k running, too be honest i'm fairly new @ bind/DNS stuff so i don't really know where to set that up, that could very well be the cause of the problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top