How do I create a subdomain ?
I've bought a dedicated linux server, I set the dns entries for my domain (moose.ro) to point to it and now I want to create a subdomain (beta.moose.ro). How do I do it ? I have ssh access and the root account on my server, and the dns has already propagated and it works. I don't have a web interface. Only the bash shell thru ssh. There must be some fancy nix command for me to use. I was informed I don't have cpanel or any other type of web domain administration at my disposal. I have to do it all by hand from the shell. I don't know how the hell to choose the best answer on Yahoo Answers, but THANKS Akshay K ! I fixed my problem thanks to your help
Public Comments
- Have you tried accessing your hosting package through a browser and looked around. I havent hosted a site for a while but remember it wasnt too hard from the web interface that the host company provided.
- On cPanel, go to the domains section, then hit Sub-Domains, then it's easy to follow what to do.
- Yeah, you need to login to the control panel. Lots of Linux servers use cpanel ( yoursite.com/cpanel) use your ftp login and pass to get in and that should be it, simple and clear once inside -click subdomain and off you go. there are other control panels cpanel is a popular one that's all. check with your host which one you have one your server
- SSH to your server with SUDO or su whatever you are comfortable with...and assuming you have Apache installed on your server. it is very easy to add sub-domain.. edit with your favourite editor (vi, vim etc)the file httpd.conf (located by default in /etc/httpd/conf/) add virtual host (find entry for virtual host) NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin user@moose.ro DocumentRoot /var/www/betamoose ServerName beta.moose.ro ServerAlias beta.moose.ro *.beta.moose.ro IP Address (actual IP address of the server) ErrorLog logs/error_log_beta.moose.ro.log CustomLog logs/access_log_beta.moose.ro.log combined </VirtualHost> Save and exit... Reload Apache (some people restart Apache which is not recommended).. point DNS above IP to beta.moose.ro and done.... piece of cake Similarly you can add any domain, subdomain by adding virtual hosts. Note the DocumentRoot above is the path of the folder for web pages (index.html, index.htm or index.php)
Powered by Yahoo! Answers