Forum Moderators: coopster & phranque

Message Too Old, No Replies

[Apache] VirtualHosts on 'localhost'

How do I create VirtualHosts on my testserver?

         

GrodanBoll

4:51 pm on Mar 10, 2002 (gmt 0)



Hi

Can someone tell if I can create VirtualHosts on my testserver? I access the testserver by the usual 'http://localhost'.

If i can, how do I do it?

/Grodan :)

gethan

10:42 am on Mar 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The big advantage of using ports if you don't want to do DNS (or can't) and don't want to edit every hosts file on the network is that:

Your webserver is accessible by your colleagues boss what have you for every one on you network.

Eg. you can send out a mail saying

"for the latest version of my gumph take a look at

[yourmachine:81...]

And then continue coding on port 82 etc..

PsychoTekk

12:59 pm on Mar 11, 2002 (gmt 0)

10+ Year Member



hi gethan, and thanks :)
i assumed that i just needed to define listen & vhost
for additional hosts using port numbers different from the default
port defined by "Port:"
it's working here now, too :)

fred flinstone

5:20 pm on Apr 20, 2002 (gmt 0)



I just searched on in and found the message threads here great in getting my Apache on Win 98 to do virtual hosts.

So, I'd like to contribute ... for the next person that may come along.

Note: in my case instead of localhost I have "sodium" as my computer name.

In "Hosts" file (located in C:\Windows):
127.0.0.1 localhost
127.0.0.1 sodium
127.0.0.1 dev.sodium <-- I added

In httpd.conf file:

NameVirtualHost *

<VirtualHost *>
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs"
ServerName sodium
</VirtualHost>

<VirtualHost *>
ServerAdmin webmaster@morton
DocumentRoot "C:/Program Files/Apache Group/Apache/htdocs/manual"
ServerName dev.sodium
ErrorLog logs/dev.sodium.error.log
CustomLog logs/dev.sodium.access.log common
</VirtualHost>

sugarkane

12:21 pm on Apr 22, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Fred, thanks for that and welcome to the forum :)
This 34 message thread spans 2 pages: 34