I’ll go step-by-step on how to create a virtual host in the XAMPP environment.
As we know, the default http://localhost points to /opt/lampp/htdocs
as the root directory. The desired result is to be able to visit http://examplevhost.local, with the root directory being /opt/lampp/htdocs/examplevhost
.
Note: The steps below are done on Ubuntu 16.04, but they should also work on most other Linux distributions (Debian, Mint, Arch).
Note: I’ll assume that XAMPP is installed in
/opt/lampp/
. If it’s different on your setup, please read carefully and adjust accordingly.
Note: This should be done only once per XAMPP installation. If you want to add another virtual host later you can skip to the next step.