Create unlimited subdomains on DigitalOcean & configure apache vhost

Hello guys! hope you’re doing good. This
is silverFoxA and today I’m going to share with you how to create subdomains on DigitalOcean. In our previous video we discussed on how to link our domain to the
DigitalOcean server and incase you haven’t checked that, I will put the link in the
description hope you’ll find it informative enough let’s get started
with creating a subdomain. For that lets go to our DigitalOcean console. Let’s
open up the terminal, we’ll just go to the droplet that you have created
last time. okay! Now we need to get into the terminal and access the droplet. I showed
you how to do that in the previous video we’re accessing as the root user will
copy this ipv4 address It will ask you for the
password. okay! Once you are in, you will get to see the phpMyAdmin credentials here.
Let me just arrange the terminal window for a second. If you like this
application I’ll put the link in the description.
It’s called magnet comes really handy when you want to manage all the windows
on your screen. This is the HTML directory which gets
reflected when I type in Now we want to create a subdomain
so let’s create a separate directory for that or label it as subdomain for now the director has been created now we
need to grant it the read write permission it has required permission. Just get into
subdomain directory. We will create a simple HTML file so that to you get to see if it’s
working fine or not okay it works fine one more thing that we need to do here
for the first thing I’ll come to Networking. Let’s get into the domain,, which we have configured previously. Now we need to create a
subdomain right! so what would be that name. For this, let’s give it as test that
would be a subdomain name so here you can see total so that way the subdomain has been created for it it’s
not gated we have to do it now now it needs to be redirected to a droplet now
all these are private or droplet like private networking has been enabled for
all of those that we did in the previous one so we’ll just select this classicflowerdecorator so this is the sub domain which has been
created for us now if you try to see it will redirect to the home page that is In-order for sub domain to work we have to
include the virtual host and configure it that we will do and before that let
us create a CNAME record I believe you know what is a CNAME record as we have
done it in the previous one. Okay! so our CNAME because they’ve been configured and
I will just copy the URL that will be heading creating or configuring our
children let’s go to the root territory now from here we have to go to etc. Okay!
before creating a virtual host you need to ensure that Apache is installed
okay and if in case it’s not installed sudo apt-get install apache. Install apache installed cause we chose that one click
application with the LAMP configuration where Apache PHP MySQL and all this
things are already installed so we need not get bugged with that but in case if
you don’t have just try to install those I will go to cd /etc/apache2/sites-available So we want to copy the
default configuration that we have here copy this into a test. run to start
conquer configuration so now we’ll activate the config file okay this is a dummy one now we need to
configure the server name here server name is a thing and we need to assign a
server allias because we want it to work under our triple W thing now we need to
ensure the document root is set properly so our directory was under w-w-w and
within that we have something called sub domain so that thing is configured now
for some applications they might need you to redirect all the traffic to
public directory so in that case within the directory
there will be a subdirectory called public I’ll share with you in description
regarding this stuff in next video where we’ll be installing slim
framework on digitalocean server plus the slim skeleton okay once this is
done we need to ensure that the virtual host is virtuous files are enable to do
that we’ll go to a pseudo Co to a user that is the root easier and we will
enable the virtual host country okay so yeah we could enable now one more
command that you have to type in to ensure that the default configuration
are not active right to do that okay for me I have already created sub domain
called pub life with where all the library files are residing anyway I’ll
just key in the command so that we can see and Casey have been done can do the
same it says it has been already disabled now
we need to restart our apache server for it to work let’s taste so it’s working fine hope
you find the video informative enough please do subscribe my channel and like
our cell whichever you prefer the best thank you

Daniel Ostrander

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *