{"id":56,"date":"2014-11-15T12:26:15","date_gmt":"2014-11-15T12:26:15","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=56"},"modified":"2014-11-15T12:36:47","modified_gmt":"2014-11-15T12:36:47","slug":"apache-make-shared-hosting-single-ip-open-a-particular-domain","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/apache-make-shared-hosting-single-ip-open-a-particular-domain\/","title":{"rendered":"Apache, Make Shared Hosting (single) IP open a particular domain"},"content":{"rendered":"<p>This is based on Apache on Ubuntu.<br \/>\nThe server has a single IP Address and is used to host multiple domains using <em>VirtualHost<\/em><br \/>\nIf it is needed that on using the IP address of the server (in a browser) a particular site\/domain get opened, then do the following:<\/p>\n<ul>\n<li>Create a vhost file with the IP address as name e.g 192.168.0.1.vhost<\/li>\n<li>Add the necessary VirtualHost configuration. It can be copied from the domain&#8217;s vhost file<\/li>\n<li>The ServerName in the vhost file will be the IP. e.g. ServerName 192.168.0.1<\/li>\n<li>Create a link of the vhost inside sites-available folder to a proper file in sites-enabled folder. e.g.\n<pre class='wp-code-highlight prettyprint'>ln -s \/etc\/apache2\/sites-available\/192.168.0.1.vhost ..\/sites-enabled\/192.168.0.100.vhost<\/pre>\n<\/li>\n<li>Restart apache<\/li>\n<\/ul>\n<p>\n<em style=\"font-size:14px\">Please note adjustments might be necessary in the .htaccess file. Like if non-www to www redirection is enabled or http to https redirection is enabled, they will give error and warning (respectively) when IP is used to access the site. Adding<\/em><\/p>\n<pre class='wp-code-highlight prettyprint'><em style=\"font-size:14px\">RewriteCond %{HTTP_HOST} !192\\.168\\.0\\.1<\/em><\/pre>\n<p><em style=\"font-size:14px\">before the existing condition ( e.g. <span style=\"font-style:normal;\">RewriteCond %{HTTP_HOST} !^www\\.<\/span> ) should help.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is based on Apache on Ubuntu. The server has a single IP Address and is used to host multiple domains using VirtualHost If it is needed that on using the IP address of the server (in a browser) a particular site\/domain get opened, then do the following: Create a vhost file with the IP&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/apache-make-shared-hosting-single-ip-open-a-particular-domain\/\">Continue reading <span class=\"screen-reader-text\">Apache, Make Shared Hosting (single) IP open a particular domain<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-miscellaneous","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":8,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/56\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}