Creating sub domain on webmin

vijay2991 picture vijay2991 · Nov 8, 2013 · Viewed 11.3k times · Source

Can anybody help me in creating subdoain through webmin. I want to create subdomain like test.xxxxx.com for this I tried with several reference site but no luck. exp.

http://www.trickylinux.net/add-domain-virtualminwebmin.html

http://codeboxlabs.com/add-subdomain-webmin-linux/

My current httpd.conf look like:

 <VirtualHost *:80>
SSLEngine off 
DocumentRoot /var/www/html/******/web
DirectoryIndex index.php
<Directory "/var/www/html/*****/web">
AllowOverride All
Allow from All
</Directory>
ServerName www.******.com
ServerAlias ftp.*****.com
SSLEngine off 
SSLVerifyClient optional
</VirtualHost>

Please help me to solve this issue.

Answer

Zahid Gill picture Zahid Gill · Sep 23, 2015

I know its been a year and you must have found a path already but its for the future reference.

Just add another host:

<VirtualHost *:80>
DocumentRoot /var/www/html/******/subdomain
DirectoryIndex index.php
<Directory "/var/www/html/*****/subdomain">
AllowOverride All
Allow from All
</Directory>
ServerName www.subdomain.******.com
ServerAlias subdomain.******.com
SSLEngine off 
SSLVerifyClient optional
</VirtualHost>

Of course restarting apache is needed in order to make it read the new VHost

What you need to do next is add an A record in you domain registrar (i.e, Godaddy). Record name will be your "subdomain" and it'll point to your server address:

A-----------------> @ --------------------> ******.com
A-----------------> ******.com------------> ******.com
A-----------------> subdomian.******.com--> ******.com