<?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>Ubuntu Linux, ubuntu desktop, Linux operating system, ubuntu guide &#187; Ngnix</title>
	<atom:link href="http://ubuntulinux.co.in/blog/category/webserver/ngnix/feed/" rel="self" type="application/rss+xml" />
	<link>http://ubuntulinux.co.in/blog</link>
	<description>How to fix the Technical issue in Ubuntu linux</description>
	<lastBuildDate>Thu, 17 May 2012 13:12:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Ngnix webserver Installation stpe by step from source</title>
		<link>http://ubuntulinux.co.in/blog/webserver/ngnix-webserver-installation/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ngnix-webserver-installation</link>
		<comments>http://ubuntulinux.co.in/blog/webserver/ngnix-webserver-installation/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:08:22 +0000</pubDate>
		<dc:creator>sahab</dc:creator>
				<category><![CDATA[Ngnix]]></category>
		<category><![CDATA[Webserver]]></category>

		<guid isPermaLink="false">http://ubuntulinux.co.in/blog/?p=41</guid>
		<description><![CDATA[Nginx is a popular lightweight server for those who do not need the bulk and extra services that Apache may offer.]]></description>
			<content:encoded><![CDATA[<p><a href="http://ubuntulinux.co.in/blog/wp-content/uploads/2010/03/nginx.gif"><img class="alignleft size-full wp-image-43" title="nginx" src="http://ubuntulinux.co.in/blog/wp-content/uploads/2010/03/nginx.gif" alt="" width="121" height="32" /></a></p>
<p><a title="Nginx home page" href="http://nginx.net/">Nginx</a> is a popular lightweight server for those who do not need the bulk and extra services that Apache may offer.</p>
<p>This article will look at installing Nginx from source on a CentOS slice.</p>
<hr />
<h3>Versions</h3>
<p>At the time of writing, the latest stable version of Nginx is 0.7.65. You can check the latest versions and change logs at the <a title="Nginx Home Page" href="http://nginx.net/">main nginx site</a>.</p>
<p>Building from source will allow you to have the latest available versions of Nginx. However, keep in mind that security updates will not be applied automatically.</p>
<h3>Dependencies</h3>
<p>As we are not using the package manager to install nginx, we need to take care of some dependencies.</p>
<p>Not many are needed and include pcre-devel zlib-devel and openssl-devel packages.</p>
<pre><code>sudo yum install pcre-devel zlib-devel openssl-devel</code></pre>
<h3>Download</h3>
<p>Now we can download the source code.</p>
<p>Create a &#8216;sources&#8217; directory (you can download it anywhere you want to):</p>
<pre><code>mkdir /ngnix</code></pre>
<p>Now move into the folder:</p>
<pre><code>cd /ngnix</code></pre>
<p>And then download the source code:</p>
<pre><code>wget </code>http://nginx.org/download/nginx-0.7.65.tar.gz</pre>
<h3>Unpack</h3>
<p>Unpack the downloaded tar file and move into the newly created directory:</p>
<pre><code>tar -zxvf</code> nginx-0.7.65.tar.gz
<code>...
cd </code>nginx-0.7.65</pre>
<h3>Options</h3>
<p>There are quite a few compile time options that are available to use.</p>
<p>Have a look at the <a title="Nginx Install Options" href="http://wiki.nginx.org/NginxInstallOptions">Install Options</a> page of the Nginx wiki for full details.</p>
<p>We&#8217;re going to use just two options to customize the install. The first of which is:</p>
<pre><code>--sbin-path=/usr/local/sbin</code></pre>
<p>By default, nginx will be installed in /usr/local/nginx which, although a good place, does mean the main Nginx binary will be found in /usr/local/nginx/sbin/nginx.</p>
<p>Not a location we are likely to find in our default search paths. So instead of adding new directories to our path (which may cause errors later on) we simply define where to put the binary.</p>
<p>The second option is:</p>
<pre><code>--with-http_ssl_module</code></pre>
<p>Probably self explanatory, but this will enable the SSL module to be compiled so we can parse https requests.</p>
<h3>Compile</h3>
<p>Let&#8217;s go ahead and compile Nginx using those two options:</p>
<pre><code>./configure --sbin-path=/usr/local/sbin --with-http_ssl_module</code></pre>
<p>There will be a nice summary at the end of the compile which includes such items as:</p>
<pre><code>...
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/sbin"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
...</code></pre>
<p>Keep a note of the output as it does contain some useful paths and locations for various files.</p>
<h3>Make</h3>
<p>Ok, let&#8217;s go ahead and &#8216;make&#8217; and then &#8216;make install&#8217;:</p>
<pre><code>make
...
sudo make install

<strong>For more info</strong>
</code><strong><img title="More..." src="../wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></strong><span id="more-41"></span></pre>
<h3>Defaults</h3>
<p>Done. We can test the install by starting Nginx:</p>
<pre><code>sudo /usr/local/sbin/nginx</code></pre>
<p>and navigating to our Slice IP address (assuming you have no other server running):</p>
<pre><code>http://localhost</code></pre>
<p>You will be greeted with the standard welcome page:</p>
<p><img title="Nginx Welcome Screen" src="http://articles.slicehost.com/assets/2007/10/16/001_welcome_screen.png" alt="Nginx Welcome Screen" /></p>
<h3>Stop</h3>
<p>If you have used Apache or some other web server (or even installing Nginx via a package manager), you may be used to using a script to start and stop it such as you might find in &#8216;/etc/init.d/&#8217;.</p>
<p>Unfortunately, compiling from source does not create a script like that (we will create an init script in the next article or two).</p>
<p>You may have noticed that one of the paths noted in the compile summary was:</p>
<pre><code>nginx pid file: "/usr/local/nginx/logs/nginx.pid"</code></pre>
<p>Let&#8217;s make use of that to stop Nginx:</p>
<pre><code>sudo kill `cat /usr/local/nginx/logs/nginx.pid`</code></pre>
<p>That will use the output of the pid file to kill the Nginx process &#8211; note the use of backticks (`) and not single quotes (&#8216;) in the command.</p>
]]></content:encoded>
			<wfw:commentRss>http://ubuntulinux.co.in/blog/webserver/ngnix-webserver-installation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

