On 26/04/06, <b class="gmail_sendername">sukh virdee</b> <<a href="mailto:sukh_virdee@hotmail.com">sukh_virdee@hotmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>I've set up a virtual host on my dedicated server with a dummy domain name.<br>I only have one IP address for the server.<br><br>How can I access webpages that i have created for the virtual host through<br>my browser. I've heard that when using windows and IE you can make an
<br>addition to the host file and then you can access the dummy site through<br>the IP address...?<br><br></blockquote></div><br>In the httpd.conf (assuming it's called that in your distro), at the bottom put (it's probably there, commented out)
<br>- note: change <a href="http://192.168.10.1">192.168.10.1</a> to your IP address.<br><br>NameVirtualHost <a href="http://192.168.10.1">192.168.10.1</a><br><br><VirtualHost <a href="http://192.168.10.1">192.168.10.1
</a>><br> ServerName <a href="http://someserver.yourdomain.com">someserver.yourdomain.com</a><br> DocumentRoot /www/someserver_site<br> DirectoryIndex index.htm<br> ErrorLog logs/someserver_errorlog<br> CustomLog logs/someserver_accesslog combined
<br></VirtualHost><br><br><br><VirtualHost <a href="http://192.168.10.1">192.168.10.1</a>><br>
ServerName <a href="http://alternative.yourdomain.com">alternative.yourdomain.com</a><br>
DocumentRoot /www/alternative_site<br>
DirectoryIndex index.htm<br>
ErrorLog logs/alternative_errorlog<br>
CustomLog logs/alternative_accesslog combined<br>
</VirtualHost><br>
<br>
<br>The "ServerName" directives inform Apache what to look for in the Host header (passed by pretty much all browsers). If you want alternatives for the same site, use "ServerAlias" and then the full host name.
<br><br><br>Hope that helps,<br><br>Dave.<br>