Giunsa ang Pag-install sa Ghost (CMS) Blog Publishing Platform sa CentOS 7


Ang Ghost usa ka libre, bukas nga gigikanan ug yano apan kusgan nga pag-blog o software sa online nga publikasyon nga gisulat sa Nodejs. Kini usa ka koleksyon sa modernong mga himan sa pagpatik nga gidisenyo alang sa dali nga paghimo ug pagpadagan sa mga online nga publikasyon.

  • Paspas, scalable ug episyente.
  • Nagtanyag ug markdown base sa editing environment.
  • Adunay desktop app.
  • Adunay nindot nga mga template sa handlebars.
  • Mga suporta para sa yano nga pagdumala sa sulod.
  • Nagsuporta sa daghang mga tahas alang sa mga tagsulat, editor ug tigdumala.
  • Gitugotan ang pag-iskedyul sa sulod nga abante.
  • Nagsuporta sa gipadali nga Mga Pahina sa mobile.
  • Hingpit nga nagsuporta sa search engine optimization.
  • Naghatag ug detalyado nga structured data.
  • Nagsuporta sa mga suskrisyon pinaagi sa RSS, Email ug Slack.
  • Nakapahimo sa yano nga pag-edit sa site ug daghan pa.

  1. Usa ka CentOS 7 Server Minimal Install with 1GB Memory
  2. Usa ka CentOS 7 nga sistema nga adunay static nga IP address
  3. Node v6 LTS – I-install ang Pinakabag-o nga Node.js ug NPM sa CentOS 7
  4. Usa ka server sa CentOS 7 nga adunay naka-install nga Nginx

Importante: Sa dili ka pa magsugod sa pag-instalar sa Ghost sa imong kaugalingon, kinahanglan nimo nga adunay usa ka maayo nga VPS hosting, among girekomendar ang BlueHost.

Sa kini nga artikulo, among ipasabut kung giunsa ang pag-install sa usa ka bukas nga gigikanan nga Ghost (Content Management System) nga platform sa pag-blog sa usa ka sistema sa CentOS 7.

Lakang 1: Pag-instalar sa Nodejs sa CentOS 7

1. Ang mga Nodejs dili magamit sa mga software repository sa CentOS, busa idugang una ang mga repository niini ug dayon i-install ang mosunod

# curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
# yum -y install nodejs npm
# dnf -y install nodejs npm   [On Fedora 22+ versions]

2. Sa higayon nga ma-install ang mga nodejs, mahimo nimong pamatud-an nga naa nimo ang girekomenda nga bersyon sa Nodejs ug npm nga na-install gamit ang mga mando.

# node -v 
# npm -v

Lakang 2: Pag-instalar sa Ghost Sa CentOs 7

3. Karon paghimo sa Ghost root directory nga magtipig sa mga file sa aplikasyon sa /var/www/ghost, nga mao ang girekomendar nga lokasyon sa pag-instalar.

# mkdir -p /var/www/ghost

4. Sunod, i-download ang pinakabag-o nga bersyon sa Ghost gikan sa Ghost's GitHub repository ug unzip ang archive file ngadto sa direktoryo nga imong gibuhat sa ibabaw.

# curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
# unzip -uo ghost.zip -d  /var/www/ghost

5. Karon mobalhin sa bag-ong ghost directory, ug i-install ang Ghost (mga dependency sa produksiyon lamang) uban ang mosunod nga mga sugo. Kung makompleto na ang ikaduhang sugo, kinahanglan nga i-install ang Ghost sa imong sistema.

# cd /var/www/ghost 
# npm install --production

Lakang 3: Pagsugod ug Pag-access sa Default nga Ghost Blog

6. Aron masugdan ang Ghost, padagana ang mosunod nga command gikan sa /var/www/ghost directory.

# npm start --production

7. Sa kasagaran, ang Ghost kinahanglan nga nagdagan sa port 2368, busa ablihi ang port sa firewall aron tugutan ang pag-access.

# firewall-cmd --zone=public --permanent --add-port=2368/tcp
# firewall-cmd --reload

8. Karon ablihi ang usa ka web browser ug navigate sa bisan asa sa mosunod nga URL sa ubos.

http://SERVER_IP:2368
OR
http://localhost:2368

Mubo nga sulat: Human sa pagpadagan sa Ghost sa unang higayon, ang file config.js pagabuhaton sa root directory sa Ghost. Mahimo nimo kini gamiton aron itakda ang lebel sa lebel sa kalikopan alang sa ghost; diin mahimo nimong i-configure ang mga kapilian sama sa URL sa imong site, database, setting sa mail ug uban pa.

Lakang 4: I-install ug I-configure ang Nginx para sa Ghost

I-install ug sugdi ang Nginx web server, kung wala kini ma-install gamit ang EPEL repository sama sa gipakita.

# yum install epel-release
# yum install nginx
# systemctl start nginx

Kung nagdagan ka og firewall, gamita ang mosunod nga mga sugo aron ma-access ang trapiko sa HTTP ug HTTPS.

# firewall-cmd --permanent --zone=public --add-service=http 
# firewall-cmd --permanent --zone=public --add-service=https
# firewall-cmd --reload

Ang sunod nga lakang mao ang pag-configure sa Nginx aron i-server ang among Ghost blog sa port 80, aron ang mga tiggamit maka-access sa Ghost blog nga wala magdugang port :2368 sa katapusan sa url.

Ihunong una ang nagdagan nga pananglitan sa Ghost pinaagi sa pag-igo sa CTRL+C nga mga yawe sa terminal.

Karon i-configure ang Nginx pinaagi sa paghimo og bag-ong file ubos sa /etc/nginx/sites-available/ghost.

# vi /etc/nginx/sites-available/ghost

Idugang ang mosunod nga configuration ug siguruha nga usbon ang mosunod nga mga linya sa imong_domain_o_ip_address.

server {
    listen 80;
    server_name your_domain_or_ip_address;
    location / {
    proxy_set_header HOST $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass         http://127.0.0.1:2368;
    }
}

I-save ang file ug i-aktibo kini nga configuration pinaagi sa paghimo og symlink ubos sa /etc/nginx/sites-enabled directory.

# ln -s /etc/nginx/sites-available/ghost /etc/nginx/sites-enabled/ghost

Karon ablihi ang /etc/nginx.conf file. ilakip ang mga file sa pag-configure sa direktoryo nga gipagana sa mga site ug i-disable ang default nga site sama sa gipakita.

# vi /etc/nginx/nginx.conf

Karon idugang ang mosunod nga linya sulod sa http block aron maapil ang configuration files sa sites-enabled directory.

http {
...
    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

Unya hingpit nga ikomento ang default block sa server nga makita sulod sa http block.

...

    # Load modular configuration files from the /etc/nginx/conf.d directory.
    # See http://nginx.org/en/docs/ngx_core_module.html#include
    # for more information.
    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;


#    server {
#       listen       80 default_server;
#       listen       [::]:80 default_server;
#       server_name  _;
#       root         /usr/share/nginx/html;
#
#       # Load configuration files for the default server block.
#       include /etc/nginx/default.d/*.conf;
#
#       location / {
#       }
#
#       error_page 404 /404.html;
#           location = /40x.html {
#       }
#
#       error_page 500 502 503 504 /50x.html;
#           location = /50x.html {
#       }
...
...

Sa katapusan, i-save ug i-restart ang nginx web server.

# systemctl restart nginx

Sa makausa pa, bisitaha ang http://your_domain_or_ip_address ug imong makita ang imong Ghost blog.

Para sa dugang nga impormasyon, adto sa Ghost homepage: https://ghost.org/

Niini nga artikulo, among gipasabut kung giunsa ang pag-install ug pag-configure sa Ghost sa CentOS 7. Gamita ang porma sa komentaryo sa ubos aron ipadala kanamo ang imong mga pangutana o bisan unsang mga hunahuna bahin sa giya.

Katapusan apan dili labing gamay, sa among sunod nga post, ipakita namon kung giunsa ang pag-setup sa Ghost sa Debian ug Ubuntu. Hangtud niana, magpabilin nga konektado sa linux-console.net.