3

Well,

I know how to do virtual hosts, but on windows it looks harder to get what i want to.

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "C:/wamp/www/domaindev_com/public"
    ServerName domaindev.com
    ServerAlias *.domaindev.com
    ErrorLog "logs/domaindev_com-error.log"
    CustomLog "logs/domaindev_com-access.log" common
</VirtualHost>

And my hosts file:

# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.

127.0.0.1      localhost
192.168.0.1    domaindev.com
192.168.0.1    www.domaindev.com

C:\Documents and Settings\B>ping domaindev.com

Pinging domaindev.com [192.168.0.1] with 32 bytes of data:

Reply from 192.168.0.1: bytes=32 time<1ms TTL=128
Reply from 192.168.0.1: bytes=32 time<1ms TTL=128
Reply from 192.168.0.1: bytes=32 time<1ms TTL=128
Reply from 192.168.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

C:\Documents and Settings\B>ping www.domaindev.com

Pinging www.domaindev.com [192.168.0.1] with 32 bytes of data:

Reply from 192.168.0.1: bytes=32 time<1ms TTL=128
Reply from 192.168.0.1: bytes=32 time<1ms TTL=128
Reply from 192.168.0.1: bytes=32 time<1ms TTL=128
Reply from 192.168.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 192.168.0.1:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

So it looks like it works. But when i try to use the www.domaindev.com in my browser i get a time out or a dns failure...

Any ideas ? Is the ServerAlias option wrong ?

EDIT: Only the domaindev.com is working

4 Answers 4

2

Have you tested changing the ServerAlias directive to the absolute URL www.domaindev.com and trying that?

Your browser may have also cached the failed DNS request and hasn't tried it again - usually killing all browser sessions will help with that.

0

These configuration files are on a server, right? And the browser you're trying to load it up in is on your personal machine, not the server? Because, see, when you put 192.168.0.1 www.domaindev.com in the hosts file, it only makes it resolve on that machine, not any other. Try putting it in your workstation's hosts file too.

1
  • Both server and browser are on the same computer. Jun 1, 2009 at 22:59
0

Can you access the site via domaindev.com? via the ip address? If you can't it's not a resolution problem but an apache config/startup problem as the server is not running.

2
  • I'm able to access to domaindev.com (and ip address) Jun 2, 2009 at 10:52
  • hmm, this shouldn't make a difference but i would try to adjust your hosts file to have 1 192 line so i would read '192.168.0.1 domaindev.com www.domaindev.com' also i would try putting domaindev.com and wwww.domaindev.com on the 127.0.0.1 line once again shouldn't make a difference
    – Zypher
    Jun 2, 2009 at 13:12
0

Do you have any active proxy configuration in your webbrowser? Try to deactivate the proxy. Sometimes the command "ipconfig /flushdns" exectued in a command prompt helps.

Have you already tried to connect to your website with "domaindev.com"? If this works than you have to change your ServerAlias directive to an fqdn. http://httpd.apache.org/docs/2.0/mod/core.html#serveralias

1
  • ServerName directive is required as the fqdn - the ServerAlias is not. Jun 2, 2009 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .