5 Replies - 2030 Views - Last Post: 05 December 2012 - 05:40 AM

#1 dreamincodehamza  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: -12
  • View blog
  • Posts: 332
  • Joined: 12-September 08

vhost issue

Posted 02 December 2012 - 11:55 AM

hi
i am unable to define vhost on local machine.
please check below


enabled

Include conf/extra/httpd-vhosts.conf


httpd-vhosts.conf


<VirtualHost *:80>
    ServerAdmin ramesh@thegeekstuff.com
    DocumentRoot C:\wamp\www\cms
    ServerName top5freeware
	
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin ramesh@thegeekstufdf.com
    DocumentRoot C:\wamp\www
    ServerName localhost		
</VirtualHost>






hosts
127.0.0.1 localhost
127.0.0.1 top5freeware



dont no why it is not working at all i restated the appachi did evything that i know

Is This A Good Question/Topic? 0
  • +

Replies To: vhost issue

#2 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5247
  • View blog
  • Posts: 27,071
  • Joined: 10-May 07

Re: vhost issue

Posted 02 December 2012 - 01:54 PM

Are the .com addresses registered? If not, did you add them to your hosts file so they can resolve to localhost?

Just putting a dot com in the vhost file does not resolve the name to an address. It simply allows Apache to answer requests for the domain name. However the browser still needs to resolve a domain name to an ip address (be it external or internal) in order for the web server to host the site to a requesting browser. If the domain name is not able to be resolved, the Apache server isn't going to pick up the slack.

In other words, you can't just make up domain names, plug them into vhosts, & expect it to work.

If you open a command prompt & issue nslookup top5freeware what do you get?

Also, after editing the vhost configuration, did you restart the Apache server?
Was This Post Helpful? 0
  • +
  • -

#3 dreamincodehamza  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: -12
  • View blog
  • Posts: 332
  • Joined: 12-September 08

Re: vhost issue

Posted 02 December 2012 - 02:16 PM

@no2pencil
this is what i have got please see attachment image

i don't remember i restarted after editing host file let me give it a try again.
really wasted alote of my time in this time..
mind stop working at all .just hoping to have some help now.
let me change www or .com from server name first.



View Postno2pencil, on 02 December 2012 - 01:54 PM, said:

Are the .com addresses registered? If not, did you add them to your hosts file so they can resolve to localhost?

Just putting a dot com in the vhost file does not resolve the name to an address. It simply allows Apache to answer requests for the domain name. However the browser still needs to resolve a domain name to an ip address (be it external or internal) in order for the web server to host the site to a requesting browser. If the domain name is not able to be resolved, the Apache server isn't going to pick up the slack.

In other words, you can't just make up domain names, plug them into vhosts, & expect it to work.

If you open a command prompt & issue nslookup top5freeware what do you get?

Also, after editing the vhost configuration, did you restart the Apache server?

Was This Post Helpful? 0
  • +
  • -

#4 dreamincodehamza  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: -12
  • View blog
  • Posts: 332
  • Joined: 12-September 08

Re: vhost issue

Posted 02 December 2012 - 02:45 PM

i think i figure out the issue.
basically my antivirus not allowing me to edit host file.
i am modifing in text file mistakenly don't no how it is get created.
thanks for your time no2pencil.

can you tell me please bit about this nslookup top5freeware
how it is useful in identifying the issue.



View Postno2pencil, on 02 December 2012 - 01:54 PM, said:

Are the .com addresses registered? If not, did you add them to your hosts file so they can resolve to localhost?

Just putting a dot com in the vhost file does not resolve the name to an address. It simply allows Apache to answer requests for the domain name. However the browser still needs to resolve a domain name to an ip address (be it external or internal) in order for the web server to host the site to a requesting browser. If the domain name is not able to be resolved, the Apache server isn't going to pick up the slack.

In other words, you can't just make up domain names, plug them into vhosts, & expect it to work.

If you open a command prompt & issue nslookup top5freeware what do you get?

Also, after editing the vhost configuration, did you restart the Apache server?

Was This Post Helpful? 0
  • +
  • -

#5 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5247
  • View blog
  • Posts: 27,071
  • Joined: 10-May 07

Re: vhost issue

Posted 03 December 2012 - 07:14 AM

View Postdreamincodehamza, on 02 December 2012 - 04:45 PM, said:

can you tell me please bit about this nslookup top5freeware
how it is useful in identifying the issue.

nslookup resolves domain names, on the command line. If you get an address, then you know the issue is with apache. If you do not, then you know the browser isn't able to make a valid request.

Also, I don't know which OS you are running, but after XP, Microsoft requires administrator level to edit the hosts file. I would do this like so :

click on the orb, search for 'cmd', in the results right click 'cmd' & select "run as administrator". Select yes, & then in the command prompt type 'notepad C:\windows\system32\drivers\etc\hosts", edit & save.
Was This Post Helpful? 0
  • +
  • -

#6 dreamincodehamza  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: -12
  • View blog
  • Posts: 332
  • Joined: 12-September 08

Re: vhost issue

Posted 05 December 2012 - 05:40 AM

thank you so much.


View Postno2pencil, on 03 December 2012 - 07:14 AM, said:

View Postdreamincodehamza, on 02 December 2012 - 04:45 PM, said:

can you tell me please bit about this nslookup top5freeware
how it is useful in identifying the issue.

nslookup resolves domain names, on the command line. If you get an address, then you know the issue is with apache. If you do not, then you know the browser isn't able to make a valid request.

Also, I don't know which OS you are running, but after XP, Microsoft requires administrator level to edit the hosts file. I would do this like so :

click on the orb, search for 'cmd', in the results right click 'cmd' & select "run as administrator". Select yes, & then in the command prompt type 'notepad C:\windows\system32\drivers\etc\hosts", edit & save.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1