|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
HI I have a problem
I am trying to virtual host 2 webpages on my Apache 2.0 webserver, but when I put in the virtual host commands as per the documentation, all I get is the webpage that is in the first place of the virtual host command and can not seem to get the second webpage no matter what URL I use?? >>>>Here is the argument I put in the httpd.conf <<<<< <VirtualHost *:80> ServerName apeture.ca DocumentRoot "D:\xxx\xxx" </VirtualHost> <VirtualHost *:80> ServerName hooliganwear.ca DocumentRoot "E:\xxx\xxx" </VirtualHost> (x =the actual drive locations ) The thing is if I reverse this I get the other webpage?? Do I have to change anything in my original ServerName or DocumentRoot. Last entries on the error log after I restart the server and try are as follows: [Sun Jan 18 16:03:00 2004] [notice] Parent: Received restart signal -- Restarting the server. >>>>>>> [Sun Jan 18 16:03:00 2004] [warn] _default_ VirtualHost overlap on port 80, the first has precedence [Sun Jan 18 16:03:00 2004] [notice] Parent: Created child process 5964 [Sun Jan 18 16:03:01 2004] [warn] _default_ VirtualHost overlap on port 80, the first has precedence [Sun Jan 18 16:03:01 2004] [warn] _default_ VirtualHost overlap on port 80, the first has precedence [Sun Jan 18 16:03:01 2004] [notice] Child 5964: Child process is running [Sun Jan 18 16:03:01 2004] [notice] Child 5964: Acquired the start mutex. [Sun Jan 18 16:03:01 2004] [notice] Child 1720: Released the start mutex [Sun Jan 18 16:03:01 2004] [notice] Child 5964: Starting 250 worker threads. [Sun Jan 18 16:03:02 2004] [notice] Child 1720: Waiting for 250 worker threads to exit. [Sun Jan 18 16:03:02 2004] [notice] Child 1720: All worker threads have exited. [Sun Jan 18 16:03:02 2004] [notice] Child 1720: Child process is exiting ![]() |
|
#2
|
||||
|
||||
|
I suspect it's because you've got the wildcard in the <VirtualHost> directive. That tells apache (I imagine) that the current directive answers for all domains; and as the first is the default, it makes sense that you'd be getting the first. Actually, now that I read the log output, I see that that's exactly what's going on. Try sticking either the servername or the IP address in place of the * and see if that gets you anywhere.
|
|
#3
|
|||
|
|||
|
K Day 6 and I thought this was gonna be easy Do I have to have a router to run 2 websites on 1 apache server??? I have 2 different domain names I've got 2 dns' at zoneedit but they both report to my same external ip. I have a switch not a router after the dsl box and I read that you have to have a router could this be my problem? I really can't figure what to put in NameVitualHost and what to put in the <virtual Host> tags,,,, Man All I want to do is host another web....waaaaaaa !
|
|
#4
|
|||
|
|||
|
<<<Here is my actual log again >>>
# 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 *> # ServerAdmin URL # DocumentRoot /www/docs/dummy-host.example.com # ServerName dummy-host.example.com # ErrorLog logs/dummy-host.example.com-error_log # CustomLog logs/dummy-host.example.com-access_log common #</VirtualHost> <VirtualHost *> DocumentRoot d:/webserve/```` ServerName URL </VirtualHost> <VirtualHost *> DocumentRoot e:/Outside_web/``````` ServerName URL </VirtualHost> <VirtualHost *> DocumentRoot d:/webserve/````` ServerName URL </VirtualHost> ```=directory I tried ip but is it internal or external? I tried server names ... If I don't have a router and my dns's are using the same IP's how can my server distinguise between each domaine??? Anyone that can shed light please I'm loosing my eyesight I've read all the apache and dslwebserver info I can ![]() |
|
#5
|
|||
|
|||
|
I agree with the other reply; you need to specify what IP it's connecting to, or the name of the host in the <VirtualHost...> tag.
eg: <VirtualHost URL> DocumentRoot /var/www/htdocs/ ScriptAlias /cgi-bin/ /var/www/cgi-bin/ DirectoryIndex index.php index.html index.htm index.shtml ServerName blibble.com ServerSignature email </VirtualHost> <VirtualHost URL> DocumentRoot /var/www/blobble/htdocs/ ServerName blobble.com ScriptAlias /cgi-bin/ /var/www/blobble/cgi-bin/ ServerSignature email </VirtualHost> And make sure you make the correct DNS entries locally :-DThe <VirtualHost *> tag is usually reserved for the default virtual host, and each successive declaration of <VirtualHost *> overwrites the previous one. |
|
#6
|
|||
|
|||
|
Got it working thanks
Got it working I was a bad dns site and a wrong server name and yes you guys were right I did need the ip's in there
Thanks so much guys !!! ![]() |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Virtual host problems >>>Heeeeeeeeeelp! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|