Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

My bro is using a service of a third party(say, X), with DNS addresses:

ns1.x.com
ns2.x.com

So, bro bought a domain name, say abc.com. And pointed the DNS addresses with the above ones.

Now, bro wants to create a subdomain, say mysite.abc.com with custom content. But this service provider X, doesn't offer hosting of files that we give to them for the subdomain. Instead, they said they have created a subdomain and is pointing to my server(say, with an IP: 123.99.2.123)

So, how do I add a subdomain for mysite.abc.com in my server? BTW, I'm having a VPS server, with root access.

So far, I can see that adding a subdomain is possible only if the main domain is added. What changes do I have to make in my server so that, when accessing mysite.abc.com, files from my server would be delivered?

Sorry, I am not sure whether I confused you. Let me know if you need me to rephrase the issue or explain it with visual examples or something.

Thank you

share|improve this question
    
As suspected, the question is a little confusing. Who is your DNS provider? What web server are you using (Apache, IIS, etc...)? Are you using a control panel, and if not, are you familiar with editing web server configuration files? –  dan Jul 3 '13 at 22:39
    
Sorry for the delay. Was having some headache over certain things. I got it working now. cPanel was preventing me from adding an addon domain which has the DNS server names put to the third party's server. I will post the details as an answer in detail. –  Akhilesh B Chandran Jul 14 '13 at 16:47
add comment

1 Answer 1

For a VPS with root access, follow this guide to add a subdomain:

https://library.linode.com/web-servers/apache/installation/ubuntu-12.04-precise-pangolin#sph_configure-name-based-virtual-hosts

Here's a quick example for you.

<virtualhost *:80>
  ServerName mysite.abc.com
  DocumentRoot /path/to/the/site/files/of/mysite.abc.com
  ServerAdmin admin@mysite.abc.com
  ErrorLog "/logs/mysite.abc.com.error.log"
  CustomLog "/logs/mysite.abc.com.access.log" common
</VirtualHost>

Good luck!

share|improve this answer
    
Thank you. But I got it resolved. Will post the solution as an answer. –  Akhilesh B Chandran Jul 14 '13 at 16:48
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.