What combat.
To recap we've now set up two folders for each of our domains.
We've also created a default HMO file that will load when somebody visits each domain what we need to
do now is set up the new virtual host files for each domain in order for all of this to work.
This way each domain will point to its unique directory and the web page is contained within it.
The default configuration directive for a posh key is located at this path
the default dot com file instructs Apache which directory to serve content from when the server is only
hosting one domain.
We need to make the virtual host file for our first domain since this server will host multiple domains.
After this we'll create a virtual host file for our second and third and fourth and however many domains
you have to do this.
Start by making a new file by typing the following command.
Replace example dot com with your domain name
once you've done that go ahead and press Enter
once you're N.A. text editor.
Take the following text.
There's a few parameters which you'll need to change to reflect your domain name.
So the first one is the e-mail address.
The second is a server name and the server name is just your domain name without the w w w prefix the
server alias is your domain name.
With the w w w prefix
and once you've confirmed that everything is correct.
Go ahead and save the file so control X Y at the prompt and enter.
So once you finish with those modifications you need to enable this file using the following command.
OK I accidentally executed that before I'd made the changes.
So I just typed that in again.
Make sure you replace example dot com
with your domain name.
And press enter.
Once you've done that you'll see the message enabling site displayed and it will also instruct you to
restart Aposhian in order for you to activate this new configuration.
So go ahead and re reload Dabashi
after you typed in this command.
Press Enter
So now that we have our first virtual host file created and enabled we can go ahead and create the second
one the easiest way to do this is by duplicating the first one.
Renaming it and making whatever changes we need to make in the new duplicated file
to do that you're going to take the following command.
Sudo C-p just means copy and then you're instructing on which file you want copied.
So I'm going to copy the file that we already configured
and this is going to be the new duplicated file that's created.
We want the name of this file to be the second domain name
and press enter.
Now let's go ahead and open this file.
The second file we just created
we're opening it in nano
and we'll have to change the parameters this time to match the second domain name.
Again make sure you haven't made any spelling mistakes or typos.
And once you're OK with the changes save the file
type Y and press enter.
Now let's go ahead and enable this configuration that we just created as well.
So we're going to use that same command once again Sudol a to z.
And as I see
some We're doing this secondo me
and press ENTER
So now that we have the two virtual host files created for the two domain names we're going to disable
the default configuration file so type in the following
and press enter.
Now we'll need to reload Aposhian for all these changes to take effect.
Perfect.
We've now created the two virtual host files for each of our two domains and we've enabled them as well.
The next step in this process will be to configure our name servers with our domain name registrar.
So we'll see you in the next less.