Txoj kev lom zem nrog Dab I: Tso Dab ntawm VPS nrog Nginx

Dab logo

Ob peb hnub dhau los kuv tau luam tawm ib qho kev nkag teb chaws txog yuav ua li cas rau nruab Ntsuj Plig Dawb Huv yooj yim nrog ib tsab ntawv sau, hnub no kuv sau qhov no los qhia yuav ua li cas rau nruab nws nrog Nginx thiab koj lub npe sau npe. Tsis muaj ado ntxiv, cia peb pib nrog kev qhia!

Yuav tsum tau pob


Rau nruab Ntsuj Plig Dawb Huv Hauv VPS peb yuav tsum txuas mus rau nws thiab teeb tsa cov kev vam khom, rau qhov no peb yuav tsum tau nruab rau hauv qab no:

# apt-get install build-essential automake make checkinstall dpatch patchutils autotools-dev debhelper quilt fakeroot xutils lintian cmake dh-make libtool autoconf git-core curl zip nginx

Qhov no yuav nruab qhov nruab nrog rau kev suav NodeJS (yuav tsum tau los ntawm Dab), yuav nruab Nginx thiab lwm yam cuab yeej.

Ntsuas NodeJS


Los tso ua ke NodeJS peb yuav tsum rub tawm cov peev txheej:

wget http://nodejs.org/dist/node-latest.tar.gz

Thaum no ua tiav, koj yuav tsum unzip lawv:

tar -xzf node-latest.tar.gz

Peb tsiv mus rau phau ntawv sau npe qhov chaw uas code nyob:

nodeversion=`ls | grep node`
cd $nodeversion

Peb sau thiab nruab:

./configure
make -s
make install

Npaj!

Nruab Nruab


Ua ntej teeb tsa, koj yuav tsum nruab nws, puas yog? Txawm hais tias muaj tseeb, tsis txhob ntshai, koj yuav tsis suav sau 🙂

Tsim qhov www directory thiab txav mus rau nws:

Ceeb toom: Ua ntej pib qhov kev qhia tag nrho, nco ntsoov tias koj yuav tsum tshem tawm cov server uas muaj chaw nres nkoj 80, 8080 thiab www, yog tias lub nplaub tshev tshwm sim, rho tawm nws.

mkdir -p /var/www
cd /var/www/

paug Dab:

curl -L -O https://ghost.org/zip/ghost-latest.zip

Unzip:

unzip -d ghost ghost-latest.zip
rm ghost.zip

Nkag mus rau hauv cov ntawv sau cia:

cd ghost/

Txav txhua yam rau / var / www /:

mv /var/www/ghost/* /var/www/

Rov qab mus rau / var / www /:

cd /var/www/

Nruab Ntsuj Plig Dawb Huv

/usr/local/bin/npm install --production

Zoo! Tam sim no los teeb tsa. 😀

Teeb

Peb hloov kho cov ntaub ntawv teeb tsa nrog cov lus txib nram qab no:

sed -e 's/127.0.0.1/0.0.0.0/' -e 's/my-ghost-blog.com/www.dominio.com/' -e 's/2368/8080/' config.js

Txoj cai yooj yim? Cia li hloov "domain.com" nrog koj tus sau, piv txwv li:

sed -e 's/127.0.0.1/0.0.0.0/' -e 's/my-ghost-blog.com/www.theworldofthegeek.com/' -e 's/2368/8080/' config.js

Peb tuaj yeem ua nrog nano (The GNU editor, kom tsis txhob ntxhov siab nrog Nano's Los ntawmLinux : V), tab sis nws yuav nyuaj thiab peb yuav tau hloov ntau (yog, ntau, raws li koj nyeem nws) code, tab sis txoj kev no piav qhia yooj yim dua :).

Tab sis nco ntsoov peb xav tau nws nyob hauv keeb kwm yav dhau! Rau qhov no peb nruab ib si:

/usr/local/bin/npm install -g forever

Peb qhia cov lus qhia nram qab no (kom pib Ntsuj Plig Dawb Huv Peb yuav tsum muaj nyob hauv cov ntawv teeb tsa ((var / www /)):

NODE_ENV=production forever start index.js

Ta dah! Hauv keeb kwm yav dhau!

Kom nres, pib dua lossis pib Ntsuj Plig Dawb Huv:

forever stop index.js
forever restart index.js
NODE_ENV=production forever start index.js

Npaj! 😀

Teem Nginx


Lub sij hawm teeb tsa Nginx!

Peb yuav hloov kho cov ntaub ntawv teeb tsa:

nano /etc/nginx/nginx.conf

Peb yuav rho tawm txhua yam thiab muab tshuaj txhuam cov qauv hauv qab no: http://paste.desdelinux.net/5034

Ib zaug nrog cov kev teeb tsa tshiab, hloov lo lus "sau" nrog koj sau npe ntawm kab 36, 38, 39 thiab 43.

Tam sim no rov pib dua Nginx

service nginx restart

Npaj! 😀

Kho lub ntsej muag


Nkag mus rau koj lub chaw pabcuam thiab kho cov ntaub ntawv A (Host). Hloov IP chaw nyob nws taw rau koj VPS, thiab voila!

Cov Lus Kawg


Txhawm rau nkag mus rau cov thawj tswj hwm mus rau www.dominio.com/ghost/ nco ntsoov hloov pauv chaw rau koj li. Npaj txhij! Koj tuaj yeem tam sim no nkag mus rau koj tus sau, pib tshaj tawm thiab teeb tsa lub ntsiab :), tab sis ...

Lub Ntiaj Teb Geek (Kuv) muab cov ntsiab lus no rau koj los nruab, kho thiab nyiam. 🙂

Koj tsuas yog yuav tsum rub tawm:

wget http://www.theworldofthegeek.com/files/TWOTGFlat.zip

Unzip nws:

unzip TWOTGFlat.zip

Thiab luam lub ntsiab rau koj Ntsuj Plig Dawb Huv

cp TWOTGFlat/ /var/www/content/themes

Tam sim no nyob hauv qhov chaw ntawm koj Ntsuj Plig Dawb Huv hloov cov ntsiab lus rau tus tshiab, thiab voila!

Yog tias koj muaj lus nug lossis xav tau kev pab nrog Ntsuj Plig Dawb Huv, tawm koj cov lus nug hauv cov lus lossis koj tuaj yeem tiv tauj kuv ntawm kuv lub vev xaib.

Txaus siab! n /


Cov ntsiab lus ntawm tsab xov xwm ua raws li peb cov ntsiab cai ntawm kev tswj hwm kev ncaj nceesCov. Tshaj tawm ib qho yuam kev nyem no.

16 lus, tawm koj li

Tso koj saib

Koj email chaw nyob yuav tsis tsum luam tawm.

*

*

  1. Lub luag haujlwm rau cov ntaub ntawv: Miguel Ángel Gatón
  2. Lub hom phiaj ntawm cov ntaub ntawv: Tswj SPAM, kev tswj xyuas tawm tswv yim.
  3. Sau raws cai: Koj kev tso cai
  4. Kev sib txuas lus ntawm cov ntaub ntawv: Cov ntaub ntawv yuav tsis raug xa mus rau lwm tus neeg thib peb tsuas yog los ntawm kev txiav txim siab raug cai.
  5. Cov ntaub ntawv khaws cia: Cov Ntaub Ntawv khaws tseg los ntawm Occentus Networks (EU)
  6. Txoj Cai: Txhua lub sijhawm koj tuaj yeem txwv, rov qab thiab tshem tawm koj cov ntaub ntawv.

  1.   thalskart said

    Cov lus qhia zoo, Kuv yuav ntsuas nws ntawm "ua si" VPS, koj yuav tsis muaj qhov saib ua ntej ntawm lub ntsiab lus kom pom tias nws ua ntej rub tawm nws 😛

    1.    XTickXIvanX said

      Ntsoov! http://www.theworldofthegeek.com/content/images/2014/Aug/Captura-de-pantalla-de-2014-08-09-17-04-57.png
      Koj tsuas yog yuav tsum hloov kho default.hbs (vim tias nws muaj qhov yuam kev me me hauv navbar) thiab cov sidebar.hbs thiab voila!

      1.    thalskart said

        Ua Tsaug !!

  2.   lub sijhawm 3000 said

    Nthuav nyeem. Tej zaum, kuv mob siab rau kuv tus kheej mus rau ntawm Ntsuj Plig Dawb Huv, tab sis kuv tsis paub tias qhov kev tswj hwm yuav zoo li cas nyob ntawd (qhov tseeb, yog tias nws yuav tsum nkag mus rau VPS, nws yuav nyuaj me ntsis).

    1.    XTickXIvanX said

      Muaj cov cuab yeej tsiv mus rau Dab los ntawm piv txwv li WordPress, nws yooj yim heev los tswj, los ntawm tusite.com / koj nkag tau rau hauv kev tswj hwm ntawm Posts, tus neeg siv thiab blog, hmoov tsis nws tsis muaj kev siv ntau tus neeg siv (Tab sis nws yuav ntxiv), tab sis nrog qee Cov Hacks rau code tuaj yeem ua tau, txawm tias tus kheej kuv xav tau tos txog qhov hloov tshiab kom tsis txhob ua yuam kev, yog tias koj muaj lus nug

      1.    lub sijhawm 3000 said

        Zoo, nyob rau hauv txhua rooj plaub, Kuv xav sim Dab ntau tus neeg siv ntau cov kev tswj hwm.

      2.    XTickXIvanX said

        Thiab tam sim no koj tuaj yeem ua nws!
        Dab twb txhawb ntau tus neeg siv 😀

  3.   Javier Madrid: koj puas xav tau ntau tus thwjtim? said

    Kuv xav paub tias dab muaj dab raws li lub platform lossis blog uas lwm tus tsis paub. Lawv tau ua kom nws paub ntawm no thiab tseem yuav ua li cas rau nruab thiab teeb tsa tab sis, lawv tsis tau hais txog vim li cas siv dab. Piv txwv li, tam sim no WordPress Kuv xav tias yog lub crown nyob rau hauv no hom platform, cov lus nug yuav yog vim li cas siv dab thiab tsis wordpress? Los yog nws tsuas yog ua lwm txoj, cia li ntawd?

    1.    Jorge said

      +1. Kuv xav paub ntxiv txog qhov no, vim tias me ntsis paub txog Dab.

      Kuv tau saib ntawm kuv lub hosting thiab kuv pom tias Softaculous muab nws nruab nws, tab sis kuv tsis pom qhov zoo dua WordPress.

      Qhov tsuas yog qhov kuv tau pom yog tias Dab yog ntau tus neeg nyob hauv me ntsis, kab tias muab qee yam kom zoo dua qhov kev thauj khoom.

      1.    XTickXIvanX said

        Ua kom kawg cov neeg rau zaub mov thauj khoom yog nrawm dua thiab siv cov khoom siv tsawg

    2.    XTickXIvanX said

      Kuv yuav piav qhia tias nyob hauv tshooj tom ntej 😉

  4.   rawm 7 said

    Thiab ib qho uas kuv tseem tsis nkag siab ... Dab yog Dab Tsi? Rau ib qhov blog? Rau ib tug sau? ...

    1.    elav ua said

      Los tsim ib qho blog

  5.   elav ua said

    Zoo heev. Tam sim no tsuas muaj ob peb screenshots sab laug mus saib dab tsi Dab zoo li ntawm sab nraud thiab sab hauv

    1.    lub sijhawm 3000 said

      Tib yam nkaus. Tsuas yog ob peb daim duab coj los piav txog tus txheej txheem thiab txhua tus muaj kev zoo siab. #LOL.

    2.    XTickXIvanX said

      Tus txiv neej, hais tias yog qhov tom ntej 😀