{"id":183,"date":"2010-08-11T12:34:11","date_gmt":"2010-08-11T17:34:11","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=183"},"modified":"2010-08-11T12:34:11","modified_gmt":"2010-08-11T17:34:11","slug":"setting-up-a-http-gateway-on-ubuntu-10-04","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2010\/08\/11\/setting-up-a-http-gateway-on-ubuntu-10-04\/","title":{"rendered":"Setting up a HTTP Gateway on Ubuntu 10.04"},"content":{"rendered":"<p>An HTTP gateway is one of the ways that one can host multiple sites using only one external IP. The way that it works is that the user requests the page from the gateway and specifies which host was requested. The gateway server then forwards the request to the appropriate web server, which then returns the result to the gateway server, and the gateway server returns the result transparently to the user. This is a much better way to do multiple domains without having to purchase additional static IP address for the purpose of hosting websites.<\/p>\n<p><strong>Prerequisites<\/strong><\/p>\n<p>Install packages <em>apache2<\/em>, <em>libapache2-mod-proxy-html<\/em>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo apt-get install apache2 libapache2-mod-proxy-html<\/pre>\n<p><strong>Process<\/strong><\/p>\n<ol>\n<li>Enable the the Apache mod_proxy as it is not enabled by default:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo a2enmod proxy_http<\/pre>\n<\/li>\n<li>Add a reverse proxy pass to the configuration. Open <strong>\/etc\/apache2\/sites-available\/default<\/strong> with your favourite text editor and add the following text:\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;VirtualHost *:80&gt;\r\n    &lt;Proxy *&gt;\r\n     Order Deny,Allow\r\n     Allow from all\r\n    &lt;\/Proxy&gt;\r\n\r\n ServerName fooserver.example.com\r\n\r\n ProxyRequests Off\r\n ProxyPass \/ http:\/\/192.168.42.3\/\r\n ProxyPassReverse \/ http:\/\/192.168.42.3\/\r\n&lt;\/VirtualHost&gt;\r\n<\/pre>\n<p>Replace <strong>fooserver.example.com<\/strong> with your own domain name, and replace <strong>192.168.42.3<\/strong> with the internal IP address of your server (keep the http:\/\/ portion).<\/li>\n<li>Restart Apache 2:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">sudo \/etc\/init.d\/apache2 restart<\/pre>\n<\/li>\n<li>Using your hosting provider&#8217;s DNS tool, point your domain name (<strong>fooserver.example.com<\/strong>) to your public IP.<\/li>\n<li>You&#8217;re done! To test, visit your domain name and it should bring you the website on your internal server.<\/li>\n<\/ol>","protected":false},"excerpt":{"rendered":"<p>An HTTP gateway is one of the ways that one can host multiple sites using only one external IP. The way that it works is that the user requests the page from the gateway and specifies which host was requested. The gateway server then forwards the request to the appropriate web server, which then returns [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,3],"tags":[16,705,711,710,709,706,707,708],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/183"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}