Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have problem.... :D How to create a virtual host on 64bits W7????? In 32 bits it was enough to add e.g.

<VirtualHost localhost/Story>
<Directory "C:/xampp/htdocs/Story/public">
Options FollowSymLinks
AllowOverride All
</Directory>

DocumentRoot C:/xampp/htdocs/Story/public
ServerName localhost/Story
CustomLog C:/xampp/htdocs/Story/log combined
</VirtualHost>

And in system32 in hosts: 127.0.0.1 localhost/Story

But in 64bits it is ignoring :/ What I should do?


Ok more datails:

In my apache conf file I have:

<VirtualHost localhost/Story>
<Directory "C:/xampp/htdocs/Story/public">
Options FollowSymLinks
AllowOverride All
</Directory>

DocumentRoot C:/xampp/htdocs/Story/public
ServerName localhost/Story
CustomLog C:/xampp/htdocs/Story/log combined
</VirtualHost>

In my C:\Windows\System32\drivers\ect\hosts 127.0.0.1 localhost/Story

In my Netbeans prooject run path is set:

http://localhost/Story/

So I think now if I run my project he will use this configured localhost/Story virtual host and should automatically redirect my application to C:/xampp/htdocs/Story/public because I have configured this virtual host in my httpd.conf file. Am I right?

On my another laptop where is 32bits system this configuration is working and when I write: localhost/Story my application is working because this virtual host redirect it to the public folder. On 64 bits system when I write localhost/Story I see only tree of files that means my virtual host is not working correctly :/ But I can not understand why:/

share|improve this question

migrated from stackoverflow.com Feb 15 '11 at 16:03

This question came from our site for professional and enthusiast programmers.

    
Should this be on Server fault? –  Preet Sangha Feb 14 '11 at 22:05
1  
There is no fundamental difference for this in 32 and 64 bit systems. Elaborate a bit more what you are doing –  Pekka 웃 Feb 14 '11 at 22:07

1 Answer 1

up vote 0 down vote accepted

If, and absolutely If, this ever worked it was absolutely not valid. Neither is localhost/story a valid hostname nor is the Configuration valid since the apache documentation states that the Directive takes one argument addr which can be:

  • The IP address of the virtual host;
  • A fully qualified domain name for the IP address of the virtual host;
  • The character *, which is used only in combination with NameVirtualHost * to match all IP addresses; or
  • The string _default_, which is used only with IP virtual hosting to catch unmatched IP addresses.

You are using an URI including a path, but omitting the protocol.

Update

Regarding the points above you should clearly see that, either you made a weird mistake or you might not have fully understood the concepts of HTTP (especially HTTP/1.1) and Virtualhosting. You might have been missing even some points about networking in basics.

That's no problem since there are lots of good resources to learn from. What might be working (at least it should be valid):

NameVirtualHost *

<VirtualHost localhost>
    <Directory "C:/xampp/htdocs/Story/public">
       Options FollowSymLinks
       AllowOverride All
    </Directory>

    DocumentRoot C:/xampp/htdocs/Story/public
    ServerName localhost
    CustomLog C:/xampp/htdocs/Story/log combined
</VirtualHost>
share|improve this answer
    
Yes, probably You are right, I dont know why on the another laptop it is working correctly :D but there is older xampp, Thanks I will check if it will work or not ;) –  canimbenim Feb 16 '11 at 12:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.