Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have the domain name and a web hosting for this domain with some company. At my office I have an ubuntu server with apache2 installed and I also have a static ip address.

My goal is to have the subdomain point to my server at my office, but I don't know where to start. In fact what I want is to make accesible my server from the internet without buying an aditional domian name, that's why I'm asking how to use subdomains. It is possible to do that? What are your suggestions?

Any help would be appreciated.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You need to do a couple of steps.

  1. First modify the DNS of and add: IN A (replace with your static IP)

  2. Then modify your router/firewall at your office to allow web traffic (port 80 & 443) to be tunneled to your ubuntu server.

  3. Set up your Apache, LAMP, java app server etc to serve your web apps.

  4. Extend further with email etc if needed.

share|improve this answer
Great I did like you told me and it works fine, but i still have a question. Right now this setup displays what is under /var/www/, but how do I display a specific folder (sacredi/) without putting that in the url? I mean, I want to access to sacredi/ directory with url instead, is this possible? –  Jorge Zapata Apr 17 '12 at 22:07
Use DocumentRoot setting in apache virtual host config file (in /etc/apache2/sites-available) to specify root folder –  flurdy Apr 17 '12 at 23:04
Perfect, thanks –  Jorge Zapata Apr 17 '12 at 23:41

You should check and see if your current registrar has a DNS control panel - most do. In that you need to create an A record for that has your fixed IP address as a value.

You also need to ensure that whatever the device is that connects your office to your ISP will allow inbound connections on port 80 and that they are forwarded to your server.

share|improve this answer
Thanks @lain, do you know how to configure an apache2 virtual host to work with fixed ip or where to find it? –  Jorge Zapata Apr 17 '12 at 18:40
Do you need it to server different IPs or just one static IP. If just one, just accept all traffic by using * eg:<VirtualHost *:80> (All though that is a different question. –  flurdy Apr 17 '12 at 18:48

Your Answer


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.