user2965875
user2965875

Reputation: 701

How to Configure multiple sites locally?

I have set up wamp locally on my machine but i want to view multiple sites locally when i need to.

So far I have entered the following code in the hosts file

# localhost name resolution is handled within DNS itself.
#   127.0.0.1       localhost
#   ::1             localhost


127.0.0.1   mysitesname

How can i have multiple sites at once? is this possible?

Upvotes: 0

Views: 51

Answers (1)

Oswald
Oswald

Reputation: 31685

Configure name based virtual hosting, for example

# Only needed once.
NameVirtualHost *:80

# One section for each virtual host. Must
# match the "NameVirtualHost" directive.
<VirtualHost *:80>
    # The FQDN of the host.
    ServerName mysitesname

    # The file system path to the directory with
    # the files to serve by this virtual host.
    DocumentRoot /www/mysitesname
</VirtualHost>

Upvotes: 1

Related Questions