<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>reverse proxy Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/reverse-proxy/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Tue, 12 Feb 2019 17:26:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.12</generator>
	<item>
		<title>How to Install Varnish with Apache on CentOS 7</title>
		<link>https://www.osradar.com/how-to-install-varnish-with-apache-on-centos-7/</link>
					<comments>https://www.osradar.com/how-to-install-varnish-with-apache-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[Muhammad Nabeel]]></dc:creator>
		<pubDate>Tue, 12 Feb 2019 17:26:09 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=10723</guid>

					<description><![CDATA[<p>Varnish is an HTTP optimizer designed for content-heavy dynamic web sites and APIs. In contrast to other web accelerators, such as Squid, which began life as a client-side cache, or Apache and nginx, which are primarily origin servers, Varnish was designed as an HTTP accelerator. Varnish is focused exclusively on HTTP, unlike other proxy servers [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-varnish-with-apache-on-centos-7/">How to Install Varnish with Apache on CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Varnish is an HTTP optimizer designed for content-heavy dynamic web sites and APIs. In contrast to other web accelerators, such as Squid, which began life as a client-side cache, or Apache and nginx, which are primarily origin servers, Varnish was designed as an HTTP accelerator. Varnish is focused exclusively on HTTP, unlike other proxy servers that often support FTP, SMTP and other network protocols.</p>
<p>In this article, you will learn that how to install and configure varnish HTTP accelerator as a reverse proxy for Apache/Http server.</p>
<h1>Step 1: Install and configure Apache on CentOS 7</h1>
<p>Install Apache/Http using below command</p>
<pre class=""># yum install httpd -y</pre>
<p><img loading="lazy" class="alignnone wp-image-10724 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/1.jpg" alt="" width="943" height="186" srcset="https://www.osradar.com/wp-content/uploads/2019/02/1.jpg 943w, https://www.osradar.com/wp-content/uploads/2019/02/1-300x59.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/1-768x151.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/1-696x137.jpg 696w" sizes="(max-width: 943px) 100vw, 943px" /></p>
<p>After installation, start and enable httpd service using below commands.</p>
<pre class=""># systemctl start httpd
# systemctl enable httpd</pre>
<p><img loading="lazy" class="alignnone wp-image-10725 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/2.jpg" alt="" width="1239" height="192" srcset="https://www.osradar.com/wp-content/uploads/2019/02/2.jpg 1239w, https://www.osradar.com/wp-content/uploads/2019/02/2-300x46.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/2-768x119.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/2-1024x159.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/02/2-696x108.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/02/2-1068x166.jpg 1068w" sizes="(max-width: 1239px) 100vw, 1239px" /></p>
<p>Use below command to check httpd default port, you will see that it is running on port 80.</p>
<pre class=""># netstat -plntu</pre>
<p>Now Configure Apache on port 8080</p>
<p>By default Apache server runs on port 80 but we will configure it to run on port 8080.<br />
In order to do that we have to edit its configuration file &#8220;httpd.conf&#8221;</p>
<p>Use below command to edit httpd.conf file.<br />
And change the default port 80 to 8080 on the &#8220;Listen&#8221; line</p>
<pre class=""># vi /etc/httpd/conf/httpd.conf</pre>
<p>Save changes and exit.</p>
<p><img loading="lazy" class="alignnone wp-image-10726 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/3.jpg" alt="" width="895" height="202" srcset="https://www.osradar.com/wp-content/uploads/2019/02/3.jpg 895w, https://www.osradar.com/wp-content/uploads/2019/02/3-300x68.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/3-768x173.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/3-696x157.jpg 696w" sizes="(max-width: 895px) 100vw, 895px" /></p>
<p>Now restart the Apache/Httpd service and run again netstat command to verify it is running on port 8080.</p>
<pre class=""># systemctl restart httpd
# netstat -plntu</pre>
<p><img loading="lazy" class="alignnone wp-image-10727 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/4.jpg" alt="" width="1111" height="400" srcset="https://www.osradar.com/wp-content/uploads/2019/02/4.jpg 1111w, https://www.osradar.com/wp-content/uploads/2019/02/4-300x108.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/4-768x277.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/4-1024x369.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/02/4-696x251.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/02/4-1068x385.jpg 1068w" sizes="(max-width: 1111px) 100vw, 1111px" /></p>
<h1>Step 2: Install and configure Varnish</h1>
<p>First Install EPEL Repo using the below command.</p>
<pre class=""># yum install epel-release -y</pre>
<p>Now install Varnish using the below command.</p>
<pre class=""># yum install varnish -y</pre>
<p>After installation, start and enable varnish service using below commands.</p>
<pre class=""># systemctl start varnish
# systemctl enable varnish</pre>
<p><img loading="lazy" class="alignnone wp-image-10728 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/5.jpg" alt="" width="1268" height="181" srcset="https://www.osradar.com/wp-content/uploads/2019/02/5.jpg 1268w, https://www.osradar.com/wp-content/uploads/2019/02/5-300x43.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/5-768x110.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/5-1024x146.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/02/5-696x99.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/02/5-1068x152.jpg 1068w" sizes="(max-width: 1268px) 100vw, 1268px" /></p>
<p>Use below command to check varnish default ports, you will see that it is running on port 6081 and 6082.</p>
<pre class=""># netstat -plntu</pre>
<p><img loading="lazy" class="alignnone wp-image-10729 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/6.jpg" alt="" width="1134" height="291" srcset="https://www.osradar.com/wp-content/uploads/2019/02/6.jpg 1134w, https://www.osradar.com/wp-content/uploads/2019/02/6-300x77.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/6-768x197.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/6-1024x263.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/02/6-696x179.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/02/6-1068x274.jpg 1068w" sizes="(max-width: 1134px) 100vw, 1134px" /></p>
<p>Configure Varnish as reverse proxy for Apache</p>
<p>Use below command to edit varnish.params file.<br />
And change its default port 6081 to http port 80 on the line VARNISH_LISTEN_PORT.</p>
<pre class=""># vi /etc/varnish/varnish.params</pre>
<p>save changes and exit.</p>
<p><img loading="lazy" class="alignnone wp-image-10730 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/7.jpg" alt="" width="987" height="400" srcset="https://www.osradar.com/wp-content/uploads/2019/02/7.jpg 987w, https://www.osradar.com/wp-content/uploads/2019/02/7-300x122.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/7-768x311.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/7-696x282.jpg 696w" sizes="(max-width: 987px) 100vw, 987px" /></p>
<p>Now restart the varnish service and run again netstat command to verify it is running on port 80.</p>
<pre class=""># systemctl restart varnish
# netstat -plntu</pre>
<p><img loading="lazy" class="alignnone wp-image-10731 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/8.jpg" alt="" width="1052" height="425" srcset="https://www.osradar.com/wp-content/uploads/2019/02/8.jpg 1052w, https://www.osradar.com/wp-content/uploads/2019/02/8-300x121.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/8-768x310.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/8-1024x414.jpg 1024w, https://www.osradar.com/wp-content/uploads/2019/02/8-696x281.jpg 696w, https://www.osradar.com/wp-content/uploads/2019/02/8-1040x420.jpg 1040w" sizes="(max-width: 1052px) 100vw, 1052px" /></p>
<p>Congratulations, Varnish HTTP Accelerator has been installed successfully and now it acts as a reverse proxy for Apache web server.</p>
<h1>Step 3: Configure Firewalld</h1>
<p>In this step, we will add HTTP and HTTPS services so that our web server can run publically.</p>
<p>Install and enable firewalld using below commands</p>
<pre class=""># yum install firewalld -y
# systemctl start firewalld
# systemctl enable firewalld</pre>
<p>Use below command to add HTTP and HTTPS services in firewalld.<br />
Then reload firewall to apply new changes.</p>
<pre class=""># firewall-cmd --add-service={http,https} --permanent
# firewall-cmd --reload</pre>
<p><img loading="lazy" class="alignnone wp-image-10732 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/9.jpg" alt="" width="905" height="182" srcset="https://www.osradar.com/wp-content/uploads/2019/02/9.jpg 905w, https://www.osradar.com/wp-content/uploads/2019/02/9-300x60.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/9-768x154.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/9-696x140.jpg 696w" sizes="(max-width: 905px) 100vw, 905px" /></p>
<h1>Step 4: Testing</h1>
<p>Run below command to test varnish.<br />
Note: Replace <strong>osradar.localdomain.local</strong> with your own domain.</p>
<pre class=""># curl -I osradar.localdomain.local</pre>
<p><img loading="lazy" class="alignnone wp-image-10733 size-full" src="https://www.osradar.com/wp-content/uploads/2019/02/10.jpg" alt="" width="941" height="320" srcset="https://www.osradar.com/wp-content/uploads/2019/02/10.jpg 941w, https://www.osradar.com/wp-content/uploads/2019/02/10-300x102.jpg 300w, https://www.osradar.com/wp-content/uploads/2019/02/10-768x261.jpg 768w, https://www.osradar.com/wp-content/uploads/2019/02/10-696x237.jpg 696w" sizes="(max-width: 941px) 100vw, 941px" /></p>
<p>Congratulations! Varnish HTTP accelerator has been installed successfully and running as a reverse proxy for the Apache web server.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/how-to-install-varnish-with-apache-on-centos-7/">How to Install Varnish with Apache on CentOS 7</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/how-to-install-varnish-with-apache-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
