Jump to content
The Uniform Server Community

Can't make only one Virtual host why??


Amjad
 Share

Recommended Posts

Haye

I am using uniform server 3.3 its working fine and excellent on my local machine with localhost...but when i tried to host multiple domains upon it goes undergrouond means stopped working...as mentioned in different articles i had modified httpd.conf & hosts file in my apache as well as windows folder but it'snt seems to be worked..why it is? I put the following text in my httpd.conf file;

NameVirtualHost *:80

 

<VirtualHost *:80>

 

ServerName skylink

DocumentRoot "www/skylink"

 

</VirtualHost>

 

after putting it i had edited the hosts file in windows directory and at the end it looks like that;

# 102.54.94.97 rhino.acme.com # source server

# 38.25.63.10 x.acme.com # x client host

 

127.0.0.1 localhost

127.0.0.1 localhost:80

127.0.0.1 skylink # Skylink test

 

after doing that i had started my uniserver and typed http://skylink it said document not found (but i had placed each & everything there in www directory & skylink directory) when i tried it by just typing http://localhost same error document not find even though it's same on writting http://127.0.0.1..Why its doing so..please any one if knows the right place.....as i had read the whole documentation... please tell me here or mail me.....i shall be very thankful to you..

Link to comment
Share on other sites

You could try to replace DocumentRoot "www/skylink" with DocumentRoot /www/skylink :)

THANKS MRX i did the same but the problem persists...when i uses it on a single pc it works fine but when i connects my pc with local interanet it goes on finding & finding...i am using ISA server at my main server maching with Ip 192.168.0.1 & on ip 192.168.0.2 i want to make my own virtual host but it seems workless...all my efforts are vain to do so..i had read the related apache config pages & somehow uniformserver pages too but nothing could solve this problem..please help me how to do so....how to edit my hosts file what ip i'll have to give over there for my localhost or any server name i choose...

Link to comment
Share on other sites

If you have not changed these lines in config:

Listen 80

ServerName localhost:80

 

and (Towards the end of the config file) made sure this line is uncommented:

 

NameVirtualHost *

 

Then this is correct

 

ServerName skylink

DocumentRoot "www/skylink"

 

Every thing arriving at port 80 will be passed to the server for checking

 

On the local machine the hosts file contains:

127.0.0.1 skylink # Skylink test

 

The browsers resolves skylink to address 127.0.0.1 from the hosts file and then adds: 80

 

It then requests the page by outputing IP address 127.0.0.1:80 so whatever is on the localcal machine and listing to port 80 receives this request. Well in this case the Apache server, it cannot match a server name of “localhost” and passes it to the Virtual host block where it matches a server named “skylink” (contained in the header) and gets it output from folder www/skylink.

 

Now if you have the same hosts file on a remote machine. When the browser comes to resolve the name “skylink” it will resolve to 127.0.0.1:80 not the intention since the server resides on 192.168.0.2 so on this remote machine the hosts entry should be

 

192.168.0.2 skylink # Skylink test

 

The browser now resolves “skylink” to 192.168.0.2:80 and outputs a page request to your virtual server machine.

 

Hope that makes sense :)

Link to comment
Share on other sites

...

 

ServerName skylink

DocumentRoot "www/skylink"

 

...

One question, Ric, if you use "www/skylink", Apache looks for W:\www\www\skylink but if you use "/www/skylink", Apache looks for W:\www\skylink, am I right?

Link to comment
Share on other sites

  • 2 weeks later...

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...