setting up subdomain on ubuntu serverHow do I make a subdomain (e.g. mirror.site.com) on a LAMP server?Apache subdomain redirects to main domainAssociate part of VPS server to an external subdomainNoip not working on ubuntu 12.10Setting up subdomains for ubuntu server 14.04?Locking down an apache server - Prevent '/' page from being visible to allPHP-GD ownCloud issueApache2 - SSH - LetsEncrypt SSL - Certbot - Proxy - Manual Setup: How to achieve this?don't have permission to access / on this server
Implement the Max-Pooling operation from Convolutional Neural Networks
What type of beer is best for beer battered fish?
Is it a good idea to contact a candidate?
Does quickening a spell change the kind of action it grants?
Where does the term "dropship" come from?
Improving the observation skill & making less blunders
Why do airports in the UK have so few runways?
Well-known American figure with Roman numerals
What (if anything) could have caused all three shuttle main engines to stop at the same time?
Why did Leia not want to tell Han the truth about Luke and herself?
How to start toward financial independence
Is writing recommendation letter job for a faculty required?
Constraint of NDSolve with an integral of the solution
Is it sportsmanlike to waste opponents' time by giving check at the end of the game?
What would make the internet go away?
Printing the bits of an integer using bitfields and union
Getting health insurance with the highest deductible and putting the savings in HSA
Should a middle class person emulate a very wealthy investor for % of cash hold?
Can "marriage" be used as a verb?
Ball-passing game with a surprise ending
Need Good OOP Design For World and Countries Problem
Multiple premoves
How to respect Single responsibility principle and use exception handling at the same time?
What on earth is this small wall-mounted computer?
setting up subdomain on ubuntu server
How do I make a subdomain (e.g. mirror.site.com) on a LAMP server?Apache subdomain redirects to main domainAssociate part of VPS server to an external subdomainNoip not working on ubuntu 12.10Setting up subdomains for ubuntu server 14.04?Locking down an apache server - Prevent '/' page from being visible to allPHP-GD ownCloud issueApache2 - SSH - LetsEncrypt SSL - Certbot - Proxy - Manual Setup: How to achieve this?don't have permission to access / on this server
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I have a server at mysite.no-ip.org. Everything is working fine and I have a blog and owncloud that I access writing mysite.no-ip.org/blog and mysite.no-ip.org/owncloud.
Now, I want to create subdomains so that I can write blog.mysite.no-ip.org and owncloud.mysite.no-ip.org.
I have looked a lot into it and the simplest tutorial was this one which I followed.
http://www.bcat.eu/blog/local-subdomains-under-ubuntu-linux-and-apache-2-4-tutorial/
Except that I am not on my server but ssh into it remotely so if I use localhost I cannot see if this works I believe. This is my first obstacle, can I follow this tutorial without being present next to the server?
I also just discovered CNAME records which (I am not completely sure) seem necessary to what I want to do. I use no-ip.org and I have tried to follow something like this but this is not really clear either https://support.uberflip.com/entries/235780-4-4-5-how-to-setup-a-cname-redirect#noip
Does anyone have any pointers? This is quite shady to me and I have no idea if I am far from the solution or really close (at least if I could try localhost that would be a first step in order to check my Apache conf but I can't even do it since I ssh).
Anyways, thanks for your help in advance. Any help, link is welcomed.
server apache2 websites
add a comment
|
I have a server at mysite.no-ip.org. Everything is working fine and I have a blog and owncloud that I access writing mysite.no-ip.org/blog and mysite.no-ip.org/owncloud.
Now, I want to create subdomains so that I can write blog.mysite.no-ip.org and owncloud.mysite.no-ip.org.
I have looked a lot into it and the simplest tutorial was this one which I followed.
http://www.bcat.eu/blog/local-subdomains-under-ubuntu-linux-and-apache-2-4-tutorial/
Except that I am not on my server but ssh into it remotely so if I use localhost I cannot see if this works I believe. This is my first obstacle, can I follow this tutorial without being present next to the server?
I also just discovered CNAME records which (I am not completely sure) seem necessary to what I want to do. I use no-ip.org and I have tried to follow something like this but this is not really clear either https://support.uberflip.com/entries/235780-4-4-5-how-to-setup-a-cname-redirect#noip
Does anyone have any pointers? This is quite shady to me and I have no idea if I am far from the solution or really close (at least if I could try localhost that would be a first step in order to check my Apache conf but I can't even do it since I ssh).
Anyways, thanks for your help in advance. Any help, link is welcomed.
server apache2 websites
add a comment
|
I have a server at mysite.no-ip.org. Everything is working fine and I have a blog and owncloud that I access writing mysite.no-ip.org/blog and mysite.no-ip.org/owncloud.
Now, I want to create subdomains so that I can write blog.mysite.no-ip.org and owncloud.mysite.no-ip.org.
I have looked a lot into it and the simplest tutorial was this one which I followed.
http://www.bcat.eu/blog/local-subdomains-under-ubuntu-linux-and-apache-2-4-tutorial/
Except that I am not on my server but ssh into it remotely so if I use localhost I cannot see if this works I believe. This is my first obstacle, can I follow this tutorial without being present next to the server?
I also just discovered CNAME records which (I am not completely sure) seem necessary to what I want to do. I use no-ip.org and I have tried to follow something like this but this is not really clear either https://support.uberflip.com/entries/235780-4-4-5-how-to-setup-a-cname-redirect#noip
Does anyone have any pointers? This is quite shady to me and I have no idea if I am far from the solution or really close (at least if I could try localhost that would be a first step in order to check my Apache conf but I can't even do it since I ssh).
Anyways, thanks for your help in advance. Any help, link is welcomed.
server apache2 websites
I have a server at mysite.no-ip.org. Everything is working fine and I have a blog and owncloud that I access writing mysite.no-ip.org/blog and mysite.no-ip.org/owncloud.
Now, I want to create subdomains so that I can write blog.mysite.no-ip.org and owncloud.mysite.no-ip.org.
I have looked a lot into it and the simplest tutorial was this one which I followed.
http://www.bcat.eu/blog/local-subdomains-under-ubuntu-linux-and-apache-2-4-tutorial/
Except that I am not on my server but ssh into it remotely so if I use localhost I cannot see if this works I believe. This is my first obstacle, can I follow this tutorial without being present next to the server?
I also just discovered CNAME records which (I am not completely sure) seem necessary to what I want to do. I use no-ip.org and I have tried to follow something like this but this is not really clear either https://support.uberflip.com/entries/235780-4-4-5-how-to-setup-a-cname-redirect#noip
Does anyone have any pointers? This is quite shady to me and I have no idea if I am far from the solution or really close (at least if I could try localhost that would be a first step in order to check my Apache conf but I can't even do it since I ssh).
Anyways, thanks for your help in advance. Any help, link is welcomed.
server apache2 websites
server apache2 websites
edited Jan 17 '16 at 0:12
Eric Leschinski
1,6011 gold badge14 silver badges21 bronze badges
1,6011 gold badge14 silver badges21 bronze badges
asked May 9 '14 at 21:47
user1983400user1983400
1981 gold badge3 silver badges4 bronze badges
1981 gold badge3 silver badges4 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
This is actually really easy.
First make sure your DNS is working. You can use a A
, AAAA
or CNAME
record as long as it points to your IP address.
Please check if it's working before you continue! This will save you much trouble. You can check using ping subdomain.mydomain.com
or nslookup subdomain.mydomain.com
. If it's pointing to your IP address you're good.
Note that DNS changes may take up to 24 hours. If you want to continue now, you can edit your hosts file to manually add the sub domain. Note that this will only work for your current PC so you should check your DNS again 24 hours later to make sure it's working elsewhere as well (don't forget to revert your changes to your hosts file before you check).
To do this:
sudo nano /etc/hosts
add line like (replacing the IP and hostname of course):
34.54.235.64 subdomain.mydomain.com
and save the file.
Now update your Apache2 configuration.
Just adding this VirtualHost will do:
<VirtualHost *:80>
ServerName subdomain.mydomain.com
DocumentRoot /var/www/subdomain.mydomain.com
</VirtualHost>
Now create /var/www/subdomain.mydomain.com
and restart Apache2:
mkdir -p /var/www/subdomain.mydomain.com
sudo service apache2 restart
enable the site:
sudo a2ensite subdomain.mydomain.com
Repeat this for every sub domain you want to add.
2
Great this works! Thank you very much. Last point, but it might be because of no-ip, I managed to make it work but using the address blog-mysite.no-ip.org when I registered the subdomain. I couldnt write blog.mysite.no-ip.org (message:invalid hostname)...now, is this because no-ip wants me to pay or did I do something wrong?
– user1983400
May 9 '14 at 22:28
I don't know if no-ip allows you to create sub domains. If they do, it may take 24 hours before it's working as I said in my answer. Try to reach it again tomorrow. Also, I see you're usingblog-mysite
first and thenblog.mysite
. This is not the same, so if you chose the first you'll have to use that one. Don't forget to update your Apache2 config in that case.
– Louis Matthijssen
May 9 '14 at 22:34
Hey, yes sorry that is what I meant. No-ip would only let me create a subdomain with a dash and not a period. Is this no-ip restricting my free account with them? There shouldnt be reason you couldnt otherwise, should it?
– user1983400
May 9 '14 at 22:41
I think so. I don't use no-ip. If you really want to know you should contact their support. You could also buy your own domain (like mydomain.com). This way you'll have full control of your DNS and you can add as many subdomains you want. It's not so expensive, just make sure you don't order hosting with it (this makes it expensive). Prices are usually per year and I think you can get a domain for around 10$/year.
– Louis Matthijssen
May 9 '14 at 22:46
I rolled back the last edit, as changing ownership to the apache user on the document root directory is not needed, and can even be a security risk. It is enough to give read access to the directory.
– Dan
Mar 1 '17 at 13:29
|
show 1 more comment
protected by Community♦ Sep 25 '18 at 8:58
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This is actually really easy.
First make sure your DNS is working. You can use a A
, AAAA
or CNAME
record as long as it points to your IP address.
Please check if it's working before you continue! This will save you much trouble. You can check using ping subdomain.mydomain.com
or nslookup subdomain.mydomain.com
. If it's pointing to your IP address you're good.
Note that DNS changes may take up to 24 hours. If you want to continue now, you can edit your hosts file to manually add the sub domain. Note that this will only work for your current PC so you should check your DNS again 24 hours later to make sure it's working elsewhere as well (don't forget to revert your changes to your hosts file before you check).
To do this:
sudo nano /etc/hosts
add line like (replacing the IP and hostname of course):
34.54.235.64 subdomain.mydomain.com
and save the file.
Now update your Apache2 configuration.
Just adding this VirtualHost will do:
<VirtualHost *:80>
ServerName subdomain.mydomain.com
DocumentRoot /var/www/subdomain.mydomain.com
</VirtualHost>
Now create /var/www/subdomain.mydomain.com
and restart Apache2:
mkdir -p /var/www/subdomain.mydomain.com
sudo service apache2 restart
enable the site:
sudo a2ensite subdomain.mydomain.com
Repeat this for every sub domain you want to add.
2
Great this works! Thank you very much. Last point, but it might be because of no-ip, I managed to make it work but using the address blog-mysite.no-ip.org when I registered the subdomain. I couldnt write blog.mysite.no-ip.org (message:invalid hostname)...now, is this because no-ip wants me to pay or did I do something wrong?
– user1983400
May 9 '14 at 22:28
I don't know if no-ip allows you to create sub domains. If they do, it may take 24 hours before it's working as I said in my answer. Try to reach it again tomorrow. Also, I see you're usingblog-mysite
first and thenblog.mysite
. This is not the same, so if you chose the first you'll have to use that one. Don't forget to update your Apache2 config in that case.
– Louis Matthijssen
May 9 '14 at 22:34
Hey, yes sorry that is what I meant. No-ip would only let me create a subdomain with a dash and not a period. Is this no-ip restricting my free account with them? There shouldnt be reason you couldnt otherwise, should it?
– user1983400
May 9 '14 at 22:41
I think so. I don't use no-ip. If you really want to know you should contact their support. You could also buy your own domain (like mydomain.com). This way you'll have full control of your DNS and you can add as many subdomains you want. It's not so expensive, just make sure you don't order hosting with it (this makes it expensive). Prices are usually per year and I think you can get a domain for around 10$/year.
– Louis Matthijssen
May 9 '14 at 22:46
I rolled back the last edit, as changing ownership to the apache user on the document root directory is not needed, and can even be a security risk. It is enough to give read access to the directory.
– Dan
Mar 1 '17 at 13:29
|
show 1 more comment
This is actually really easy.
First make sure your DNS is working. You can use a A
, AAAA
or CNAME
record as long as it points to your IP address.
Please check if it's working before you continue! This will save you much trouble. You can check using ping subdomain.mydomain.com
or nslookup subdomain.mydomain.com
. If it's pointing to your IP address you're good.
Note that DNS changes may take up to 24 hours. If you want to continue now, you can edit your hosts file to manually add the sub domain. Note that this will only work for your current PC so you should check your DNS again 24 hours later to make sure it's working elsewhere as well (don't forget to revert your changes to your hosts file before you check).
To do this:
sudo nano /etc/hosts
add line like (replacing the IP and hostname of course):
34.54.235.64 subdomain.mydomain.com
and save the file.
Now update your Apache2 configuration.
Just adding this VirtualHost will do:
<VirtualHost *:80>
ServerName subdomain.mydomain.com
DocumentRoot /var/www/subdomain.mydomain.com
</VirtualHost>
Now create /var/www/subdomain.mydomain.com
and restart Apache2:
mkdir -p /var/www/subdomain.mydomain.com
sudo service apache2 restart
enable the site:
sudo a2ensite subdomain.mydomain.com
Repeat this for every sub domain you want to add.
2
Great this works! Thank you very much. Last point, but it might be because of no-ip, I managed to make it work but using the address blog-mysite.no-ip.org when I registered the subdomain. I couldnt write blog.mysite.no-ip.org (message:invalid hostname)...now, is this because no-ip wants me to pay or did I do something wrong?
– user1983400
May 9 '14 at 22:28
I don't know if no-ip allows you to create sub domains. If they do, it may take 24 hours before it's working as I said in my answer. Try to reach it again tomorrow. Also, I see you're usingblog-mysite
first and thenblog.mysite
. This is not the same, so if you chose the first you'll have to use that one. Don't forget to update your Apache2 config in that case.
– Louis Matthijssen
May 9 '14 at 22:34
Hey, yes sorry that is what I meant. No-ip would only let me create a subdomain with a dash and not a period. Is this no-ip restricting my free account with them? There shouldnt be reason you couldnt otherwise, should it?
– user1983400
May 9 '14 at 22:41
I think so. I don't use no-ip. If you really want to know you should contact their support. You could also buy your own domain (like mydomain.com). This way you'll have full control of your DNS and you can add as many subdomains you want. It's not so expensive, just make sure you don't order hosting with it (this makes it expensive). Prices are usually per year and I think you can get a domain for around 10$/year.
– Louis Matthijssen
May 9 '14 at 22:46
I rolled back the last edit, as changing ownership to the apache user on the document root directory is not needed, and can even be a security risk. It is enough to give read access to the directory.
– Dan
Mar 1 '17 at 13:29
|
show 1 more comment
This is actually really easy.
First make sure your DNS is working. You can use a A
, AAAA
or CNAME
record as long as it points to your IP address.
Please check if it's working before you continue! This will save you much trouble. You can check using ping subdomain.mydomain.com
or nslookup subdomain.mydomain.com
. If it's pointing to your IP address you're good.
Note that DNS changes may take up to 24 hours. If you want to continue now, you can edit your hosts file to manually add the sub domain. Note that this will only work for your current PC so you should check your DNS again 24 hours later to make sure it's working elsewhere as well (don't forget to revert your changes to your hosts file before you check).
To do this:
sudo nano /etc/hosts
add line like (replacing the IP and hostname of course):
34.54.235.64 subdomain.mydomain.com
and save the file.
Now update your Apache2 configuration.
Just adding this VirtualHost will do:
<VirtualHost *:80>
ServerName subdomain.mydomain.com
DocumentRoot /var/www/subdomain.mydomain.com
</VirtualHost>
Now create /var/www/subdomain.mydomain.com
and restart Apache2:
mkdir -p /var/www/subdomain.mydomain.com
sudo service apache2 restart
enable the site:
sudo a2ensite subdomain.mydomain.com
Repeat this for every sub domain you want to add.
This is actually really easy.
First make sure your DNS is working. You can use a A
, AAAA
or CNAME
record as long as it points to your IP address.
Please check if it's working before you continue! This will save you much trouble. You can check using ping subdomain.mydomain.com
or nslookup subdomain.mydomain.com
. If it's pointing to your IP address you're good.
Note that DNS changes may take up to 24 hours. If you want to continue now, you can edit your hosts file to manually add the sub domain. Note that this will only work for your current PC so you should check your DNS again 24 hours later to make sure it's working elsewhere as well (don't forget to revert your changes to your hosts file before you check).
To do this:
sudo nano /etc/hosts
add line like (replacing the IP and hostname of course):
34.54.235.64 subdomain.mydomain.com
and save the file.
Now update your Apache2 configuration.
Just adding this VirtualHost will do:
<VirtualHost *:80>
ServerName subdomain.mydomain.com
DocumentRoot /var/www/subdomain.mydomain.com
</VirtualHost>
Now create /var/www/subdomain.mydomain.com
and restart Apache2:
mkdir -p /var/www/subdomain.mydomain.com
sudo service apache2 restart
enable the site:
sudo a2ensite subdomain.mydomain.com
Repeat this for every sub domain you want to add.
edited Jul 20 at 17:59
Community♦
1
1
answered May 9 '14 at 22:08
Louis MatthijssenLouis Matthijssen
9,0814 gold badges35 silver badges46 bronze badges
9,0814 gold badges35 silver badges46 bronze badges
2
Great this works! Thank you very much. Last point, but it might be because of no-ip, I managed to make it work but using the address blog-mysite.no-ip.org when I registered the subdomain. I couldnt write blog.mysite.no-ip.org (message:invalid hostname)...now, is this because no-ip wants me to pay or did I do something wrong?
– user1983400
May 9 '14 at 22:28
I don't know if no-ip allows you to create sub domains. If they do, it may take 24 hours before it's working as I said in my answer. Try to reach it again tomorrow. Also, I see you're usingblog-mysite
first and thenblog.mysite
. This is not the same, so if you chose the first you'll have to use that one. Don't forget to update your Apache2 config in that case.
– Louis Matthijssen
May 9 '14 at 22:34
Hey, yes sorry that is what I meant. No-ip would only let me create a subdomain with a dash and not a period. Is this no-ip restricting my free account with them? There shouldnt be reason you couldnt otherwise, should it?
– user1983400
May 9 '14 at 22:41
I think so. I don't use no-ip. If you really want to know you should contact their support. You could also buy your own domain (like mydomain.com). This way you'll have full control of your DNS and you can add as many subdomains you want. It's not so expensive, just make sure you don't order hosting with it (this makes it expensive). Prices are usually per year and I think you can get a domain for around 10$/year.
– Louis Matthijssen
May 9 '14 at 22:46
I rolled back the last edit, as changing ownership to the apache user on the document root directory is not needed, and can even be a security risk. It is enough to give read access to the directory.
– Dan
Mar 1 '17 at 13:29
|
show 1 more comment
2
Great this works! Thank you very much. Last point, but it might be because of no-ip, I managed to make it work but using the address blog-mysite.no-ip.org when I registered the subdomain. I couldnt write blog.mysite.no-ip.org (message:invalid hostname)...now, is this because no-ip wants me to pay or did I do something wrong?
– user1983400
May 9 '14 at 22:28
I don't know if no-ip allows you to create sub domains. If they do, it may take 24 hours before it's working as I said in my answer. Try to reach it again tomorrow. Also, I see you're usingblog-mysite
first and thenblog.mysite
. This is not the same, so if you chose the first you'll have to use that one. Don't forget to update your Apache2 config in that case.
– Louis Matthijssen
May 9 '14 at 22:34
Hey, yes sorry that is what I meant. No-ip would only let me create a subdomain with a dash and not a period. Is this no-ip restricting my free account with them? There shouldnt be reason you couldnt otherwise, should it?
– user1983400
May 9 '14 at 22:41
I think so. I don't use no-ip. If you really want to know you should contact their support. You could also buy your own domain (like mydomain.com). This way you'll have full control of your DNS and you can add as many subdomains you want. It's not so expensive, just make sure you don't order hosting with it (this makes it expensive). Prices are usually per year and I think you can get a domain for around 10$/year.
– Louis Matthijssen
May 9 '14 at 22:46
I rolled back the last edit, as changing ownership to the apache user on the document root directory is not needed, and can even be a security risk. It is enough to give read access to the directory.
– Dan
Mar 1 '17 at 13:29
2
2
Great this works! Thank you very much. Last point, but it might be because of no-ip, I managed to make it work but using the address blog-mysite.no-ip.org when I registered the subdomain. I couldnt write blog.mysite.no-ip.org (message:invalid hostname)...now, is this because no-ip wants me to pay or did I do something wrong?
– user1983400
May 9 '14 at 22:28
Great this works! Thank you very much. Last point, but it might be because of no-ip, I managed to make it work but using the address blog-mysite.no-ip.org when I registered the subdomain. I couldnt write blog.mysite.no-ip.org (message:invalid hostname)...now, is this because no-ip wants me to pay or did I do something wrong?
– user1983400
May 9 '14 at 22:28
I don't know if no-ip allows you to create sub domains. If they do, it may take 24 hours before it's working as I said in my answer. Try to reach it again tomorrow. Also, I see you're using
blog-mysite
first and then blog.mysite
. This is not the same, so if you chose the first you'll have to use that one. Don't forget to update your Apache2 config in that case.– Louis Matthijssen
May 9 '14 at 22:34
I don't know if no-ip allows you to create sub domains. If they do, it may take 24 hours before it's working as I said in my answer. Try to reach it again tomorrow. Also, I see you're using
blog-mysite
first and then blog.mysite
. This is not the same, so if you chose the first you'll have to use that one. Don't forget to update your Apache2 config in that case.– Louis Matthijssen
May 9 '14 at 22:34
Hey, yes sorry that is what I meant. No-ip would only let me create a subdomain with a dash and not a period. Is this no-ip restricting my free account with them? There shouldnt be reason you couldnt otherwise, should it?
– user1983400
May 9 '14 at 22:41
Hey, yes sorry that is what I meant. No-ip would only let me create a subdomain with a dash and not a period. Is this no-ip restricting my free account with them? There shouldnt be reason you couldnt otherwise, should it?
– user1983400
May 9 '14 at 22:41
I think so. I don't use no-ip. If you really want to know you should contact their support. You could also buy your own domain (like mydomain.com). This way you'll have full control of your DNS and you can add as many subdomains you want. It's not so expensive, just make sure you don't order hosting with it (this makes it expensive). Prices are usually per year and I think you can get a domain for around 10$/year.
– Louis Matthijssen
May 9 '14 at 22:46
I think so. I don't use no-ip. If you really want to know you should contact their support. You could also buy your own domain (like mydomain.com). This way you'll have full control of your DNS and you can add as many subdomains you want. It's not so expensive, just make sure you don't order hosting with it (this makes it expensive). Prices are usually per year and I think you can get a domain for around 10$/year.
– Louis Matthijssen
May 9 '14 at 22:46
I rolled back the last edit, as changing ownership to the apache user on the document root directory is not needed, and can even be a security risk. It is enough to give read access to the directory.
– Dan
Mar 1 '17 at 13:29
I rolled back the last edit, as changing ownership to the apache user on the document root directory is not needed, and can even be a security risk. It is enough to give read access to the directory.
– Dan
Mar 1 '17 at 13:29
|
show 1 more comment
protected by Community♦ Sep 25 '18 at 8:58
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?