Creating a new Virtual Host file
Let’s take advantage of the GUI provided by WinSCP to easily duplicate one of the available Virtual Host configuration files, to speed up the process of creation, we can then open it an modify it accordingly.
Here you can type the name of the Virtual Host and be sure the file ends with “.conf” because, Apache will go over these files to recognize and serve these Virtual Hosts based on the settings inside.
Duplicate and Edit
Immediately after the file is created (using the duplicate option) you have to open it and modify accordingly to reflect your new Virtual Host.
The following image shows how one of these files could look like, please be aware this is just an example, you can probably find more variations on the Internet.
Find and Replace using WinSCP
Because we are using an existing Virtual Host configuration file as a sort of template, this is the perfect place to use the WinSCP option “find and replace” to accelerate even more the creation of our file.
Another advantage of duplicating the file is that you don’t have to worry about the file ownership and permissions because both will be inherited from the original file.
Download Virtual Host template
In case you need a Virtual Host template, feel free to download the following one:
Where to go next?
Now that we have the “.conf” file for our brand new Virtual Host we can move to the next step.