Subdomain doesnt work on Apache 2.2 and Debian 7

  • Posted June 22, 2014


I want to setup a subdomain in my droplet, I read and follow this tutorial:

Yep, all right. But, not work for me.

First, I point the dns of my domain in godaddy to: NS1.DIGITALOCEAN.COM. NS2.DIGITALOCEAN.COM. NS3.DIGITALOCEAN.COM.

Then, I installed apache2:

#apt-get install apache2

I created the directory for my domain in /var/www/ And for my subdomain: /var/www/

I copied the file /etc/apache2/sites-available/default and name and other with name (all in this same directory).

I opened the file and add this line: ServerName

And change this: DocumentRoot /var/www/

Then, the same for the file

Add the line: ServerName

And change this: DocumentRoot /var/www/


#a2ensite and #a2ensite


#service apache2 reload

But not work!

The domain : works great, very great, but the subdomain doesnt.

In my browser I see this error code: Código de error: ERR_NAME_NOT_RESOLVED

Well, I tried to set the subdomain in my droplet cpanel add this A record: A ip.ip.ip.ip

But nothing. :(

Why? ?

Ps. Sorry for my bad english.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

DNS is cached and takes time to propagate. Also, please don’t redact anything except passwords. It makes it harder to help you in nearly every situation and makes it impossible in some.

You didn’t add the subdomain in DigitalOcean’s panel under DNS.