I understand sub-domains aren't supported, but...

15 posts / 0 new
Last post
#1 Sun, 07/15/2012 - 16:49
gman4354

I understand sub-domains aren't supported, but...

I understand that sub-domains aren't supported in Virtualmin, but as a person wanting to run a hosting service I want to be able to provide new customers with a free sub-domain (i.e. websitename.example.com) if they don't already have a registered .com or other domain.

So, for example: My hosting service's domain name is www.example.com. Let's say a new customer signs up and their website's name is "newcustomer". I would want to provide them with the sub-domain, newcustomer.example.com. So when anyone visits this sub-domain (newcustomer.example.com) it will bring them to their website under the virtual server I have created for them.

So, how exactly would I go about doing this? If it's even possible, and if it isn't possible what is an alternate solution to this slightly large problem?

Sun, 07/15/2012 - 22:08
andreychek

Howdy,

It's actually no problem at all to do that -- it's just not called "Sub-Domain" in Virtualmin.

To do that, create a new Virtual Server -- and for your domain name, enter your desired domain or sub-domain.

For example, you could enter newcustomer.example.com as the domain name.

Would that do what you're after?

-Eric

Mon, 07/16/2012 - 12:22 (Reply to #2)
gman4354

I did attempt that, however, for some reason it just gives me a blank white page when I visit it.

Mon, 07/16/2012 - 13:48
andreychek

Howdy,

Okay, what you're seeing isn't a sub-domain issue... but what it is, I'm not sure ATM :-)

What do you see if you look at the access and error logs for that domain, in $HOME/logs/ -- do you see your attempt to access it in the access_log file?

If so, are any errors showing up in the error_log?

-Eric

Wed, 07/18/2012 - 14:24 (Reply to #4)
gman4354

Hello, thank you for you reply! :D

I looked at the access and error logs and both were completely empty.

Would it have anything to do with the fact that it's a dot.tk domain?

Tue, 07/17/2012 - 18:02
ronald
ronald's picture

if you see a blank page after you have installed a php script, then you may want to check if php is properly installed. just a wild guess but it does occur

Wed, 07/18/2012 - 14:26 (Reply to #6)
gman4354

No PHP scripts involved here, just a regular HTML document. :p

Wed, 07/18/2012 - 15:00
gman4354

Okay, I added an A Record to my registrar's DNS, but now when I visit my "sub-domain" it goes to my main site and not my virtual server.

Wed, 07/18/2012 - 15:05
andreychek

Hmm, it sounds like Apache may be directing you to the wrong VirtualHost.

You're in luck, as I just revamped the docs regarding that very problem... take a peek here and see if this gets you on the right track:

http://www.virtualmin.com/documentation/web/troubleshooting

Wed, 07/18/2012 - 17:49 (Reply to #9)
gman4354

That didn't seem to make any difference. I think it may be something wrong with BIND. Whenever I press "Apply Zone" under the zone for the Virtual Server in question, I get the following error: "NDC command failed : rndc: connect failed: 127.0.0.1#953: connection refused". What does this mean?

EDIT: Nevermind, I solved the RNDC problem. It didn't solve my sub-domain/virtual server issue though.

Fri, 07/20/2012 - 15:05
gman4354

Sorry about the double post, but I REALLY need this resolved. Thank you!

Fri, 07/20/2012 - 15:41
ronald
ronald's picture

per haps run your domain through www.intodns.com ans see if everything is okay from DNS and A records.
if your domain does resolve to your server then per haps there is a apache (path) issue for that domain.

Fri, 07/20/2012 - 16:37 (Reply to #12)
gman4354

I ran it through and everything is okay. The only things that came up where lame nameservers on my domain registrars end which I have no control over and the fact that I have no MX records (which I don't).

EDIT: It works when I use my .com domain registered with GoDaddy, but for some reason doesn't work with my .tk domain registered with Dot.TK. Weird. Could this be an issue with my DNS configuration on the registrar's side?

Fri, 07/20/2012 - 16:53
ronald
ronald's picture

Lame nameservers are not good. You may want to fix that if possible. Since the .com domain works, the issues are not on your server.

Fri, 07/20/2012 - 17:20 (Reply to #14)
gman4354

Thank you very much! I'll have to contact my registrar and see if they can resolve the issue.

EDIT: I actually just remembered that I can use GoDaddy's off-site DNS and manage my .TK DNS records using GoDaddy's DNS server.

All problems solved!

Topic locked