The concept of hosting more than one website on the local server is called virtual hosting.
there is an long method for this but in this tutorial, we will use a bash script for virtual hosting.
For this tutorial, I am using kali Linux. but it is not necessary to use the Kali, you can use other Linux distributions.
And remember that this tutorial is only for Apache webserver. but the tool has an Nginx-web server script which allows you to virtual hosting on the Nginx web server.
STEPS
1.
download this script from here:Â https://clk.ink/fWFkmu
2.
you will need a template for hosting on web-server. download it from here: https://clk.ink/AHX4kD
3.
start your apache server:
service apace2 start
4.
go to the downloaded folder of tool and give it permission to execute:
chmod +x vritualhost.sh
5.
now run the script with its parameter:
./vritualhost.sh create <domain> <location of the template>
the create
is to create a domain. if you wish to delete a domain, you can just replace create
with delete
second, you can choose domain whatever you want. for example website.lol, example.io king.in
and in the last, we will assign the location of the web template
if you do not assign it, the script will add a domain but when you will open it, you will found nothing there.
that’s it. now you just have to open the assigned domain in the URL section of a browser or you can use ping command:
ping <your domain>
Thanks For Visiting.