Jump to content
sleed

Tutorial optimizare apache + server [Varianta Debian/Ubuntu]

Recommended Posts

Posted

Buna seara tuturor.Am sa va arat cum sa instalati modulul mod_spdy care e folosit pentru requesturi , adica transmisiunea server-client sa se realizeze mai repede

Bun.Gata cu vorba, sa trecem la : TREABA ; Ce avem nevoie ? :

1.PHP,APACHE,Mysql sa avem instalat : Open consola :

apt-get install mysql-server mysql-client

Adaugi parola pentru ROOT

2.

apt-get install apache2
Sa instalezi apache.

3.Bun. Tastezi in web-browser , 127.0.0.1 , si iti arata ca merge. Ca sa adaugi continut , te duci in /var/www , si ca sa configurezi apache , /etc/apache2/apache2.conf [cu editor nano sau pico]

4.Acum uite te ce varianta ai : 32 biti & 64 prin urmatoarea comanda : uname -a , sa vezi daca ai i686 = 32 biti , x86_64 = 64 biti.

Pentru 32 biti deschizi consola si downloadezi mod spdy :

Pentru 64 :

Tastezi urmatoarea comanda :

dpkg -i mod-spdy-*.deb

->Asta este sa instalezi mod spdy.

Tot in consola scrii :

apt-get -f install
ca sa te asiguri ca totul e instalat corect.

Apoi restart apache , service apache2 restart

Fast CGI este un modul ce conlucreaza cu PHP , asa ca inainte sa linstalezi, adauga asta in sursa ta /etc/apt/sources.list :

deb http://ftp.us.debian.org/debian wheezy main non-free

deb Debian -- Security Information wheezy/updates main non-free

Apoi tastezi : apt-get update

Instalezi modulul fastcgi cu urmatoarea comanda :

apt-get install apache2-mpm-worker libapache2-mod-fastcgi php5-fpm php-apc

Daca nu iti merge , in loc de apt-get , dai aptitude install...

Apoi activezi modulele :

a2enmod actions alias fastcgi rewrite

Deschizi

nano /etc/apache2/apache2.conf
, adaugi tot acest continut la sfarsit de tot:

<IfModule mod_fastcgi.c>

FastCgiExternalServer /var/www/php5.external -socket /var/run/php5-fpm.sock

AddHandler php5-fcgi .php

Action php5-fcgi /usr/lib/cgi-bin/php5.external

Alias /usr/lib/cgi-bin/ /var/www/

</IfModule>

Dai disable la mod php : a2dismod php5

Si restart apache2 : /etc/init.d/apache2 restart sau service apache2 restart

Sper sa va fie de folos!

Sursa :

, testata de mine , working perfect , se incarca cu cep putin 2,500 secunde ;)

Despre cum functioneaza modulul spdy :

with-mod-spdy2.png

TImpul de raspuns Apache vs NGINX

TGZJ8_IWGWsn-0M6Txi9rrt7m5shn_Y5wwi475r8ewMatyVQyULg43lQvAvSN1V24P_9Eu_aezpyRMuWRbmf_XPXtjkN6QrsB9zbM7eLs4ESzrtR6_3ft-LgjA

Va multumesc :)

Posted (edited)

Ai uitat ceva:

1. Am vazut ca folosesti FastCgi dar ai instalat si php-fpm. De ce nu-l folosesti?

2. Ai uitat ceva "Normally SPDY is only ever used for SSL connections (https URLs)."

3. By default, Spdy este disabled. Trebuie sa adaugi SpdyEnabled on. Cum ai avut tu castig in timpul de raspuns ?

3. Timpul de raspuns intre nginx si apache nu are nicio treaba aici.

Mod spdy config options: https://code.google.com/p/mod-spdy/wiki/ConfigOptions

Edited by aelius
Posted (edited)

personal va recomand nginx daca nu aveti multe domenii hostate (bataie de cap cu rewriteul) si fata de lightspeed e MOCA (LS moca = no cache)

LE: si daca vreti si un cpanel destul de simplu si u-friendly va recomand: froxlor

Edited by gogusan

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...