Reputation: 25733
in wamp setup, i am unable to set virtual host for my application.
Appache; D:\wamp\bin\apache\apache2.2.8\conf\extra
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
<VirtualHost 127.0.0.1>
DocumentRoot "D:/wamp/www/"
ServerName www.example.org
# ...
</VirtualHost>
<VirtualHost 127.0.0.1>
DocumentRoot D:/wamp/www/facebook_post_style
ServerName www.example.net
ServerAlias *.example.net
# ...
</VirtualHost>
in host
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 www.example.org
127.0.0.1 www.example.net
I did above configuration. For both domain, same output is displaying.
please check this below URL.
Upvotes: 0
Views: 277
Reputation: 25733
With below stuff virtual host worked Apache;
D:\wamp\bin\apache\apache2.2.8\conf\extra
<VirtualHost *:80>
ServerAdmin [email protected]
#DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host.localhost"
DocumentRoot "D:/wamp/www/"
ServerName localhost
#ServerAlias www.dummy-host.localhost
ErrorLog "logs/dummy-host.localhost-error.log"
CustomLog "logs/dummy-host.localhost-access.log" common
<VirtualHost *:80>
ServerAdmin [email protected]
# DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
DocumentRoot "D:/wamp/www/facebook_post_style"
ServerName localhost1
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin [email protected]
# DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost"
DocumentRoot "D:/wamp/www/crop"
ServerName www.example.net
ErrorLog "logs/dummy-host2.localhost-error.log"
CustomLog "logs/dummy-host2.localhost-access.log" common
</VirtualHost>
in host:
C:\Windows\System32\drivers\etc\hosts
127.0.0.1 localhost
127.0.0.1 localhost1
127.0.0.1 www.example.net
click on the wamp icon in task bar > Apache > httpd.conf
enable below line
Include conf/extra/httpd-vhosts.conf
Upvotes: 0
Reputation: 3108
try this
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "D:\wamp\www\facebook_post_style"
ServerName www.example.net
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "D:\wamp\www\FolderName"
ServerName www.example.org
</VirtualHost>
also make sure you have uncommented the following line from httpd.conf file
Include conf/extra/httpd-vhosts.conf
check this article for details
Upvotes: 1