But cloud.domain.com doesn't work! I tried to ping it and it does not resolve to my ip.

Also the weird thing is that i have another vps with the exact configurations using a different domain, lets say domain2.com. In my other vps everything works fine. Both domain2.com and cloud.domain2.com resolve to my vps ip.

I also have identical directory structure.

website : /var/www/wordpress

owncloud : /var/www/owncloud

I am using the nameservers from my domain name provider (in both cases).

But in my other domain's dns configuration i haven't made any CNAME entries for the cloud subdomain. So what should my CNAME entry be? cloud --> myip?
–
koukouloforosDec 18 '13 at 18:36

bar.example.com. CNAME foo.example.com. is a quick and dirty example of what a CNAME would look like. If your other configuration isn't requiring it, then I may be incorrect about you needing it but I would try it and see if once it propagates if that resolves the issue for you.
–
George SpicelandDec 18 '13 at 19:17