<?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>nginx &#8211; lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</title>
	<atom:link href="https://lifelinux.com/tag/nginx-2/feed/" rel="self" type="application/rss+xml" />
	<link>https://lifelinux.com</link>
	<description>All About Linux !</description>
	<lastBuildDate>Thu, 06 Nov 2014 15:42:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.5.3</generator>
	<item>
		<title>How To Install HHVM 3.2.0 On CentOS 6.5</title>
		<link>https://lifelinux.com/how-to-install-hhvm-3-2-0-on-centos-6-5/</link>
					<comments>https://lifelinux.com/how-to-install-hhvm-3-2-0-on-centos-6-5/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 06 Nov 2014 15:40:34 +0000</pubDate>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[web programming]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[HHVM]]></category>
		<category><![CDATA[intall hhvm]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[nginx + hhvm]]></category>
		<category><![CDATA[wget]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1945</guid>

					<description><![CDATA[<p>HipHop Virtual Machine (HHVM) is a process virtual machine based on just-in-time (JIT) compilation, serving as an execution engine for PHP and Hack programming languages. By using the principle of JIT compilation, executed PHP or Hack code is first transformed into intermediate HipHop bytecode (HHBC), which is then dynamically translated into the x86-64 machine code, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-install-hhvm-3-2-0-on-centos-6-5/">How To Install HHVM 3.2.0 On CentOS 6.5</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>HipHop Virtual Machine (HHVM) is a process virtual machine based on just-in-time (JIT) compilation, serving as an execution engine for PHP and Hack programming languages. By using the principle of JIT compilation, executed PHP or Hack code is first transformed into intermediate HipHop bytecode (HHBC), which is then dynamically translated into the x86-64 machine code, optimized and natively executed.<br />
<span id="more-1945"></span><br />
According to their website, HHVM has realized over a 9x increase in web request throughput and over a 5x reduction in memory consumption for Facebook compared with the Zend PHP engine + APC (which is the current way of hosting a large majority of PHP applications).</p>
<h2>Installing HHVM</h2>
<p>Installing HHVM is quite straightforward and shouldn&#8217;t take more than a few minutes.<br />
Login as root and execute the following commands from the command line will have HHVM installed and ready:</p>
<pre>
# cd /etc/yum.repos.d
# wget http://www.hop5.in/yum/el6/hop5.repo
# yum install hhvm
</pre>
<p>Sample output</p>
<pre>
Dependencies Resolved

================================================================================
 Package                   Arch       Version                    Repository
                                                                           Size
================================================================================
Installing:
 hhvm                      x86_64     3.2.0-1.el6                hop5     9.6 M
Installing for dependencies:
 GConf2                    x86_64     2.28.0-6.el6               base     964 k
 ImageMagick               x86_64     6.8.6.3-4.el6              hop5     138 k
 ImageMagick-libs          x86_64     6.8.6.3-4.el6              hop5     1.9 M
 ORBit2                    x86_64     2.14.17-5.el6              base     168 k
 OpenEXR-libs              x86_64     1.6.1-8.1.el6              base     197 k
 boost                     x86_64     1.54.0-7.el6               hop5      32 k
 boost-atomic              x86_64     1.54.0-7.el6               hop5      34 k
 boost-chrono              x86_64     1.54.0-7.el6               hop5      40 k
 boost-context             x86_64     1.54.0-7.el6               hop5      33 k
 boost-date-time           x86_64     1.54.0-7.el6               hop5      47 k
 boost-filesystem          x86_64     1.54.0-7.el6               hop5      63 k
 boost-graph               x86_64     1.54.0-7.el6               hop5     126 k
 boost-iostreams           x86_64     1.54.0-7.el6               hop5      55 k
 boost-locale              x86_64     1.54.0-7.el6               hop5     251 k
 boost-log                 x86_64     1.54.0-7.el6               hop5     599 k
 boost-math                x86_64     1.54.0-7.el6               hop5     324 k
 boost-program-options     x86_64     1.54.0-7.el6               hop5     145 k
 boost-python              x86_64     1.54.0-7.el6               hop5     124 k
 boost-random              x86_64     1.54.0-7.el6               hop5      36 k
 boost-regex               x86_64     1.54.0-7.el6               hop5     298 k
 boost-serialization       x86_64     1.54.0-7.el6               hop5     155 k
 boost-signals             x86_64     1.54.0-7.el6               hop5      56 k
 boost-system              x86_64     1.54.0-7.el6               hop5      36 k
 boost-test                x86_64     1.54.0-7.el6               hop5     212 k
 boost-thread              x86_64     1.54.0-7.el6               hop5      55 k
 boost-timer               x86_64     1.54.0-7.el6               hop5      38 k
 boost-wave                x86_64     1.54.0-7.el6               hop5     198 k
 fftw                      x86_64     3.2.1-3.1.el6              base     1.2 M
 gd                        x86_64     2.0.35-11.el6              base     142 k
 ghostscript               x86_64     8.70-19.el6                base     4.4 M
 ghostscript-fonts         noarch     5.50-23.2.el6              base     590 k
 glog                      x86_64     0.3.2-1.el6                hop5      48 k
 ilmbase                   x86_64     1.0.1-6.1.el6              base      72 k
 jemalloc                  x86_64     3.6.0-1.el6                epel     100 k
 lcms2                     x86_64     2.3-2.el6                  epel     127 k
 libICE                    x86_64     1.0.6-1.el6                base      53 k
 libIDL                    x86_64     0.8.13-2.1.el6             base      83 k
 libSM                     x86_64     1.2.1-2.el6                base      37 k
 libXfont                  x86_64     1.4.5-3.el6_5              base     136 k
 libXt                     x86_64     1.1.4-6.1.el6              base     165 k
 libcroco                  x86_64     0.6.2-5.el6                base     100 k
 libdwarf                  x86_64     20140413-1.el6             epel     108 k
 libfontenc                x86_64     1.0.5-2.el6                base      24 k
 libgsf                    x86_64     1.14.15-5.el6              base     116 k
 libicu                    x86_64     4.2.1-9.1.el6_2            base     4.9 M
 libmcrypt                 x86_64     2.5.8-9.el6                epel      96 k
 libmemcached              x86_64     1.0.16-1.el6               hop5     208 k
 libmpc                    x86_64     0.8.3-0.3.svn855.el6       hop5      47 k
 librsvg2                  x86_64     2.26.0-14.el6              base     140 k
 libtool-ltdl              x86_64     2.4.2-21.el6               hop5      46 k
 libunwind                 x86_64     1.1-2.el6                  epel      54 k
 libwmf-lite               x86_64     0.2.8.4-23.el6             base      51 k
 libxslt                   x86_64     1.1.26-2.el6_3.1           base     452 k
 mysql                     x86_64     5.1.73-3.el6_5             base     894 k
 ocaml                     x86_64     3.12.1-12.el6              hop5     5.5 M
 ocaml-runtime             x86_64     3.12.1-12.el6              hop5     1.4 M
 oniguruma                 x86_64     5.9.1-3.1.el6              base     123 k
 sgml-common               noarch     0.6.3-33.el6               base      43 k
 tbb                       x86_64     4.0-7.20120408.el6         hop5     103 k
 unixODBC                  x86_64     2.2.14-14.el6              base     378 k
 urw-fonts                 noarch     2.4-10.el6                 base     3.1 M
 xorg-x11-font-utils       x86_64     1:7.2-11.el6               base      75 k
Updating for dependencies:
 cpp                       x86_64     4.8.2-8.el6                hop5     5.7 M
 curl                      x86_64     7.29.0-4.el6               hop5     256 k
 gcc                       x86_64     4.8.2-8.el6                hop5      17 M
 gcc-c++                   x86_64     4.8.2-8.el6                hop5     6.9 M
 libcurl                   x86_64     7.29.0-4.el6               hop5     198 k
 libcurl-devel             x86_64     7.29.0-4.el6               hop5     294 k
 libevent                  x86_64     1.4.14b-2.hphp.el6         hop5      66 k
 libgcc                    x86_64     4.8.2-8.el6                hop5      83 k
 libgomp                   x86_64     4.8.2-8.el6                hop5     100 k
 libstdc++                 x86_64     4.8.2-8.el6                hop5     289 k
 libstdc++-devel           x86_64     4.8.2-8.el6                hop5     1.5 M

Transaction Summary
================================================================================
Install      63 Package(s)
Upgrade      11 Package(s)

Total download size: 73 M
Is this ok [y/N]: <strong>y</strong>
</pre>
<p>To confirm that HHVM has been installed, type the following command:</p>
<pre>
# hhvm --version
</pre>
<p>This will show details of how the hhvm command can be used from the command line. Here is a sample screenshot that illustrates this:</p>
<pre>
HipHop VM 3.2.0 (rel)
Compiler: tags/HHVM-3.2.0-0-g01228273b8cf709aacbd3df1c51b1e690ecebac8
Repo schema: c52ba40f4a246d35a88f1dfc1daf959851ced8aa
</pre>
<h2>Using Nginx with HHVM</h2>
<p>If you are using Nginx with PHP-FPM, you&#8217;ll have to modify the configuration file to enable the use of HHVM.</p>
<p>Look for the following section and make sure it&#8217;s all uncommented (by remove a # at the beginning of each line)</p>
<pre>
location ~ \.php$ {
       fastcgi_pass 127.0.0.1:9000;
       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       include fastcgi_params;
}
</pre>
<p>Create a file called name &#8220;hhsvr&#8221; to start or restart HHVM service</p>
<pre>
# vi /usr/bin/hhsrv
# chmod +x /usr/bin/hhsrv
</pre>
<p>Append </p>
<pre>
#!/bin/bash
LOG="/var/log/hhvm.log"
CMD="hhvm --mode server -vServer.Type=fastcgi -vServer.Port=9000"
if [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
        echo "To restart HHVM: /usr/bin/hhsrv restart|stop\n"
        exit;
fi

# Restart HHVM
if [ "$1" == "restart" ]; then
        PID=$(ps aux | grep -v grep | grep hhvm | awk '{print $2}')
        echo "Restarting HHVM..."
        if [ "${PID}" != "" ]; then
                kill -9 ${PID}
        fi
        echo "Starting HHVM ..."
        ${CMD} > /dev/null 2>&1 &
        echo "DONE !!!"
fi

# Stop HHVM
if [ "$1" == "stop" ]; then
        PID=$(ps aux | grep -v grep | grep hhvm | awk '{print $2}')
        echo "Restarting HHVM..."
        if [ "${PID}" != "" ]; then
                kill -9 ${PID}
        fi
        echo "HHVM stopped !!!"
fi
</pre>
<p>Final, Type the following command to start HHVM</p>
<pre>
# hhsrv restart
</pre>
<g:plusone href="https://lifelinux.com/how-to-install-hhvm-3-2-0-on-centos-6-5/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-install-hhvm-3-2-0-on-centos-6-5/">How To Install HHVM 3.2.0 On CentOS 6.5</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-install-hhvm-3-2-0-on-centos-6-5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Nginx 413 Request Entity Too Large</title>
		<link>https://lifelinux.com/nginx-413-request-entity-too-large/</link>
					<comments>https://lifelinux.com/nginx-413-request-entity-too-large/#respond</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Fri, 26 Aug 2011 13:10:04 +0000</pubDate>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[client request]]></category>
		<category><![CDATA[client_max_body_size]]></category>
		<category><![CDATA[content length]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[image upload]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[Request Entity Too Large]]></category>
		<category><![CDATA[reverse proxy]]></category>
		<category><![CDATA[size image]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1132</guid>

					<description><![CDATA[<p>I&#8217;m currently running web server using Nginx. And when i try to upload file more than 1M, i got Nginx error 403: Request entity too large. How do I fix this problem and allow file upload upto 2MB in size? client_max_body_size assigns the maximum accepted body size of client request, indicated by the line Content-Length [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/nginx-413-request-entity-too-large/">Nginx 413 Request Entity Too Large</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p>I&#8217;m currently running web server using Nginx. And when i try to upload file more than 1M, i got Nginx error 403: Request entity too large. How do I fix this problem and allow file upload upto 2MB in size?<br />
<span id="more-1132"></span><br />
<strong>client_max_body_size</strong> assigns the maximum accepted body size of client request, indicated by the line Content-Length in the header of request. If size is greater the given one, then the client gets the error &#8220;Request Entity Too Large&#8221; (413). To fix this, type the following command as root</p>
<pre>
# vi /usr/local/nginx/conf/nginx.conf
</pre>
<p>Add client_max_body_size in http section</p>
<pre>
http {
    ....
    client_max_body_size 2M;
    ....
}
</pre>
<p>Save and close the file. Reload the nginx, type the following command</p>
<pre>
# /usr/local/nginx/sbin/nginx -s reload
</pre>
<g:plusone href="https://lifelinux.com/nginx-413-request-entity-too-large/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/nginx-413-request-entity-too-large/">Nginx 413 Request Entity Too Large</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/nginx-413-request-entity-too-large/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Optimize Nginx For Maximum Performance</title>
		<link>https://lifelinux.com/how-to-optimize-nginx-for-maximum-performance/</link>
					<comments>https://lifelinux.com/how-to-optimize-nginx-for-maximum-performance/#comments</comments>
		
		<dc:creator><![CDATA[lifeLinux]]></dc:creator>
		<pubDate>Thu, 25 Aug 2011 13:52:25 +0000</pubDate>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[WebServer]]></category>
		<category><![CDATA[best performance for nginx]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[optimize nginx]]></category>
		<category><![CDATA[Optimizing Nginx]]></category>
		<category><![CDATA[Optimizing Nginx for High Traffic Loads]]></category>
		<category><![CDATA[turning nginx]]></category>
		<guid isPermaLink="false">http://www.lifelinux.com/?p=1027</guid>

					<description><![CDATA[<p>Nginx is an open-source Web Server. It is a high-performance HTTP server that uses very low server resources, is reliable and integrates beautifully with Linux. In this article, I&#8217;ll talk about optimizing your nginx server for maximum performance. Install Nginx with a minimal number of modules Run Nginx with only the required modules. This reduces [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-optimize-nginx-for-maximum-performance/">How To Optimize Nginx For Maximum Performance</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p></p><p><strong>Nginx</strong> is an open-source Web Server. It is a high-performance HTTP server that uses very low server resources, is reliable and integrates beautifully with Linux. In this article, I&#8217;ll talk about optimizing your nginx server for maximum performance.<br />
<span id="more-1027"></span></p>
<h2>Install Nginx with a minimal number of modules</h2>
<p>Run Nginx with only the required modules. This reduces the memory footprint and hence the server performance. Example configuration</p>
<pre>
./configure --prefix=/webserver/nginx --without-mail_pop3_module --without-mail_imap_module  --without-mail_smtp_module --with-http_ssl_module  --with-http_stub_status_module  --with-http_gzip_static_module
</pre>
<h2>worker_processes</h2>
<p>A worker process is a single-threaded process. If Nginx is doing CPU-intensive work such as SSL or gzipping and you have 2 or more CPUs/cores, then you may set worker_processes to be equal to the number of CPUs or cores. Example, i&#8217;m running nginx on server has CPU is X3340 (4 cores) then i set <strong>worker_processes = 4</strong>. If you are serving a lot of static files and the total size of the files is bigger than the available memory, then you may increase worker_processes to fully utilize disk bandwidth.</p>
<h2>worker_connections</h2>
<p>This sets the number of connections that each worker can handle. You can determine the value by using <strong>ulimit -n</strong> command which output is something like 1024, then your worker connections would need to be set to 1024 or less but 1024 is a good default setting.<br />
You can work out the maximum clients value by multiplying this and the worker_processes settings</p>
<pre>
max_clients = worker_processes * worker_connections
</pre>
<h2>Buffers</h2>
<p>One of the most important things you need to tweak is the buffer sizes you allow Nginx to use. If the buffer sizes are set too low Nginx will have to store the responses from upstreams in a temporary file which causes both write and read IO, the more traffic you get the more of a problem this becomes. Edit and set the buffer size limitations for all clients as follows:</p>
<pre>
client_body_buffer_size 8K;
client_header_buffer_size 1k;
client_max_body_size 2m;
large_client_header_buffers 2 1k;
</pre>
<p>Where,</p>
<p><strong>1. client_body_buffer_size:</strong> The directive specifies the client request body buffer size. If the request body is more than the buffer, then the entire request body or some part is written in a temporary file.<br />
<strong>2. client_header_buffer_size:</strong> Directive sets the headerbuffer size for the request header from client. For the overwhelming majority of requests it is completely sufficient a buffer size of 1K.<br />
<strong>3. client_max_body_size:</strong> Directive assigns the maximum accepted body size of client request, indicated by the line Content-Length in the header of request. If size is greater the given one, then the client gets the error &#8220;Request Entity Too Large&#8221; (413).<br />
<strong>4. large_client_header_buffers:</strong> Directive assigns the maximum number and size of buffers for large headers to read from client request. The request line can not be bigger than the size of one buffer, if the client send a bigger header nginx returns error &#8220;Request URI too large&#8221; (414). The longest header line of request also must be not more than the size of one buffer, otherwise the client get the error &#8220;Bad request&#8221; (400).</p>
<p>You also need to control timeouts to improve server performance and cut clients. Edit it as follows:</p>
<pre>
client_body_timeout   10;
client_header_timeout 10;
keepalive_timeout     15;
send_timeout          10;
</pre>
<p>Where,</p>
<p><strong>1. client_body_timeout:</strong> Directive sets the read timeout for the request body from client. The timeout is set only if a body is not get in one readstep. If after this time the client send nothing, nginx returns error &#8220;Request time out&#8221; (408).<br />
<strong>2. client_header_timeout:</strong> Directive assigns timeout with reading of the title of the request of client. The timeout is set only if a header is not get in one readstep. If after this time the client send nothing, nginx returns error &#8220;Request time out&#8221; (408).<br />
<strong>3. keepalive_timeout:</strong> The first parameter assigns the timeout for keep-alive connections with the client. The server will close connections after this time. The optional second parameter assigns the time value in the header Keep-Alive: timeout=time of the response. This header can convince some browsers to close the connection, so that the server does not have to. Without this parameter, nginx does not send a Keep-Alive header (though this is not what makes a connection &#8220;keep-alive&#8221;).<br />
<strong>4. send_timeout:</strong> Directive assigns response timeout to client. Timeout is established not on entire transfer of answer, but only between two operations of reading, if after this time client will take nothing, then nginx is shutting down the connection.</p>
<g:plusone href="https://lifelinux.com/how-to-optimize-nginx-for-maximum-performance/" size="standard"  annotation="none"   ></g:plusone><p>The post <a rel="nofollow" href="https://lifelinux.com/how-to-optimize-nginx-for-maximum-performance/">How To Optimize Nginx For Maximum Performance</a> appeared first on <a rel="nofollow" href="https://lifelinux.com">lifeLinux: Linux Tips, Hacks, Tutorials, Ebooks</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://lifelinux.com/how-to-optimize-nginx-for-maximum-performance/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
