TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   apache virtual host (http://www.talkphp.com/general/3945-apache-virtual-host.html)

planepixel 02-06-2009 12:43 AM

apache virtual host
 
Hi i need to setup a virtual host on my system. i am running xampp and saved following code in httpd.conf ,
added "127.0.0.1 zendblog.localhost"
and restarted apache but it is not working.


Code:

<VirtualHost *:80>
    DocumentRoot "c:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "c:/xampp/htdocs/zendblog/public"
    ServerName zendblog.localhost
</VirtualHost>

in address bar i am writing zendblog.localhost

what i am doing wrong in the setup?
please advise
thanks

Wildhoney 02-06-2009 01:49 AM

I do something like the following. It's not currently set up, but in my old Apache config I see I did the following:

Code:

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
  DocumentRoot "C:\wamp\www\TalkPHP"
  ServerName talkphp.localhost
</VirtualHost>

Don't forget to restart Apache once modified.

planepixel 02-06-2009 02:11 AM

Thanks. in the mean time i was also searching for help on internet and found this link.
Name Based Virtual Host Guide

i was not using NameVirtualHost 127.0.0.1 directive which is must if name based virtual hosts are needed.

thanks for your help.


All times are GMT. The time now is 05:29 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0