Jump to content
The Uniform Server Community

Virtual Hosting Problem


kalpz
 Share

Recommended Posts

I have a friend who has a server using UniServer 3.2a.

I am trying to help him set up virtual hosts for subdomains. He has a domain www.theundrground.net which points to his server. This is what I have done in his httpd.conf file..

 

NameVirtualHost *

<VirtualHost *>
ServerName www.theundrground.net
DocumentRoot /www/
</VirtualHost>

<VirtualHost *>
ServerName test2.theundrground.net
DocumentRoot /www/forumz
</VirtualHost>

<VirtualHost *>
ServerName kalpz.theundrground.net
DocumentRoot /www/kalpz
</VirtualHost>

 

When I restart the server and I go to all 3 domains, it comes up with the same page.. either kalpz page from kalpz folder or the root of /www/. I cant get it to separate. Any ideas?

ATOMIC Web Hosting 2007 - 2011

Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail)

E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/

Link to comment
Share on other sites

Search the forum... fixed this before... or try checking the UniCenter: http://center.uniformserver.com/virtual_ho...ual_host_1.html. If nothing, come back.

Link to comment
Share on other sites

Yip, been there done that to no avail.... Im backkkk lol.. Just doesnt wanna work..

ATOMIC Web Hosting 2007 - 2011

Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail)

E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/

Link to comment
Share on other sites

Yip I have...

 

Should it be using localhost like kalpz.localhost/test.localhost?? If your using domains, then you should use kalpz.theundrground.net right?

 

I have tried every combination..

 

 

<VirtualHost *>

ServerName kalpz.localhost

DocumentRoot /www/kalpz

</VirtualHost>

<VirtualHost *>

ServerName kalpz.theundrground.net

DocumentRoot /www/kalpz

</VirtualHost>

 

the namevirtualhost is uncommented also...

ATOMIC Web Hosting 2007 - 2011

Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail)

E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/

Link to comment
Share on other sites

I have had a quick scan of this thread. I cannot see the cause of the problem.

 

Your code is correct:

 

NameVirtualHost *

 

ServerName www.theundrground.net

DocumentRoot /www/

 

ServerName test2.theundrground.net

DocumentRoot /www/forumz

 

ServerName kalpz.theundrground.net

DocumentRoot /www/kalpz

 

I am puzzled by your test results when typing addresses into a browser:

 

http:// www.theundrground.net

http:// test2.theundrground.net

http:// kalpz.theundrground.net

 

You receive a test index page from either folder /www/ or folder /www/kalpz

 

I assume your domain provider has enabled wildcards (CNAME) otherwise you would have received a Server not found error on two of the address.

 

This means that any address containing your domain name *. theundrground.net is reaching your server hence not the problem area.

 

Type any address other than the above three containing your domain name eg fred. theundrground.net Will result in each VirtualHost being checked and of course no match will be found. Apache has no problem with this it will serves pages from the default folder. The default is the first VirtualHost entry hence will server pages from WWW. It appears that only the middle address is not being recognised. That’s what puzzles me and I think it is worth checking to see what is in the hosts file

 

Located in: C:\WINDOWS\system32\drivers\etc\

 

If you find any entries containing your domain name delete them.

 

For example 127.0.0.1 test2.theundrground.net

 

That’s my best shot for now.

Link to comment
Share on other sites

OK Thanks Ric. I dont know why but I tried it again and now it works... :|

 

So weird..

 

I did looking in the hosts file.. it said 127.0.0.1 localhost and thats all

 

Thanks for your help anyways...

ATOMIC Web Hosting 2007 - 2011

Shared Hosting - Reseller Hosting - Dedicated Servers - Virtual Private Servers (Request Dedicated/VPS Servers via E-mail)

E-mail: sales@atomicwebhosting.com Website: http://www.atomicwebhosting.com/

Link to comment
Share on other sites

Glad you got it working yes computers are weird sometimes it is best just to restart the machine because you can be chasing a problem that does not exist. It is the interaction of so many parts that when you change one aspect creates the illusion of a problem. Been down this path may times myself.

 

One final point you state:

 

“I did looking in the hosts file.. it said 127.0.0.1 localhost and thats all”

 

That’s what I would expect.

 

:D

Link to comment
Share on other sites

  • 17 years later...

Have you tried setting up virtual hosts for subdomains? Looks like this could potentially solve your problem. If not, I'd suggest diving into the httpd.conf file and double-checking your configurations. Sometimes a small typo can cause real chaos.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...