<?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>Linux Ask! &#187; Servers</title>
	<atom:link href="http://www.linuxask.com/topics/servers/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxask.com</link>
	<description>Linux Ask! is a Q &#38; A web site specific for Linux related questions such as how to use common Linux commands.</description>
	<lastBuildDate>Tue, 05 May 2015 07:15:40 +0000</lastBuildDate>
	<language>en-US</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>How to check how many established connection of my web server?</title>
		<link>http://www.linuxask.com/questions/how-to-check-how-many-established-connection-of-my-web-server</link>
		<comments>http://www.linuxask.com/questions/how-to-check-how-many-established-connection-of-my-web-server#comments</comments>
		<pubDate>Thu, 18 Jul 2013 04:16:13 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Advanced Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Commands]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[Squid]]></category>
		<category><![CDATA[networking]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=4277</guid>
		<description><![CDATA[How to check how many established connection of my web server? Answer: Assume you server is listening on port 80, you can check how many established connection to this port with the following command: netstat -an &#124; grep :80 &#124; grep ESTABLISHED &#124; wc -l 4919<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/check-the-number-of-active-apache-connection" rel="bookmark" title="Check the number of active Apache connection">Check the number of active Apache connection </a></li>
<li><a href="http://www.linuxask.com/questions/check-for-the-number-of-connection-from-a-particular-ip-address" rel="bookmark" title="Check for the number of connection from a particular IP address">Check for the number of connection from a particular IP address </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-kill-a-tcp-connection-using-tcpkill" rel="bookmark" title="How to kill a TCP connection using tcpkill?">How to kill a TCP connection using tcpkill? </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>How to check how many established connection of my web server?</p>
<p><strong>Answer:</strong></p>
<p>Assume you server is listening on <strong>port 80</strong>, you can check how many established connection to this port with the following command:</p>
<pre><code>netstat -an | grep :80 | grep ESTABLISHED | wc -l
4919
</code></pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/check-the-number-of-active-apache-connection" rel="bookmark" title="Check the number of active Apache connection">Check the number of active Apache connection </a></li>
<li><a href="http://www.linuxask.com/questions/check-for-the-number-of-connection-from-a-particular-ip-address" rel="bookmark" title="Check for the number of connection from a particular IP address">Check for the number of connection from a particular IP address </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-kill-a-tcp-connection-using-tcpkill" rel="bookmark" title="How to kill a TCP connection using tcpkill?">How to kill a TCP connection using tcpkill? </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/how-to-check-how-many-established-connection-of-my-web-server/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The difference between last and break used in Nginx URL rewrite</title>
		<link>http://www.linuxask.com/questions/the-difference-between-last-and-break-used-in-nginx-url-rewrite</link>
		<comments>http://www.linuxask.com/questions/the-difference-between-last-and-break-used-in-nginx-url-rewrite#comments</comments>
		<pubDate>Wed, 26 Oct 2011 15:21:09 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3568</guid>
		<description><![CDATA[The difference between last and break used in Nginx URL rewrite Answer: When you rewrite URL using the Nginx's rewrite directive, you might be confused that what are the exact difference between last and break? From the official site: http://wiki.nginx.org/HttpRewriteModule#rewrite last - completes processing of rewrite directives, after which searches for corresponding URI and location <a href='http://www.linuxask.com/questions/the-difference-between-last-and-break-used-in-nginx-url-rewrite' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module" rel="bookmark" title="Debug Nginx configuration using the echo module">Debug Nginx configuration using the echo module </a></li>
<li><a href="http://www.linuxask.com/questions/add-custom-http-header-by-nginx" rel="bookmark" title="Add custom HTTP header by nginx">Add custom HTTP header by nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-expire-header-in-nginx" rel="bookmark" title="Enable Expire header in Nginx">Enable Expire header in Nginx </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>The difference between last and break used in Nginx URL rewrite</p>
<p><strong>Answer:</strong></p>
<p>When you rewrite URL using the <strong>Nginx's rewrite </strong>directive, you might be confused that what are the exact difference between <strong>last </strong> and <strong>break</strong>?</p>
<p>From the official site: <a href="http://wiki.nginx.org/HttpRewriteModule#rewrite">http://wiki.nginx.org/HttpRewriteModule#rewrite</a></p>
<pre><code>last - completes processing of rewrite directives, after which searches for corresponding URI and location
break - completes processing of rewrite directives and breakes location lookup cycle by not doing any location lookup and internal jump at all</code></pre>
<p>So: both directives will end the <strong>rewrite </strong>cycle, but <strong>break</strong> will not do any <strong>location </strong>lookup and <strong>internal jump </strong>afterward.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module" rel="bookmark" title="Debug Nginx configuration using the echo module">Debug Nginx configuration using the echo module </a></li>
<li><a href="http://www.linuxask.com/questions/add-custom-http-header-by-nginx" rel="bookmark" title="Add custom HTTP header by nginx">Add custom HTTP header by nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-expire-header-in-nginx" rel="bookmark" title="Enable Expire header in Nginx">Enable Expire header in Nginx </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/the-difference-between-last-and-break-used-in-nginx-url-rewrite/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debug Nginx configuration using the echo module</title>
		<link>http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module</link>
		<comments>http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module#comments</comments>
		<pubDate>Sun, 23 Oct 2011 15:15:25 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3564</guid>
		<description><![CDATA[Debug Nginx configuration using the echo module Answer: When you want to confirm you have configured Nginx correctly, e.g. make sure you have the right rewrite rules. The easiest way is to use the echo module to debug. E.g. .. location / { rewrite ^/foo /bar break; echo $uri; # try with other variables you <a href='http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/enable-debug-log-for-nginx" rel="bookmark" title="Enable debug log for Nginx">Enable debug log for Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/the-difference-between-last-and-break-used-in-nginx-url-rewrite" rel="bookmark" title="The difference between last and break used in Nginx URL rewrite">The difference between last and break used in Nginx URL rewrite </a></li>
<li><a href="http://www.linuxask.com/questions/adding-ssl-suport-in-nginx" rel="bookmark" title="Adding SSL suport in Nginx">Adding SSL suport in Nginx </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Debug Nginx configuration using the echo module</p>
<p><strong>Answer:</strong></p>
<p>When you want to confirm you have configured Nginx correctly, e.g. make sure you have the right <strong>rewrite rules</strong>. The easiest way is to use the <strong>echo </strong>module to debug.</p>
<p>E.g.</p>
<pre><code>..
location / {
    rewrite ^/foo /bar break;
    echo $uri; # try with other variables you want to trace
}</code></pre>
<p>When you use <strong>curl </strong>to request the page, you should receive something like:</p>
<pre><code># curl http://example.com/foo
bar
</code></pre>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/enable-debug-log-for-nginx" rel="bookmark" title="Enable debug log for Nginx">Enable debug log for Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/the-difference-between-last-and-break-used-in-nginx-url-rewrite" rel="bookmark" title="The difference between last and break used in Nginx URL rewrite">The difference between last and break used in Nginx URL rewrite </a></li>
<li><a href="http://www.linuxask.com/questions/adding-ssl-suport-in-nginx" rel="bookmark" title="Adding SSL suport in Nginx">Adding SSL suport in Nginx </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable debug log for Nginx</title>
		<link>http://www.linuxask.com/questions/enable-debug-log-for-nginx</link>
		<comments>http://www.linuxask.com/questions/enable-debug-log-for-nginx#comments</comments>
		<pubDate>Thu, 20 Oct 2011 15:13:38 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=3559</guid>
		<description><![CDATA[Enable debug log for Nginx Answer: Sometimes, you need to enable the debug log feature on Nginx for troubleshooting some nasty issues. Firstly, you need to make sure you have configured nginx to build with the debugging feature enabled # ./configure --with-debug ... If you are using the installing using apt-get on Ubuntu, you are <a href='http://www.linuxask.com/questions/enable-debug-log-for-nginx' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module" rel="bookmark" title="Debug Nginx configuration using the echo module">Debug Nginx configuration using the echo module </a></li>
<li><a href="http://www.linuxask.com/questions/enable-expire-header-in-nginx" rel="bookmark" title="Enable Expire header in Nginx">Enable Expire header in Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-gzip-compression-in-nginx" rel="bookmark" title="Enable gzip compression in Nginx">Enable gzip compression in Nginx </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Enable debug log for Nginx</p>
<p><strong>Answer:</strong></p>
<p>Sometimes, you need to enable the debug log feature on <strong>Nginx </strong>for troubleshooting some nasty issues.</p>
<p>Firstly, you need to make sure you have configured nginx to build with the debugging feature enabled</p>
<p><code># ./configure --with-debug ...</code></p>
<p>If you are using the installing using <strong>apt-get</strong> on Ubuntu, you are ready to go by setting the following in the Nginx config:</p>
<pre><code>...
error_log  /path/to/log  debug;
...</code></pre>
<p>Don't forget to restart the Nginx to take effect.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/debug-nginx-configuration-using-the-echo-module" rel="bookmark" title="Debug Nginx configuration using the echo module">Debug Nginx configuration using the echo module </a></li>
<li><a href="http://www.linuxask.com/questions/enable-expire-header-in-nginx" rel="bookmark" title="Enable Expire header in Nginx">Enable Expire header in Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-gzip-compression-in-nginx" rel="bookmark" title="Enable gzip compression in Nginx">Enable gzip compression in Nginx </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/enable-debug-log-for-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculating the max client in Nginx</title>
		<link>http://www.linuxask.com/questions/calculating-the-max-client-in-nginx</link>
		<comments>http://www.linuxask.com/questions/calculating-the-max-client-in-nginx#comments</comments>
		<pubDate>Wed, 27 Jul 2011 07:45:56 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2070</guid>
		<description><![CDATA[Calculating the max client in Nginx Answer: If you use Nginx as a web server, the max. number of client can be served at the same time by Nginx should be calculated by the following formula: max_clients = worker_processes * worker_connections But this does not equal to the number of users can be served at <a href='http://www.linuxask.com/questions/calculating-the-max-client-in-nginx' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-many-worker_processes-should-i-use-in-nginx" rel="bookmark" title="How many worker_processes should I use in Nginx?">How many worker_processes should I use in Nginx? </a></li>
<li><a href="http://www.linuxask.com/questions/adding-ssl-suport-in-nginx" rel="bookmark" title="Adding SSL suport in Nginx">Adding SSL suport in Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/block-a-client-from-connecting-to-mysql-if-too-many-errors" rel="bookmark" title="Block a client from connecting to MySQL if too many errors">Block a client from connecting to MySQL if too many errors </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Calculating the max client in Nginx</p>
<p><strong>Answer:</strong></p>
<p>If you use <strong>Nginx </strong> as a web server, the max. number of client can be served at the same time by Nginx should be calculated by the following formula:</p>
<p><code>max_clients = worker_processes * worker_connections</code></p>
<p>But this does not equal to the number of users can be served at the same time by Nginx, since a lot of browsers open 2 connections to the web server at the same time.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-many-worker_processes-should-i-use-in-nginx" rel="bookmark" title="How many worker_processes should I use in Nginx?">How many worker_processes should I use in Nginx? </a></li>
<li><a href="http://www.linuxask.com/questions/adding-ssl-suport-in-nginx" rel="bookmark" title="Adding SSL suport in Nginx">Adding SSL suport in Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/block-a-client-from-connecting-to-mysql-if-too-many-errors" rel="bookmark" title="Block a client from connecting to MySQL if too many errors">Block a client from connecting to MySQL if too many errors </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/calculating-the-max-client-in-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why SSL cannot be used with name-based virtual hosts?</title>
		<link>http://www.linuxask.com/questions/why-ssl-cannot-be-used-with-name-based-virtual-hosts</link>
		<comments>http://www.linuxask.com/questions/why-ssl-cannot-be-used-with-name-based-virtual-hosts#comments</comments>
		<pubDate>Mon, 16 May 2011 05:17:52 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2925</guid>
		<description><![CDATA[Why SSL cannot be used with name-based virtual hosts? Answer: The reason is pretty simple: If you are using a single IP but with many virtual hosts, each virtual hosts has their own certificate and private key. Without looking at the Host header in the incoming HTTP request, Apache will not be able to route <a href='http://www.linuxask.com/questions/why-ssl-cannot-be-used-with-name-based-virtual-hosts' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/convert-xen-img-based-vm-to-virtual-box" rel="bookmark" title="Convert Xen IMG based VM to Virtual Box">Convert Xen IMG based VM to Virtual Box </a></li>
<li><a href="http://www.linuxask.com/questions/mac-os-x-how-to-add-hosts-to-local-hosts-file" rel="bookmark" title="Mac OS X: How to Add Hosts to Local Hosts File">Mac OS X: How to Add Hosts to Local Hosts File </a></li>
<li><a href="http://www.linuxask.com/questions/unsafe-functions-for-mysqls-statement-based-replication" rel="bookmark" title="Unsafe functions for MySQL&#8217;s statement based replication">Unsafe functions for MySQL&#8217;s statement based replication </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Why SSL cannot be used with name-based virtual hosts?</p>
<p><strong>Answer:</strong></p>
<p>The reason is pretty simple: If you are using a single IP but with many virtual hosts, each virtual hosts has their own certificate and private key. Without looking at the <strong>Host </strong>header in the incoming HTTP request, Apache will not be able to route the request to the designated virtual hosts. The core problem is, the incoming requests are encrypted so we are not able to tell which key should be used for decryption!</p>
<p>So only IP-based virtual hosts works if you need SSL.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/convert-xen-img-based-vm-to-virtual-box" rel="bookmark" title="Convert Xen IMG based VM to Virtual Box">Convert Xen IMG based VM to Virtual Box </a></li>
<li><a href="http://www.linuxask.com/questions/mac-os-x-how-to-add-hosts-to-local-hosts-file" rel="bookmark" title="Mac OS X: How to Add Hosts to Local Hosts File">Mac OS X: How to Add Hosts to Local Hosts File </a></li>
<li><a href="http://www.linuxask.com/questions/unsafe-functions-for-mysqls-statement-based-replication" rel="bookmark" title="Unsafe functions for MySQL&#8217;s statement based replication">Unsafe functions for MySQL&#8217;s statement based replication </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/why-ssl-cannot-be-used-with-name-based-virtual-hosts/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limit Apache only listen to IPv4 address</title>
		<link>http://www.linuxask.com/questions/limit-apache-only-listen-to-ipv4-address</link>
		<comments>http://www.linuxask.com/questions/limit-apache-only-listen-to-ipv4-address#comments</comments>
		<pubDate>Fri, 06 May 2011 14:04:32 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2994</guid>
		<description><![CDATA[Limit Apache only listen to IPv4 address Answer: Apache httpd web server might listen IPv6 address if your system support IPv6. To disable IPv6 supprt, add the following lines to the Apache configuration (httpd.conf) # Listen 80 Listen 0.0.0.0:80 # New value Restart Apache to take effect # apachectl -k graceful<div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/set-php-settings-in-apache-configuration" rel="bookmark" title="Set PHP settings in Apache configuration">Set PHP settings in Apache configuration </a></li>
<li><a href="http://www.linuxask.com/questions/disable-x-powered-by-and-server-headers-in-apachephp" rel="bookmark" title="Disable X-Powered-By and Server headers in Apache/PHP">Disable X-Powered-By and Server headers in Apache/PHP </a></li>
<li><a href="http://www.linuxask.com/questions/set-default-charset-in-apache" rel="bookmark" title="Set default charset in Apache">Set default charset in Apache </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Limit Apache only listen to IPv4 address</p>
<p><strong>Answer:</strong></p>
<p>Apache httpd web server might listen IPv6 address if your system support IPv6. </p>
<p>To disable IPv6 supprt, add the following lines to the Apache configuration (<strong>httpd.conf</strong>)</p>
<pre><code># Listen 80
Listen 0.0.0.0:80 # New value</code></pre>
<p>Restart Apache to take effect</p>
<p><code># apachectl -k graceful </code></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/set-php-settings-in-apache-configuration" rel="bookmark" title="Set PHP settings in Apache configuration">Set PHP settings in Apache configuration </a></li>
<li><a href="http://www.linuxask.com/questions/disable-x-powered-by-and-server-headers-in-apachephp" rel="bookmark" title="Disable X-Powered-By and Server headers in Apache/PHP">Disable X-Powered-By and Server headers in Apache/PHP </a></li>
<li><a href="http://www.linuxask.com/questions/set-default-charset-in-apache" rel="bookmark" title="Set default charset in Apache">Set default charset in Apache </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/limit-apache-only-listen-to-ipv4-address/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Enable Expire header in Nginx</title>
		<link>http://www.linuxask.com/questions/enable-expire-header-in-nginx</link>
		<comments>http://www.linuxask.com/questions/enable-expire-header-in-nginx#comments</comments>
		<pubDate>Sat, 30 Apr 2011 07:48:19 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2075</guid>
		<description><![CDATA[Enable Expire header in Nginx Answer: Enabling Expire header for static contents is useful to reduce the loading of your web server. If you are using nginx, it is easy by adding the following lines in your nginx.conf location ~* \.(ico&#124;css&#124;js&#124;gif&#124;jpe?g&#124;png)$ { expires max; } So all files with the above extensions will be delivered <a href='http://www.linuxask.com/questions/enable-expire-header-in-nginx' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/add-custom-http-header-by-nginx" rel="bookmark" title="Add custom HTTP header by nginx">Add custom HTTP header by nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-debug-log-for-nginx" rel="bookmark" title="Enable debug log for Nginx">Enable debug log for Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-gzip-compression-in-nginx" rel="bookmark" title="Enable gzip compression in Nginx">Enable gzip compression in Nginx </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Enable Expire header in Nginx</p>
<p><strong>Answer:</strong></p>
<p>Enabling <strong>Expire header</strong> for static contents is useful to reduce the loading of your web server.</p>
<p>If you are using <strong>nginx</strong>, it is easy by adding the following lines in your <strong>nginx.conf</strong></p>
<pre><code>location ~* \.(ico|css|js|gif|jpe?g|png)$ {
    expires max;
}
</code></pre>
<p>So all files with the above extensions will be delivered with the <strong>maximum </strong>expire header.</p>
<p>If you want user to update the cached contents, make sure you have change the path (i.e. rename) of these resources.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/add-custom-http-header-by-nginx" rel="bookmark" title="Add custom HTTP header by nginx">Add custom HTTP header by nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-debug-log-for-nginx" rel="bookmark" title="Enable debug log for Nginx">Enable debug log for Nginx </a></li>
<li><a href="http://www.linuxask.com/questions/enable-gzip-compression-in-nginx" rel="bookmark" title="Enable gzip compression in Nginx">Enable gzip compression in Nginx </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/enable-expire-header-in-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Block request by user agent in Apache</title>
		<link>http://www.linuxask.com/questions/block-request-by-user-agent-in-apache</link>
		<comments>http://www.linuxask.com/questions/block-request-by-user-agent-in-apache#comments</comments>
		<pubDate>Fri, 31 Dec 2010 13:20:01 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2709</guid>
		<description><![CDATA[Block request by user agent in Apache Answer: If you want to block request to your web site, by user agent string, you can change by editing the Apache's configuration. Add the following lines to the Apache configuration (httpd.conf) RewriteCond %{HTTP_USER_AGENT} googlebot RewriteRule . - [F,L] The above config block all requests from Google's Bot. <a href='http://www.linuxask.com/questions/block-request-by-user-agent-in-apache' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-restart-apache-without-disconnecting-user" rel="bookmark" title="How to restart Apache without disconnecting user">How to restart Apache without disconnecting user </a></li>
<li><a href="http://www.linuxask.com/questions/get-http-request-with-nc-command" rel="bookmark" title="Get HTTP request with nc command">Get HTTP request with nc command </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-hide-images-request-in-my-apaches-log" rel="bookmark" title="How to hide images request in my Apache&#8217;s log?">How to hide images request in my Apache&#8217;s log? </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Block request by user agent in Apache</p>
<p><strong>Answer:</strong></p>
<p>If you want to block request to your web site, by <strong>user agent</strong> string, you can change by editing the Apache's configuration.</p>
<p>Add the following lines to the Apache configuration (<strong>httpd.conf</strong>)</p>
<pre><code>RewriteCond %{HTTP_USER_AGENT} googlebot
RewriteRule . - [F,L]
</code></pre>
<p>The above config block all requests from Google's Bot. (Make sure  <strong>mod_rewrite </strong>is installed and enabled)</p>
<p>Also, remember to restart Apache to take effect</p>
<p><code># apachectl -k graceful </code></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/how-to-restart-apache-without-disconnecting-user" rel="bookmark" title="How to restart Apache without disconnecting user">How to restart Apache without disconnecting user </a></li>
<li><a href="http://www.linuxask.com/questions/get-http-request-with-nc-command" rel="bookmark" title="Get HTTP request with nc command">Get HTTP request with nc command </a></li>
<li><a href="http://www.linuxask.com/questions/how-to-hide-images-request-in-my-apaches-log" rel="bookmark" title="How to hide images request in my Apache&#8217;s log?">How to hide images request in my Apache&#8217;s log? </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/block-request-by-user-agent-in-apache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Turn off directory listing in Apache</title>
		<link>http://www.linuxask.com/questions/turn-off-directory-listing-in-apache</link>
		<comments>http://www.linuxask.com/questions/turn-off-directory-listing-in-apache#comments</comments>
		<pubDate>Thu, 30 Dec 2010 13:26:21 +0000</pubDate>
		<dc:creator><![CDATA[Linux Ask!]]></dc:creator>
				<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://www.linuxask.com/?p=2713</guid>
		<description><![CDATA[Turn off directory listing in Apache Answer: If you web site's directory without a valid default index page, e.g. index.html, Apache might list all files inside the directory. If you want to turn off, do the following. Add the following lines to the Apache configuration (httpd.conf) Options All -Indexes Restart Apache to take effect # <a href='http://www.linuxask.com/questions/turn-off-directory-listing-in-apache' class='excerpt-more'>[...]</a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/turn-on-expire-headers-in-apache" rel="bookmark" title="Turn on expire headers in Apache">Turn on expire headers in Apache </a></li>
<li><a href="http://www.linuxask.com/questions/set-the-default-index-page-for-apache" rel="bookmark" title="Set the default index page for Apache">Set the default index page for Apache </a></li>
<li><a href="http://www.linuxask.com/questions/set-php-settings-in-apache-configuration" rel="bookmark" title="Set PHP settings in Apache configuration">Set PHP settings in Apache configuration </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<p>Turn off directory listing in Apache</p>
<p><strong>Answer:</strong></p>
<p>If you web site's directory without a valid <strong>default index page</strong>, e.g. index.html, Apache might list all files inside the directory. If you want to turn off, do the following.</p>
<p>Add the following lines to the Apache configuration (<strong>httpd.conf</strong>)</p>
<pre><code>Options All -Indexes  
</code></pre>
<p>Restart Apache to take effect</p>
<p><code># apachectl -k graceful </code></p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="http://www.linuxask.com/questions/turn-on-expire-headers-in-apache" rel="bookmark" title="Turn on expire headers in Apache">Turn on expire headers in Apache </a></li>
<li><a href="http://www.linuxask.com/questions/set-the-default-index-page-for-apache" rel="bookmark" title="Set the default index page for Apache">Set the default index page for Apache </a></li>
<li><a href="http://www.linuxask.com/questions/set-php-settings-in-apache-configuration" rel="bookmark" title="Set PHP settings in Apache configuration">Set PHP settings in Apache configuration </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxask.com/questions/turn-off-directory-listing-in-apache/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
