[Phpwm] virtual hosts in apache
Dave Brotherstone
davegb at pobox.com
Wed Apr 26 21:11:04 BST 2006
On 26/04/06, sukh virdee <sukh_virdee at hotmail.com> wrote:
>
> Hi,
> I've set up a virtual host on my dedicated server with a dummy domain
> name.
> I only have one IP address for the server.
>
> How can I access webpages that i have created for the virtual host through
> my browser. I've heard that when using windows and IE you can make an
> addition to the host file and then you can access the dummy site through
> the IP address...?
>
>
In the httpd.conf (assuming it's called that in your distro), at the bottom
put (it's probably there, commented out)
- note: change 192.168.10.1 to your IP address.
NameVirtualHost 192.168.10.1
<VirtualHost 192.168.10.1>
ServerName someserver.yourdomain.com
DocumentRoot /www/someserver_site
DirectoryIndex index.htm
ErrorLog logs/someserver_errorlog
CustomLog logs/someserver_accesslog combined
</VirtualHost>
<VirtualHost 192.168.10.1>
ServerName alternative.yourdomain.com
DocumentRoot /www/alternative_site
DirectoryIndex index.htm
ErrorLog logs/alternative_errorlog
CustomLog logs/alternative_accesslog combined
</VirtualHost>
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.
Hope that helps,
Dave.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.lug.org.uk/pipermail/phpwm/attachments/20060426/9b5aed51/attachment.html
More information about the Phpwm
mailing list