Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Help with setting up a sub-domain/test site on a VPS?

Hi,

I have a website running on a VPS, let's say example.com and I want to create a sub-domain called test.example.com so that I can play around with HTML, CSS and PHP.

I have created a folder at the root of example.com called test. I uploaded the files from "How to Make a Website" so the example website should show up.

I have created an A record within the advanced DNS settings called "test" which points at the IP address of example.com.

I waited 72 hours after updating the A Record but I am getting this message when I try to navigate to test.example.com?

"An error occured while attempting to generate the page"

I'm not sure what I have to do to make the "test" sub-domain activate? Any help would be greatly appreciated?

Thanks :)

Did you try clearing your browser cache and your DNS cache? (How To Flush DNS Cache: https://www.whatsmydns.net/flush-dns.html)

Thanks for the reply Colin. I hadn't tried that but I'm afraid it didn't make any difference. Same error message :(

Are you using Apache? If so, did you setup the Apache virtual hosts before you changed the DNS? Besides updating the DNS, you also have to tell Apache to go to the test folder when somebody visits that subdomain.

Colin I use Windows Server 2008 R2? Would I have to do something similar in that?

I have zero experience with Windows Servers, but I would assume you have to do something similar. I guess they are called Child Domains in Windows Server. The best I can do from here is refer you to good old Google.

Thanks again Colin :) I'll check that out when I get a chance :) Probably be Wednesday before I can put some time into Treehouse due to regular work commitments

Was looking into this child domain - and was turning out to be very complicated and a bit above my skill level :( Have left it for now. I'm starting to think I shouldn't really be on a VPS

1 Answer

Phew! Managed to get this sorted by using the IIS (Internet Information Services) Manager, going to Sites and adding the sub-domain within that tree. Worked immediately. Thanks again Colin I wouldn't have go there without you :)

I found this youtube video helfpul:

https://www.youtube.com/watch?v=nK0wsS9xF4E

Great!!! Glad you got it working, you did all the hard work to make it happen.

Dunno about that Colin, but thanks :) Quite satisfying when you find the solution to a problem that's bugging you! Good to know there are helpful people like yourself on this site and forum though.