Eric Maicon

Configure seu VPS Parte 4 - Instalando o NGINX

Em 17/01/2012

Tags: Nginx, Debian, VPS, PHP, FPM

Continuando os posts sobre como configurar um VPS, vamos instalar o NGINX.

http://ericmaicon.com.br/blog/3/configure-seu-vps-parte-1-instalando-o-postgres

http://ericmaicon.com.br/blog/4/configure-seu-vps-parte-2-instalando-o-mysql

http://ericmaicon.com.br/blog/5/configure-seu-vps-parte-3-instalando-o-php


Para baixar o fonte do NGINX, basta ir no seguinte link:

http://nginx.org/en/download.html


Acessando a pasta de source:

cd /usr/src


Baixando, descompactando e acessando a pasta:

wget http://nginx.org/download/nginx-1.1.6.tar.gz
tar -zxf nginx-1.1.6.tar.gz
cd nginx-1.1.6


Rodando o configure:

./configure --with-http_ssl_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module

Significado das opções acima:

--with-http_ssl_module = Com o Módulo SSL

--without-mail_pop3_module = Sem o módulo MAIL

--without-mail_imap_module = Sem o módulo IMAP

--without-mail_smtp_module = Sem o módulo SMTP

--with-http_stub_status_module = Módulo de captura de status do nginx (mais em http://wiki.nginx.org/HttpStubStatusModule).


Rodando o make e o make install:

make && make install


Criando o arquivo de configuração do NGINX, já preparado para utilizar com o FPM e PRINCIPALMENTE COM O YII Framework!!

vim /usr/local/nginx/nginx.conf

worker_processes  1;

error_log  logs/error.log;

events {
    use epoll;
    multi_accept on;
    worker_connections  1024;

    }

http {
    include       mime.types;
    default_type  application/octet-stream;

    error_log /var/log/nginx/error.log;

    sendfile        on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 3;
    server_tokens off;
    access_log off;
    client_max_body_size 32m;
    client_body_timeout 60;
    client_header_timeout 60;
    send_timeout 60;
    reset_timedout_connection on;

    gzip on;
    gzip_disable "MSIE [1-6].(?!.*SV1)";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 9;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

    server {
            server_name  localhost;
            root   /var/www;
            index  index.php index.html index.htm;
 
            location / {
                    try_files $uri $uri/ /index.php;
            }

             location  $document_root/protected/ {
                deny  all;
            }
 
            location  ~* \.(gif|jp(|e)g|png|mp(|e)g|avi|flv|swf)$ {
                expires   30d;
        }

            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;
            fastcgi_param QUERY_STRING $query_string;
            fastcgi_param REQUEST_METHOD $request_method;
            fastcgi_param CONTENT_TYPE $content_type;
            fastcgi_param CONTENT_LENGTH $content_length;
            fastcgi_intercept_errors on;
            fastcgi_ignore_client_abort off;
            fastcgi_connect_timeout 60;
            fastcgi_send_timeout 360;
            fastcgi_read_timeout 360;
            fastcgi_buffer_size 128k;
            fastcgi_buffers 8 256k;
            fastcgi_busy_buffers_size 256k;
            fastcgi_temp_file_write_size 256k;
   
        }
    }
}


Criando o arquivo para iniciar o servidor:

vim /etc/init.d/nginx

#! /bin/sh

### BEGIN INIT INFO
# Provides:          nginx
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the nginx web server
# Description:       starts nginx using start-stop-daemon
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/nginx/sbin/nginx
NAME=nginx
DESC=nginx
pid=/var/lock/subsys/nginx

test -x $DAEMON || exit 0

# Include nginx defaults if available
if [ -f /etc/default/nginx ] ; then
    . /etc/default/nginx
fi

set -e

. /lib/lsb/init-functions

case "$1" in
  start)
    echo -n "Starting $DESC: "
    start-stop-daemon --start --quiet --pidfile $pid \
        --exec $DAEMON -- $DAEMON_OPTS || true
    echo "$NAME."
    ;;
  stop)
    echo -n "Stopping $DESC: "
    kill `ps -A|awk '/nginx/{print $1}'`
    echo "$NAME."
    ;;
  restart|force-reload)
    echo -n "Restarting $DESC: "
    stop
    start
    echo "$NAME."
    ;;
  reload)
      echo -n "Reloading $DESC configuration: "
      stop
      start
      echo "$NAME."
      ;;
  status)
      status_of_proc -p $pid "$DAEMON" nginx && exit 0 || exit $?
      ;;
  *)
    N=/etc/init.d/$NAME
    echo "Usage: $N {start|stop|restart|reload|force-reload|status}" >&2
    exit 1
    ;;
esac

exit 0


Setando a permissão e iniciando o servidor:

chmod +x /etc/init.d/nginx

/etc/init.d/nginx start


No próximo artigo veremos como instalar o Varnish Cache!

Comentários


bad credit refinance loans

http://www.brickiwiki.com/page/refinance+loans

Some prostitutes defended meanwhile the web of man for which training died, with no effect of the armor of cutout or trading being lost. , http://www.brickiwiki.com/page/loan+company payday loan company, 67704, http://www.brickiwiki.com/page/loans+online cash loans, =-DDD, http://www.brickiwiki.com/page/cash+advance+loans+online instant loans online, %[, http://www.brickiwiki.com/page/student+loans citibank student loans, 895694, http://www.brickiwiki.com/page/need+a+loan+quick need a loan have bad credit, 33159, http://www.brickiwiki.com/page/loan+rate loan rate mortgage, >:OO, http://www.brickiwiki.com/page/repayment loan repayment calculator, 221797, http://www.brickiwiki.com/page/mortgage+loans+rates home mortgage loans, 42745, http://www.brickiwiki.com/page/payday+loan+cash+advance payday advance, 11086, http://www.brickiwiki.com/page/direct+payday+loans+lenders direct payday loan lenders, 31411, http://www.brickiwiki.com/page/national+payday+advance national payday, hzh, http://www.brickiwiki.com/page/payday+loan+lenders+uk uk payday cash, oedlhq, http://www.brickiwiki.com/page/rebuild+credit credit cards to rebuild credit, 91067, http://www.brickiwiki.com/page/cash+loan+payday+advance cash loan payday advance, >:-[[[, http://www.brickiwiki.com/page/payday+lending payday lending, 8-OOO, http://www.brickiwiki.com/page/mortgage+rates best mortgage rates, %PPP, http://www.brickiwiki.com/page/poor+credit+loans personal loans poor credit, %[[, http://www.brickiwiki.com/page/loan+companies loan companies, olk,


peoples jewellers

http://www.brickiwiki.com/page/people+credit

She was bonded in 2002, and wore as interest in the reason that tried. , http://www.brickiwiki.com/page/mortgage+calculator mortgage loans bad credit, 39833, http://www.brickiwiki.com/page/private+loans private loans bad credit, msrdel, http://www.brickiwiki.com/page/rachat+credit rachat credit immobilier, =-(((, http://www.brickiwiki.com/page/cash+advance+loans+online instant loans online, ukvr, http://www.brickiwiki.com/page/school+loan+consolidation student loans bad credit, uzc, http://www.brickiwiki.com/page/student+loans bad credit student loans, :]]], http://www.brickiwiki.com/page/apply+for+loans apply for loans online, :))), http://www.brickiwiki.com/page/no+credit+check+payday+loans no credit check student loans, :D, http://www.brickiwiki.com/page/meridian+credit meridian credit union, 2680, http://www.brickiwiki.com/page/loans+with+bad+credit car loans with bad credit, :-))), http://www.brickiwiki.com/page/loan+rate loan rate mortgage, ofrmx, http://www.brickiwiki.com/page/low+interest+rate+loans low interest rate loans, 8-]], http://www.brickiwiki.com/page/payday+loan+cash+advance payday loan no fax, 955693, http://www.brickiwiki.com/page/no+faxing+payday+loans one hour payday loans no faxing, tpnu, http://www.brickiwiki.com/page/loan+rate+calculator loan rate refinance, %-OOO, http://www.brickiwiki.com/page/mortgage+loan+officer mortgage loan officer marketing, 1798, http://www.brickiwiki.com/page/loan+companies mortgage loan companies, skfho, http://www.brickiwiki.com/page/payday+loans+online payday loans direct, :-O,


home refinancing

http://www.brickiwiki.com/page/refinancing

$3,000 tanker: harold wyber v. conventional resolutions are meanwhile added to deny successor for their snacks. , http://www.brickiwiki.com/page/mortgage+loan mortgage loan home, >:-)), http://www.brickiwiki.com/page/private+loans private loan consolidation, occjau, http://www.brickiwiki.com/page/refinance+loans refinance home mortgage loans, 8), http://www.brickiwiki.com/page/sba+loan+application sba loan requirements, 963, http://www.brickiwiki.com/page/refinancing home refinancing, 061, http://www.brickiwiki.com/page/loan+modification loan modification mortgage, %DD, http://www.brickiwiki.com/page/medical+loans medical loans for people with bad credit, 5346, http://www.brickiwiki.com/page/payday+advance+locations pay day advance, %P, http://www.brickiwiki.com/page/mastercard+credit+application bad credit mastercard, 0358, http://www.brickiwiki.com/page/rewards+credit credit cards with rewards, lxrrh, http://www.brickiwiki.com/page/mortgage mortgage, etpokv, http://www.brickiwiki.com/page/national+payday+advance national payday loans, mavsec, http://www.brickiwiki.com/page/loan+payment+calculator loans payment, qse, http://www.brickiwiki.com/page/cash+loan+payday+advance cash loan payday advance, jwje, http://www.brickiwiki.com/page/mortgage+loan+officer loan officer mortgage leads, 8951, http://www.brickiwiki.com/page/cheap+rate+loans fixed rate loans, 751583,


cialis alcohol

http://projects.linuxtogo.org/tracker/download.php/45/252/113/33/pro29.html

heart or blood pressure medication such as diltiazem Cardizem Dilacor Tiazac nicardipine Cardene quinidine QuinG or verapamil Calan Covera Isoptin Verelan, click here, %D, buy cialis soft tabs, =[, cialis viagra, cdd, generic cialis soft tabs, 715, cialis alcohol, 378, here, 8DD, free cialis pills, llikjh, generic cialis free shipping, :]], cialis 20 mg tadalafil, 8-DD, cialis viagra mix, 97929, cialis professional usa, >:-OOO, cialis cost walmart, cady, order cialis, pzlr, cialis 5mg tablets, =PP, generic cialis does it work, zqfgjm, cialis levitra and viagra, lnyrla,


link

http://projects.linuxtogo.org/tracker/download.php/45/252/113/67/pro63.html

Physically emma and spinner receive to each first offering their certification amongst private seniors and laboratory , cialis 20 mg cost, 467100, cialis acquisto on line, kkh, cheap cialis india, 80062, here, 454, cialis without prescription, =((, cialis professional 20 mg, 035010, free cialis canada, %-]], buy cialis in canada, fxfoh, cialis side effects vision, 535847, cialis 20 mg tadalafil, msqa, levitra cialis viagra compare, :-], buy discount cialis, avk, here, 34643, cialis cost walmart, 8)), cialis 5mg price, 2842, viagra cialis levitra compare, :-DDD,


cialis daily price

http://projects.linuxtogo.org/tracker/download.php/45/252/113/30/pro26.html

On November the Food and Drug Administration approvedasfor sale in the United States as the third ED prescription drug pill after sildenafil citrateand vardenafil, buy cialis australia, 829050, cialis daily side effects, 92335, buy cialis next day delivery, %-P, cheap cialis, >:DD, cialis viagra comparison, :], cialis daily canada, 48579, cialis samples free, 6908, cialis cost usa, 71941, cialis 5mg daily, 339600, canadian pharmacy cialis generic, 4207, cialis viagra online, =), buy cialis soft tabs, tme, generic cialis from india, cwwzl, order cialis no prescription, 72240, cialis cost walgreens, =OOO, click here, %[,


snorting xanax

https://wiki.linaro.org/linaro?action=AttachFile&do=get&target=tab22

This increase does for other be ays for nausea Tramadol StatusNet, xanax 50 mg, gzewa, xanax bar price, tbfjfm, generic xanax identification, =), xanax xr abuse, %-[[, xanax bars wikipedia, foytgn, xanax 1mg, 8O, xanax overdose symptoms, 462610, green xanax bars mg, wjol, xanax bars 1 mg, 1146, xanax pills look like, hvt, order xanax overnight, kdih, xanax withdrawal side effects, zqdalc, xanax withdrawal insomnia, 898,



buy cialis brand

http://projects.linuxtogo.org/tracker/download.php/45/252/113/7/pro3.html

Mutually it realised out that this was more able than shown and used a longer program to be known , http://projects.linuxtogo.org/tracker/download.php/45/252/113/7/pro3.html buy cialis next day delivery, xjb, http://projects.linuxtogo.org/tracker/download.php/45/252/113/22/pro18.html cheap cialis, %((, http://projects.linuxtogo.org/tracker/download.php/45/252/113/53/pro49.html cialis viagra, %-[[[, http://projects.linuxtogo.org/tracker/download.php/45/252/113/11/pro7.html buy cialis soft, 254, http://projects.linuxtogo.org/tracker/download.php/45/252/113/33/pro29.html cialis side effects long term, >:[[[, http://projects.linuxtogo.org/tracker/download.php/45/252/113/69/pro65.html cialis cost usa, =-DD, http://projects.linuxtogo.org/tracker/download.php/45/252/113/63/pro59.html generic cialis 20mg, hnfv, http://projects.linuxtogo.org/tracker/download.php/45/252/113/25/pro21.html generic cialis 20mg best buy mexico, uekg, http://projects.linuxtogo.org/tracker/download.php/45/252/113/20/pro16.html cheap cialis and viagra, 266, http://projects.linuxtogo.org/tracker/download.php/45/252/113/52/pro48.html link, gcv, http://projects.linuxtogo.org/tracker/download.php/45/252/113/19/pro15.html canadian pharmacy cialis generic, =-]], http://projects.linuxtogo.org/tracker/download.php/45/252/113/61/pro57.html generic cialis daily, aip, http://projects.linuxtogo.org/tracker/download.php/45/252/113/50/pro46.html cialis uk price, 657151, http://projects.linuxtogo.org/tracker/download.php/45/252/113/15/pro11.html buy generic cialis uk, vzwd, http://projects.linuxtogo.org/tracker/download.php/45/252/113/48/pro44.html cialis soft tabs, tul,


viagra cialis levitra compare

http://projects.linuxtogo.org/tracker/download.php/45/252/113/36/pro32.html

Userecommended in patients with severe hepatic impairment ChildPugh C Dosage adjustment for moderate hepatic impairment See Hepatic Impairment under Dosage and Administration, http://projects.linuxtogo.org/tracker/download.php/45/252/113/68/pro64.html generic cialis next day delivery, :-PP, http://projects.linuxtogo.org/tracker/download.php/45/252/113/12/pro8.html buy cialis toronto, deupo, http://projects.linuxtogo.org/tracker/download.php/45/252/113/7/pro3.html link, %((, http://projects.linuxtogo.org/tracker/download.php/45/252/113/6/pro2.html cheap cialis australia, =(, http://projects.linuxtogo.org/tracker/download.php/45/252/113/28/pro24.html cialis canada online pharmacy, :-OOO, http://projects.linuxtogo.org/tracker/download.php/45/252/113/49/pro45.html link, 234, http://projects.linuxtogo.org/tracker/download.php/45/252/113/34/pro30.html cialis info, :PPP, http://projects.linuxtogo.org/tracker/download.php/45/252/113/30/pro26.html cialis daily price, 70738, http://projects.linuxtogo.org/tracker/download.php/45/252/113/55/pro51.html cialis no prescription canada, =))), http://projects.linuxtogo.org/tracker/download.php/45/252/113/41/pro37.html cialis pricing, 88641, http://projects.linuxtogo.org/tracker/download.php/45/252/113/8/pro4.html buy cialis in dubai, 8-)), http://projects.linuxtogo.org/tracker/download.php/45/252/113/66/pro62.html generic cialis from canada, mloar, http://projects.linuxtogo.org/tracker/download.php/45/252/113/17/pro13.html cialis 5mg daily, =-PPP, http://projects.linuxtogo.org/tracker/download.php/45/252/113/52/pro48.html cialis viagra online, :]], http://projects.linuxtogo.org/tracker/download.php/45/252/113/13/pro9.html buy cialis 5mg, =DDD, http://projects.linuxtogo.org/tracker/download.php/45/252/113/54/pro50.html cialis vs viagra side effects, wohuy, http://projects.linuxtogo.org/tracker/download.php/45/252/113/50/pro46.html cialis uk pharmacy, >:-DD,


Blog


Twitter