Ngethuba elidlulileyo Ndikuxelele malunga noluhlu lwezifundo, kwindlela yokufaka kunye nokuqwalasela iserver kwimfuno ephezulu yokubamba. Eli nqaku liza kuba malunga nokufaka kunye nokuqwalasela Nginx + PHP nge I-SpawnFastCGI:
I-Spawn_FastCGI:
Oku kunokuthiwa yinto edibanisa i-Nginx ne-PHP, oko kukuthi, nokuba ngaba bane-PHP5 package efakiweyo ukuba abanayo i-Spawn_FastCGI efakiweyo kwaye yenziwe xa bevula indawo kwi-PHP isikhangeli siyakukhuphela ifayile, ayizukubonisa kubo nantoni na eyenziweyo .php icwangcisiwe kuba umncedisi akayazi indlela yokwenza iifayile ze-.php, yiyo loo nto kubalulekile ukufaka kunye nokumisela i-Spawn_FastCGI.
Ukuba sisebenzise i-Apache iya kuba yinto elula njengokufaka iphakheji ye-libapache2-mod-php5 kodwa kuba sisebenzisa i-Nginx kuya kufuneka sifake iphakheji ye-spawn-fcgi endaweni yoko. Kwakhona, kwisifundo ndiza kuchaza ukuba usenza njani iscript esitsha kwi /etc/init.d/ ukuze ukwazi ukusilawula kakuhle.
1.Ufakelo:
Siza kuqala ngento yokuqala, faka i-Spawn-FastCGI kunye ne-PHP kwiindawo zethu zokugcina.
Ukuba kwiseva yakho usebenzisa unikezelo olufana neDebian, Ubuntu okanye ezinye ezivela kwisiphelo sendlela kufuneka ubeke oku kulandelayo kwaye ucinezele faka :
aptitude install spawn-fcgi php5-cgi php5-curl
2. Uqwalaselo:
Kwinyathelo langaphambili (xa sifaka i-Nginx) sikhuphele ifayile ebizwa ngokuba yi-nginx-spawn-fastcgi.tar.gz ethi xa uyikhuphile yenze ifolda nginx-spawn-fastcgi ekhayeni lethu, siya kuyikopa kwifayile spawn-fastcgi ukuya /etc/init.d/:
cp ~/nginx-spawn-fastcgi/spawn-fastcgi /etc/init.d/
Kwakhona, sidinga i-php-fastcgi ephunyeziweyo kwi / usr / bin /
cp ~/nginx-spawn-fastcgi/php-fastcgi /usr/bin/
Ukugqibelela, sinefayile esele ilungile eya kusivumela ukuba silawule i-spawn-fastcgi kunye ne-php-fastcgi ephumelelayo, ngoku siza kuqala i-spawn-fastcgi:
/etc/init.d/spawn-fastcgi start
Izakusibonisa into efana nale: i-spawn-fcgi: umntwana uzalwe ngempumelelo: I-PID: 3739
Ngoku siza kuthatha indawo yethu /etc/nginx/sites-available/mywebsite.net file nge ~ / nginx-spawn-fastcgi / mywebsite_plus_php.net
cp ~/nginx-spawn-fastcgi/mywebsite_plus_php.net /etc/nginx/sites-available/mywebsite.net
Ngoba? Ilula, kuba ifayile yethu yangaphambili ye-mywebsite.net ayinayo inkxaso ye-PHP, oko kukuthi, yi-Nginx kuphela, ngelixa ifayile ye-mywebsite_plus_php.net inayo inkxaso ye-PHP, oko kukuthi, i-Nginx + PHP isebenzisa iSpawnFastCGI.
Umahluko phakathi kwezi fayile uliqela, umzekelo:
- Kumgca 3 ifayile exhasa i-PHP yongezwa index.php
- Umgca omtsha phantsi kweNombolo 3 oqukethe: fastcgi_index index.php;
- Imigca emininzi eyahlukeneyo exelela i-Nginx indlela yokwenza i-PHP.
- โฆ .. Ngamafutshane, nantsi ifoto eya kukunceda wazi umahluko phakathi kwezi fayile zimbini:
Ifayile ye-mywebsite_plus_php.net iyi-vhost esebenza njengomzekelo, oko kukuthi, ngamanye amagama, kufuneka siyiguqule kwaye simisele ubumbeko lwethu.
Kufuneka sitshintshe oku kulandelayo:
- ukufikelela_log (umgca 3): Le iya kuba yindlela yefayile yokungena kule ndawo
- Impazamo_log (umgca 4): Le iya kuba yindlela yefayile yelog yempazamo kule ndawo
- server_name (umgca 5): I-URL, ithambeka ebanjwe kulo lawulo, umzekelo, ukuba ibiyi-DesdeLinux iforum ibiya kuba: iforum_yegama leseva.desdelinux.net
- ingcambu (umgca 6): Indlela eya kwifolda apho zikhona iifayile ze-html, masiyiyeke le / var / www / njengoko izakuba luvavanyo kuphela
Silungile, ngoku siza kuqala kwakhona i-Nginx:
/etc/init.d/nginx restart
Ukuqinisekisa ukuba iinkqubo zethu zeNginx ze-PHP ngokufanelekileyo, masikope ifayile phptest.php kwifolda ebanjelweyo, oko kukuthi, leyo iboniswe kumgca we-6 we-mywebsite_plus_php.net ifayile (umzekelo, ingcambu / var / www /), Ukucinga ukuba indawo ibanjwe ngqo kwi / var / www / iya kuba:
cp ~/nginx-spawn-fastcgi/phptest.php /var/www/
Ukucinga ukuba kumgca we-5 we-mywebsite_plus_php.net (Oko kukuthi, umgca wegama lomncedisi) sithe indawo yethu yile www.mysite.net emva koko kufuneka singene ku-www.mysite.net/phptest.php. Ngamanye amagama, umbono kukufikelela kwifayile phptest.php kwisikhangeli sethu kwaye ukuba oku kulandelayo kuyavela emva koko i-Nginx yethu idityaniswe ngokugqibeleleyo ne-PHP:
Kwimeko apho oku kungabonakali, oko kukuthi, ukuba isikhangeli sizame ukukhuphela ifayile ye-.php ... oku kuthetha ukuba benze into engalunganga, abayithathi indawo /etc/nginx/sites-available/mywebsite.net nge ~ / nginx-spawn-fastcgi / mywebsite_plus_php.netโฆ ukuba balibale ukuqala kwakhona i-Nginx nge /etc/init.d/nginx ukuqala kwakhona okanye ukuba balibale ukuqala iSpawn-FastCGI nge /etc/init.d/spawn-fastcgi
Ukuza kuthi ga ngoku isifundo sokudibanisa i-Nginx kunye ne-PHP usebenzisa iSpawnFastCGI, sifuna i-MySQL kunye ne-APC kuphela.
Ndiyathemba ukuba uyakufumana oku kunomdla.
Ukuba yikota, kutheni umfanekiso usithi 3? uqale ngo 0 Ndiyaqikelela? Iposti ebalaseleyo.
Phendula nge quote
1: Ukunikezelwa
Okwesibini: Nginx
Okwesithathu: Nginx + PHP (Spawn_FastCGI)
๐
Enkosi ngokufunda ^ _ ^
kwenzeke ntoni nge part 4 ???
kunye nolandelayo ?????
Sawubona,
Iya kuba lukhetho olungcono ukuba endaweni ye-mysql, usebenzise uMariaDB, njengoko kufanele uyazi, le yokugqibela yimfoloko yeyokuqala, kwaye sele kukho intetho yokuba iya kuba yiMysql yexesha elizayo (http://www.genbetadev.com/bases-de-datos/mariadb-sera-el-mysql-del-futuronjengoko iMysql isimahla, ukuya kuthi ga kwinqanaba.
I-SkySQL, inkampani ebonelela ngeenkonzo ezisuka kulwazi lwasimahla, ezixhasa ngemali iprojekthi kaMariaDB (http://www.genbetadev.com/bases-de-datos/mariadb-y-skysql-unen-fuerzas-para-llevar-a-mariadb-a-lo-mas-alto) kunye noGoogle ofuna ukuyeka ngokuxhomekeke kwi-Mysql, njengoko i-Wikipedia nayo yenzayo, kwaye iyakwenza utshintsho ukusuka kwi-MySQL 5.1 ukuya kwi-MariaDB 10.0 ngoncedo, ngokuchanekileyo, nge-SkySQL, esele ziingcali kweli candelo.
molo2.
Sawubona,
Ewe kunjalo, ndiyamazi uMariaDB kwaye enyanisweni, sele sithethile ngayo: https://blog.desdelinux.net/tag/mariadb/
Nangona kunjalo, ngoku ndisebenzisa i-MySQL kuba ndenza ezi tutorials ukusuka kumava athile endinawo xa ndifuduka ndisuka kwiLinux (nazo zonke iinkonzo zayo) ukuya kwezinye iiseva, ngelo xesha sitshintshe itekhnoloji ngokupheleleyo kunye nemisebenzi okanye utshintsho ebendinalo ubuso babungembalwa.
Funda olu luvo lwam ukusukela ngala mzuzu: https://blog.desdelinux.net/el-blog-desdelinux-abandona-hostgator-y-pasa-a-gnutransfer/comment-page-1/#comment-81291
Umbono wokugqibela ngu-ewe ngokwenene, fudukela eMariaDB, kodwa andinaxesha lokwenza iimvavanyo ezifanelekileyo relevant
Enkosi ngokufunda
Olu qeqesho luya kundinceda ukuba ndifake i-zPanel X nge-NGINX ukuze ndingagcwalisi indawo yam xa ufudukela kwi-GNUPanel VPS.
Isipho seKrisimesi? Ndijonge phambili ukuvuyisana nabo bonke.
Enkosi iqabane
Yongezwe kwiintandokazi!
Ngendlela, ndinala kuthandabuza kunye nombuzo, ngaba ngenene i-Nginx inentsebenzo engaphezulu kune-Apache?
Nibuliso!
Ewe, i-Apache inokulungiswa kakhulu kodwaโฆ kude kube ngoku, uGoogle yena kwaye phantse sonke siyavuma ukuba i-Nginx isebenzisa i-RAM encinci, ayisebenzi ngokungathethekiyo, nangona ingekho lula kangako xa iqwalaselwa.
KZKG elungileyo ^ IGaara ulwazi olugqwesileyo kwabo kuthi banomdla kweli hlabathi, umbuzo, wokuba nini iposti ye-4