Sub Domains - newbie question

7 posts / 0 new
Last post
#1 Wed, 12/18/2013 - 15:20
johnupatree

Sub Domains - newbie question

Hi, I work in a small community learning centre and have set up a server to host several web pages, these pages are purely for the students to look at/interact with (intranet)

I have been asked is it possible to add sub domains to one particular host, for example, we have a virtual host www.aquagrim.com and would like each student to be able to have a sub domain, www.aquagrim.com/student1, www.aquagrim.com/student2 etc

The intention is that they can then upload using ftp, a simple index.html page and view their handywork.

Hope that I have explained that clearly, forgive me if my jargon is incorrect, I am still learning and happy to be corrected!

Look forward to a response, many thanks

John

Wed, 12/18/2013 - 16:42
Locutus

This wouldn't really be a "subdomain", but more like a folder in your main domain. :)

You should be able to accomplish your goal by creating the proper directories, and then creating "Website FTP Access" users in Virtualmin, "Edit Users", and giving them the proper subdirectory of your public_html as their home directory.

I haven't tested this myself yet though, so you might just want to try it and see if it works. :)

You'd also want to go to "Limits and Validation -> FTP Directory Restrictions" and "Restrict users to home directories", otherwise they'd be able to browse the whole filesystem.

If you want actual subdomains, like "student1.aquagrim.com", you'd need to go a different route. I'll explain more if that's what you're after.

Wed, 12/18/2013 - 17:03 (Reply to #2)
johnupatree

Hi Locutus,

I appreciate that "subdomain" is not the correct term, however I am trying to make the end product look and behave as "real" as possible. ie when a student types in www.aquagrim.com/student1 it takes them to their own homepage.

I know I can create virtual users for each student, that is simple enough. However the problem I had with that was the address was not recognised, I had to go into windows/system32/drivers/etc/host and add the IP and address. Ok for one machine, I have 45. Secondly I would have to do this each time a new student joined and again on each machine.

Maybe what I am after is just not possible?

Thanks again

John

Wed, 12/18/2013 - 18:28
Locutus

If your client machines cannot resolve "www.aquagrim.com" with their regular DNS server settings and you need to make a hosts entry, there's something wrong with the DNS zone on your server.

I just did some tests, and it does not seem that "aquagrim.com" is an officially registered domain name. You'd either have to do that, and point the registrar nameservers to your server, or add your server's IP as primary nameserver to all your client machines. Both those two options have further implications though which I cannot advise about without a lot of further information about your network setup.

Main question here is, is "aquagrim.com" supposed to be a domain name only for your internal use, or should it be available on the internet?

You don't need to do anything domain-wise "each time a new student joins" though, because only the "www.aquagrim.com" part is a hostname that needs DNS resolving. the "/student1" part is just a directory on the webspace. Once the hostname is resolved, you can request anything after it, be it "/student1", "/student1337" or "/blah/abc/def".

Thu, 12/19/2013 - 04:42
johnupatree

Hi,

Sorry for not making myself very clear. the domain is for internal use only, I used the term intranet, probably not the correct term. We are not allowed to use the server for the internet. The domain aquagrim.com is a fictitious site, purely for the new students to familiarise themselves with the workings of the internet. I will at a later stage, as the students progress, be showing them how to upload to "their own space" hence my use of the word subdomain. The long term plan is that we will purchase a domain and give the students sub domains on it, but that is a long way of yet.

So, all I need to do is create a directory for each student? The DNS resolving I have done by adding the server's IP as primary nameserver to all the student machines. That works I know. I have tried adding directories for each student, but I am obviously missing something because I cannot get it to work. I will keep plugging away at it though, bound to get there in the end!

Many thanks for your time, patience and clarity of answers, very much appreciated.

John

Thu, 12/19/2013 - 06:42
Locutus

Please elaborate "I cannot get it to work". That's not a problem description. ;) What exactly did you try and what exactly happened?

Yes, you basically just need to create the student subdirectories, then create the student users with the proper home directory, change the owner of the subdirectory to the newly created student user (otherwise they don't have access rights), and don't forget to set the "restrict to home directory" FTP option as I mentioned.

Thu, 12/19/2013 - 12:21
johnupatree

Quite right, a rubbish description and I should no better. I should have said I get a Not Found message. So obviously I knew I had done something wrong.

I had created New Users on the server and changed their root to where I thought it should be, aquagrim.coms /home/. I could get to the aquagrim home page, but when I added the /student1 I was getting the Not Found message.

From what you have posted previously I am certain I can finally sort this out. I am off work today, so will try again tomorrow.

For all the frustration, I am still enjoying doing this, it is a learning curve, steep at times but rewarding.

Your advice and support is, as I have mentioned previously, welcome and appreciated.

Kind regards

Topic locked