Question

Subdomain doesnt work on Apache 2.2 and Debian 7

  • Posted June 22, 2014

Hello,

I want to setup a subdomain in my droplet, I read and follow this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-debian-7

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/mydomain.com And for my subdomain: /var/www/mydomain.com/subdomain

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

I opened the file mydomian.com and add this line: ServerName mydomain.com

And change this: DocumentRoot /var/www/mydomian.com

Then, the same for the file subdomain.mydomain.com

Add the line: ServerName subdomain.mydomain.com

And change this: DocumentRoot /var/www/mydomian.com/subdomain

FInally:

#a2ensite mydomain.com and #a2ensite subdomain.com

Then:

#service apache2 reload

But not work!

The domain : mydomain.com 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 mydomain.com ip.ip.ip.ip

But nothing. :(

Why? ?

Ps. Sorry for my bad english.

Subscribe
Share

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.