{"id":103,"date":"2017-07-10T03:20:51","date_gmt":"2017-07-10T03:20:51","guid":{"rendered":"http:\/\/linuxresellerwebhosting.in\/blog\/?p=103"},"modified":"2017-07-14T09:03:28","modified_gmt":"2017-07-14T09:03:28","slug":"creating-sub-domain-without-cpanel","status":"publish","type":"post","link":"https:\/\/linuxresellerwebhosting.in\/blog\/creating-sub-domain-without-cpanel\/","title":{"rendered":"EASY STEPS FOR CREATING SUB DOMAIN WITHOUT CPANEL IN VPS SERVER"},"content":{"rendered":"<p lang=\"zxx\">Hi all !<\/p>\n<p lang=\"zxx\">Creating sub domains in cPanel is much easier even for non techincal user. But in this article we are going to see how to create sub domains without cPanel in VPS server.<\/p>\n<p lang=\"zxx\">Step 1:<\/p>\n<p lang=\"zxx\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-106 size-full\" src=\"http:\/\/linuxresellerwebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/putty.jpg\" alt=\"\" width=\"449\" height=\"435\" srcset=\"https:\/\/linuxresellerwebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/putty.jpg 449w, https:\/\/linuxresellerwebhosting.in\/blog\/wp-content\/uploads\/2017\/07\/putty-300x291.jpg 300w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/p>\n<p lang=\"zxx\">Connect your VPS Server using putty (SSH service). In the host name filed you need to enter your server&#8217;s IP address.SSH default port number is 22. In case If you changed the SSH port number, then give the appropriate number and then click open.<\/p>\n<p lang=\"zxx\">Step2:<\/p>\n<p lang=\"zxx\">Then the login prompt open, here you need to give your user name &amp; password.<\/p>\n<p lang=\"zxx\">Step 3:<\/p>\n<p lang=\"zxx\">Once you connected with your server, open the file appache configuration file using any editor like nano, vi etc.<\/p>\n<p lang=\"zxx\"># nano \/etc\/httpd\/conf\/httpd.conf<\/p>\n<p lang=\"zxx\"><span style=\"font-family: Gabriola, fantasy;\"><b>Note : In this case appache is already installed on your server.<\/b><\/span><\/p>\n<p lang=\"zxx\">Step 4:<\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">Go to the end of the file and add the below lines to create the virtualhost for subdomain.<\/span><\/p>\n<p lang=\"zxx\"><b>&lt;VirtualHost *:80&gt;<\/b><\/p>\n<p><b>ServerAdmin webmaster@tnadu.com<\/b> <b>DocumentRoot &#8220;Your subdomain path&#8221;<\/b> <b>ServerName &#8220;Your subdomain name&#8221;<\/b> <b>ServerAlias &#8220;Your server alias name&#8221;<\/b> <b>ErrorLog &#8220;Apache error log file&#8221;<\/b> <b>CustomLog &#8220;Log file&#8221;<\/b><\/p>\n<p><span style=\"font-size: medium;\"><b>&lt;\/VirtualHost&gt;<\/b><\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">Step 5:<\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">Add the A record for the subdomain at the end of the file by opening the DNS configuration file using the command :<\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">nano \/var\/named\/yourdomainname.com.zone <\/span><\/p>\n<pre lang=\"zxx\"><span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">$TTL 86400<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">@   IN  SOA     ns1.mydomain.com. root.mydomain.com. (<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\">        <span lang=\"zxx\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\">2013042201  ;Serial<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\">        <span lang=\"zxx\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\">3600        ;Refresh<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\">        <span lang=\"zxx\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\">1800        ;Retry<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\">        <span lang=\"zxx\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\">604800      ;Expire<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\">        <span lang=\"zxx\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\">86400       ;Minimum TTL<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">)<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">; Specify our two nameservers<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\">                <span lang=\"zxx\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\">IN      NS              ns1.mydomain.com.<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\">                <span lang=\"zxx\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\">IN      NS              ns2.mydomain.com.<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">; Resolve nameserver hostnames to IP, replace with your two droplet IP addresses.<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">ns1             IN      A               1.1.1.1<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">ns2             IN      A               2.2.2.2<\/span><\/span><\/span><\/span>\r\n\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">; Define hostname -&gt; IP pairs which you wish to resolve<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">@               IN      A               3.3.3.3<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">www             IN      A               3.3.3.3<\/span><\/span><\/span><\/span>\r\n<span style=\"color: #000000;\"><span style=\"font-family: monospace, monospace;\"><span style=\"font-size: small;\"><span lang=\"zxx\">subdmain        IN      A               Your server IP<\/span><\/span><\/span><\/span><\/pre>\n<p lang=\"zxx\"><span style=\"font-family: Gabriola, fantasy;\"><span style=\"font-size: medium;\"><b>Note : In this case bind is already installed on your server. <\/b><\/span><\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">STEP 6:<\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">Then you need create a directory for your sub domain &amp; log files as early you mentioned in your httpd.conf file. <\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\"><b># mkdir \/Your subdomain directory<\/b><\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">Inside your subdomain direcorty you can upload your contents that can viewed through browser while accessing your subdomain. <\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\"><b>For EX : <\/b>Create a indext.html folder inside your subdomain path and the add the below contenst.<b> <\/b><\/span><\/p>\n<p lang=\"zxx\"><b>&lt;html&gt;<\/b><\/p>\n<p><b>&lt;head&gt;<\/b> <b>&lt;title&gt;www.sub.yourdomain.com&lt;\/title&gt;<\/b> <b>&lt;\/head&gt;<\/b> <b>&lt;body&gt;<\/b> <b>&lt;h1&gt;Success: You Have Set Up a Subdomain&lt;\/h1&gt;<\/b> <b>&lt;\/body&gt;<\/b> <b>&lt;\/html&gt;<\/b><\/p>\n<p lang=\"zxx\"><b>Step 7:<\/b><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\">Restart the httpd service and named service after updating the details by using the below commands :<\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\"><b># service httpd restart<\/b><\/span><\/p>\n<p lang=\"zxx\"><span style=\"font-size: medium;\"><b># service named restart<\/b><\/span><\/p>\n<p lang=\"zxx\">\n","protected":false},"excerpt":{"rendered":"<p>Hi all ! Creating sub domains in cPanel is much easier even for non techincal user. But in this article<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[4],"tags":[],"class_list":["post-103","post","type-post","status-publish","format-standard","hentry","category-vps"],"_links":{"self":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/103","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=103"}],"version-history":[{"count":10,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/103\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/103\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=103"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=103"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=103"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}