<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:foaf="https://xmlns.com/foaf/0.1/" xmlns:og="https://ogp.me/ns#" xmlns:rdfs="https://www.w3.org/2000/01/rdf-schema#" xmlns:schema="https://schema.org/" xmlns:sioc="https://rdfs.org/sioc/ns#" xmlns:sioct="https://rdfs.org/sioc/types#" xmlns:skos="https://www.w3.org/2004/02/skos/core#" xmlns:xsd="https://www.w3.org/2001/XMLSchema#" version="2.0" xml:base="https://www.linuxjournal.com/tag/reverse-proxy">
  <channel>
    <title>Reverse Proxy</title>
    <link>https://www.linuxjournal.com/tag/reverse-proxy</link>
    <description/>
    <language>en</language>
    
    <item>
  <title>Protect Your Ports with a Reverse Proxy</title>
  <link>https://www.linuxjournal.com/content/protect-your-ports-reverse-proxy</link>
  <description>  &lt;div data-history-node-id="1217775" class="layout layout--onecol"&gt;
    &lt;div class="layout__region layout__region--content"&gt;
      
            &lt;div class="field field--name-field-node-image field--type-image field--label-hidden field--item"&gt;  &lt;img src="https://www.linuxjournal.com/sites/default/files/nodeimage/story/11534f1.jpg" width="550" height="391" alt="" typeof="foaf:Image" class="img-responsive" /&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-author field--type-ds field--label-hidden field--item"&gt;by &lt;a title="View user profile." href="https://www.linuxjournal.com/users/shawn-powers" lang="" about="https://www.linuxjournal.com/users/shawn-powers" typeof="schema:Person" property="schema:name" datatype="" xml:lang=""&gt;Shawn Powers&lt;/a&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-body field--type-text-with-summary field--label-hidden field--item"&gt;&lt;p&gt;
In a previous article, I discussed Apache Tomcat, which is the ideal way to run
Java applications from your server. I explained that you can run those
apps from Tomcat's default 8080 port, or you can configure Tomcat to use
port 80. But, what if you want to run a traditional Web server
&lt;em&gt;and&lt;/em&gt; host
Java apps on port 80? The answer is to run a reverse proxy.
&lt;/p&gt;

&lt;p&gt;
The only assumption I make here is that you have a Web-based application
running on a port other than port 80. This can be a Tomcat app, like I
discussed in my last article, or it can be any Web application that has
its interface via the Web (such as Transmission, Sick Beard and so on). The other
scenario I cover here is running a Web app from a second server, even if
it's on port 80, but you want it to be accessed from your central Web
server. (This is particularly useful if you have only one static IP to
use for hosting.)
&lt;/p&gt;

&lt;p&gt;
The way reverse proxying works, at least with the Apache Web server, is
that every application is configured as a virtual host. Just like you can
host multiple Web sites from a single server using virtual hosting, you 
also can host separate Web apps as virtual hosts from that same
server. It's
not terribly difficult to configure, but it's very useful in practice. First
things first. On your server, you have the Web server installed
(Figure 1). You also have a Web application on port 8080 (Figure 2).
Along with the working Apache Web server, you need to make sure virtual
hosting (by name) is enabled.
&lt;/p&gt;

&lt;img src="https://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11534f1.jpg" alt="" title="" class="imagecache-large-550px-centered" /&gt;&lt;p&gt;
Figure 1. I have Apache installed, and it's hosting a very simple page.
on port 80.
&lt;/p&gt;

&lt;img src="https://www.linuxjournal.com/files/linuxjournal.com/ufiles/imagecache/large-550px-centered/u1002061/11534f2.jpg" alt="" title="" class="imagecache-large-550px-centered" /&gt;&lt;p&gt;
Figure 2. I have a Web application running on port 8080 on the server
located at 192.168.1.11.
&lt;/p&gt;

&lt;h3&gt;
Enabling Name-Based Virtual Hosts&lt;/h3&gt;

&lt;p&gt;
Enabling name-based virtual hosting on Apache is extremely common,
and it's very simple to do. Depending on what distribution you're using,
the "proper" location for enabling name-based virtual hosting may
differ. The nice thing about Apache, however, is that generally as long
as the directive is specified somewhere in the configurations, Apache
will honor it.
&lt;/p&gt;

&lt;p&gt;
My local test server is running Ubuntu. In order to determine where the
"proper" place to enable name-based virtual hosting is, I simply went to
the /etc/apache2 directory and executed:

&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
grep NameVirtualHost *
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;
That command searches for the &lt;code&gt;NameVirtualHost&lt;/code&gt;
directive, and it returned this:

&lt;/p&gt;&lt;/div&gt;
      
            &lt;div class="field field--name-node-link field--type-ds field--label-hidden field--item"&gt;  &lt;a href="https://www.linuxjournal.com/content/protect-your-ports-reverse-proxy" hreflang="und"&gt;Go to Full Article&lt;/a&gt;
&lt;/div&gt;
      
    &lt;/div&gt;
  &lt;/div&gt;

</description>
  <pubDate>Mon, 23 Dec 2013 20:28:32 +0000</pubDate>
    <dc:creator>Shawn Powers</dc:creator>
    <guid isPermaLink="false">1217775 at https://www.linuxjournal.com</guid>
    </item>

  </channel>
</rss>
