<?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>Кибер-Фанк v2.0 &#187; nginx</title>
	<atom:link href="http://www.shatlovsky.ru/category/nginx/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shatlovsky.ru</link>
	<description>Information must be free</description>
	<lastBuildDate>Thu, 29 Apr 2010 16:23:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Создание /etc/init.d/nginx на debian 5.0 lenny</title>
		<link>http://www.shatlovsky.ru/2009/06/05/sozdanie-etcinitdnginx-na-debian-50-lenny/</link>
		<comments>http://www.shatlovsky.ru/2009/06/05/sozdanie-etcinitdnginx-na-debian-50-lenny/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 07:05:14 +0000</pubDate>
		<dc:creator>Alex Shatlovsky</dc:creator>
				<category><![CDATA[config]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[заметки на полях]]></category>

		<guid isPermaLink="false">http://www.shatlovsky.ru/2009/06/05/sozdanie-etcinitdnginx-na-debian-50-lenny/</guid>
		<description><![CDATA[$ sudo vim /etc/init.d/nginx Вставляем нижеследующий код (помним про команду ‘set :paste’ для вставки в VIM): #!/bin/sh ### BEGIN INIT INFO # Provides: nginx # Required-Start: $remote_fs $syslog $named $network $time # Required-Stop: $remote_fs $syslog $named $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start nginx at boot time [...]]]></description>
			<content:encoded><![CDATA[<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> vim /etc/init.d/nginx</pre>
<p>Вставляем нижеследующий код (помним про команду ‘set :paste’ для вставки в VIM):</p>
<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/sh</span>
<span style="color: #808080; font-style: italic;">### BEGIN INIT INFO</span>
<span style="color: #808080; font-style: italic;"># Provides:          nginx</span>
<span style="color: #808080; font-style: italic;"># Required-Start:    <span style="color: #007800;">$remote_fs</span> <span style="color: #007800;">$syslog</span> <span style="color: #007800;">$named</span> <span style="color: #007800;">$network</span> <span style="color: #007800;">$time</span></span>
<span style="color: #808080; font-style: italic;"># Required-Stop:     <span style="color: #007800;">$remote_fs</span> <span style="color: #007800;">$syslog</span> <span style="color: #007800;">$named</span> <span style="color: #007800;">$network</span></span>
<span style="color: #808080; font-style: italic;"># Default-Start:     <span style="color: #000000;">2</span> <span style="color: #000000;">3</span> <span style="color: #000000;">4</span> <span style="color: #000000;">5</span></span>
<span style="color: #808080; font-style: italic;"># Default-Stop:      <span style="color: #000000;">0</span> <span style="color: #000000;">1</span> <span style="color: #000000;">6</span></span>
<span style="color: #808080; font-style: italic;"># Short-Description: Start nginx at boot time</span>
<span style="color: #808080; font-style: italic;"># Description:       Enable service provided by nginx.</span>
<span style="color: #808080; font-style: italic;">### END INIT INFO</span>
<span style="color: #808080; font-style: italic;"># <span style="color: #007800;">$Id</span>$</span>
&nbsp;
<span style="color: #007800;">NGINXHOME=</span>/usr/<span style="color: #7a0874; font-weight: bold;">local</span>/nginx
<span style="color: #007800;">NGINXPID=</span><span style="color: #007800;">$NGINXHOME</span>/logs/nginx.pid
&nbsp;
<span style="color: #007800;">PATH=</span>/usr/<span style="color: #7a0874; font-weight: bold;">local</span>/sbin:/usr/<span style="color: #7a0874; font-weight: bold;">local</span>/bin:/sbin:/bin:/usr/sbin:/usr/bin
<span style="color: #007800;">DAEMON=</span><span style="color: #007800;">$NGINXHOME</span>/sbin/nginx
<span style="color: #007800;">NAME=</span>nginx
<span style="color: #007800;">DESC=</span>nginx
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> ! -x <span style="color: #007800;">$DAEMON</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
   <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Couldn't find $DAEMON. Please set path to DAEMON.&quot;</span>
   <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Include nginx defaults <span style="color: #000000; font-weight: bold;">if</span> available</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -f /etc/default/nginx <span style="color: #7a0874; font-weight: bold;">&#93;</span> ; <span style="color: #000000; font-weight: bold;">then</span>
	. /etc/default/nginx
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">set</span> -e
&nbsp;
<span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
  start<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot;Starting $DESC: &quot;</span>
	start-stop-daemon --start --pidfile <span style="color: #007800;">$NGINXPID</span> \
		--<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #007800;">$DAEMON</span> -- <span style="color: #007800;">$DAEMON_OPTS</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
	;;
  stop<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot;Stopping $DESC: &quot;</span>
	start-stop-daemon --stop --pidfile <span style="color: #007800;">$NGINXPID</span> \
		--<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #007800;">$DAEMON</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
	;;
  restart|force-reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot;Restarting $DESC: &quot;</span>
	start-stop-daemon --stop --pidfile \
		<span style="color: #007800;">$NGINXHOME</span>/run/<span style="color: #007800;">$NAME</span>.pid --<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #007800;">$DAEMON</span>
	<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">1</span>
	start-stop-daemon --start --pidfile \
		<span style="color: #007800;">$NGINXPID</span> --<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #007800;">$DAEMON</span> -- <span style="color: #007800;">$DAEMON_OPTS</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
	;;
  reload<span style="color: #7a0874; font-weight: bold;">&#41;</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">&quot;Reloading $DESC configuration: &quot;</span>
      start-stop-daemon --stop --signal HUP --pidfile <span style="color: #007800;">$NGINXPID</span> \
          --<span style="color: #7a0874; font-weight: bold;">exec</span> <span style="color: #007800;">$DAEMON</span>
      <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;$NAME.&quot;</span>
      ;;
  *<span style="color: #7a0874; font-weight: bold;">&#41;</span>
	<span style="color: #007800;">N=</span>/etc/init.d/<span style="color: #007800;">$NAME</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $N {start|stop|restart|force-reload}&quot;</span> &gt;&amp;<span style="color: #000000;">2</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
	;;
<span style="color: #000000; font-weight: bold;">esac</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre>
<p>Сохраняем скрипт и выходим из vim.</p>
<p>Делаем скрипт исполняемым:</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">755</span> /etc/init.d/nginx</pre>
<p>Указываем, что <em>nginx</em> нужно запускать при запуске и остановке сервера:</p>
<pre class="bash">$  <span style="color: #c20cb9; font-weight: bold;">sudo</span> /usr/sbin/update-rc.d -f nginx defaults</pre>
<p>UPD: Блок, заключенный между строками
<pre class="bash"><span style="color: #808080; font-style: italic;">### BEGIN INIT INFO</span>
<span style="color: #808080; font-style: italic;">### END INIT INFO</span></pre>
<p> обеспечивает LSB-совместимость. Подробнее см. <a href="http://wiki.debian.org/LSBInitScripts">http://wiki.debian.org/LSBInitScripts</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shatlovsky.ru/2009/06/05/sozdanie-etcinitdnginx-na-debian-50-lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Установка nginx на debian 5.0 lenny</title>
		<link>http://www.shatlovsky.ru/2009/06/04/ustanovka-nginx-na-debian-50-lenny/</link>
		<comments>http://www.shatlovsky.ru/2009/06/04/ustanovka-nginx-na-debian-50-lenny/#comments</comments>
		<pubDate>Thu, 04 Jun 2009 15:52:01 +0000</pubDate>
		<dc:creator>Alex Shatlovsky</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[заметки на полях]]></category>

		<guid isPermaLink="false">http://www.shatlovsky.ru/2009/06/04/ustanovka-nginx-na-debian-50-lenny/</guid>
		<description><![CDATA[На "пустом" свежеустановленном Debian не хватает ряда инструментов и библиотек для сборки и установки nginx. Ставим gcc, make, и компания: $ sudo apt-get install build-essential Библиотеки для сборки nginx: $ sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev Для поддержки встроенного Perl добавляем: $ sudo apt-get install libperl-dev Собственно процесс сборки и установки (вместо 0.7.XX [...]]]></description>
			<content:encoded><![CDATA[<p>На "пустом" свежеустановленном Debian не хватает ряда инструментов и библиотек для сборки и установки nginx.</p>
<p>Ставим gcc, make, и компания:</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential</pre>
<p>Библиотеки для сборки nginx:</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev</pre>
<p>Для поддержки встроенного Perl добавляем:</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> libperl-dev</pre>
<p>Собственно процесс сборки и установки (вместо 0.7.XX впишите номер актуальной версии):</p>
<pre class="bash">$ <span style="color: #c20cb9; font-weight: bold;">wget</span> http://sysoev.ru/nginx/nginx<span style="color: #000000;">-0.7</span>.XX.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz
$ <span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf nginx<span style="color: #000000;">-0.7</span>.XX.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz
$ <span style="color: #c20cb9; font-weight: bold;">ln</span> -s nginx<span style="color: #000000;">-0.7</span>.XX nginx
$ <span style="color: #7a0874; font-weight: bold;">cd</span> nginx
$ ./configure \
--<span style="color: #007800;">prefix=</span>/usr/<span style="color: #7a0874; font-weight: bold;">local</span>/nginx \
--with-cc-<span style="color: #007800;">opt=</span><span style="color: #ff0000;">&quot;-I /usr/include&quot;</span> \
--with-ld-<span style="color: #007800;">opt=</span><span style="color: #ff0000;">&quot;-L /usr/lib&quot;</span> \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_perl_module  \
--with-http_ssl_module
&nbsp;
$ <span style="color: #c20cb9; font-weight: bold;">make</span> &amp;&amp; <span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
&nbsp;</pre>
<p>Обратите внимание, параметры
<pre class="bash">--with-cc-<span style="color: #007800;">opt=</span><span style="color: #ff0000;">&quot;-I /usr/include&quot;</span> --with-ld-<span style="color: #007800;">opt=</span><span style="color: #ff0000;">&quot;-L /usr/lib&quot;</span></pre>
<p> указывают на расположение системных заголовков и библиотек, без них configure не видит ряда системных библиотек.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shatlovsky.ru/2009/06/04/ustanovka-nginx-na-debian-50-lenny/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
