This is the line that tells apache where to get this site from
DocumentRoot "c:/wamp/www/xyz"
It has absolutely nothing to do with the domain name and could be coded as
DocumentRoot "c:/websrc/xyz-site/www"
This line tells apache more about the sites requirements
<Directory "c:/wamp/www/xyz">
And should match the DocumentRoot
ServerName xyz.dev
ServerAlias xyz.dev
ServerName and ServerAlias allow you to do this, for example
ServerName xyz.dev
ServerAlias www.xyz.dev
If they are coded exacly the same having the ServerAlias achieve very little or nothing
Second Question:
You should have this in your HOSTS file, plus any testing domains you create for yourself.
127.0.0.1 localhost
::1 localhost
127.0.0.1 xyz.dev
::1 xyz.dev
So yes, remove those 2 #'s, they make the line a comment.
You should have an entry in the HOSTS file for each domain you want to create locally. Without an entry in here your invented testing domain names wont exist and your browser etc wont be able to find these domains when you use them in your browser address fields.
The HOSTS file is a bit like your own local DNS, its a hangover from before DNS Servers were invented. In those early days you had to remember the ip address of your favourite sites, so the HOSTS file was invented so you could give an ip address a name ( thats basically all DNS Servers do now ).
So for example in those days you might have had this in the HOSTS file
74.125.206.124 yahoo.com
89.31.144.147 wampserver.com
We now use this feature to allow us to create a domain name known only to us locally.
Some malware software use the HOSTS file to block access to bad sites and advertising networks, and put hundereds of the bad sites names in the HOSTS file and point them to 127.0.0.1 i.e. this PC, so you never get to them or see the adverts.
---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>Read The Manuals Apache --
MySQL --
PHP --
phpMyAdminGet your Apache/MySQL/mariaDB/PHP ADDONs here from the
WAMPServer alternate Repo-X-X-X-
Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-