Bii o ṣe le Fi sori ẹrọ Ẹmi (CMS) Platform Publishing Platform ni CentOS 7


Iwin jẹ ọfẹ, orisun ṣiṣi ati irọrun bulọọgi ti o lagbara sibẹsibẹ lagbara tabi sọfitiwia ikede lori ayelujara ti a kọ sinu Nodejs. O jẹ ikojọpọ ti awọn irinṣẹ atẹjade igbalode ti a ṣe apẹrẹ fun kikọ ni irọrun ati ṣiṣẹ awọn atẹjade ori ayelujara.

  • Yara, ti iwọn ati ṣiṣe.
  • Nfun agbegbe ṣiṣatunkọ orisun iṣapẹẹrẹ.
  • Wa pẹlu ohun elo tabili kan.
  • Wa pẹlu awọn awoṣe ọwọ ọwọ ẹwa.
  • Awọn atilẹyin fun iṣakoso akoonu rọrun.
  • Awọn atilẹyin fun awọn ipa ọpọ fun awọn onkọwe, awọn olootu ati awọn alakoso.
  • Faye gba ṣiṣe eto akoonu ni ilosiwaju.
  • Ṣe atilẹyin Awọn oju-iwe alagbeka onikiakia.
  • Ni atilẹyin ni kikun iṣapeye ẹrọ wiwa.
  • Pese data ti a ti eleto alaye.
  • Ṣe atilẹyin awọn ṣiṣe alabapin nipasẹ RSS, Imeeli ati Ọlẹ.
  • Jeki ṣiṣatunkọ aaye ti o rọrun ati pupọ diẹ sii.

  1. Apakan Sọọsi olupin CentOS 7 kan pẹlu Iranti 1GB
  2. Eto CentOS 7 kan pẹlu adiresi IP aimi
  3. Node v6 LTS - Fi Node.js Tuntun sii ati NPM ni CentOS 7
  4. Olupin CentOS 7 kan pẹlu fifi sori ẹrọ Nginx

Pataki: Ṣaaju ki o to bẹrẹ fifi Ẹmi sii funrararẹ, iwọ yoo nilo lati ni alejo gbigba VPS ti o dara, a ṣe iṣeduro gíga BlueHost.

Ninu àpilẹkọ yii, a yoo ṣalaye bi a ṣe le fi sori ẹrọ orisun orisun Ẹmi (Eto Isakoso akoonu) pẹpẹ bulọọgi lori eto CentOS 7 kan.

Igbesẹ 1: Fifi Nodejs sori CentOS 7

1. Nodejs ko si ni awọn ibi ipamọ sọfitiwia ti CentOS, nitorinaa kọkọ ṣafikun awọn ibi ipamọ rẹ lẹhinna fi sii bi atẹle

# 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. Lọgan ti a fi awọn nodejs sori ẹrọ, o le rii daju pe o ni ẹya ti a ṣe iṣeduro ti Nodejs ati npm ti fi sii nipa lilo awọn ofin.

# node -v 
# npm -v

Igbesẹ 2: Fifi Ẹmi Lori Awọn CentOs 7

3. Bayi ṣẹda itọsọna root Ghost eyi ti yoo tọju awọn faili ohun elo ni /var/www/ghost , eyiti o jẹ ipo fifi sori ẹrọ ti a ṣe iṣeduro.

# mkdir -p /var/www/ghost

4. Itele, ṣe igbasilẹ ẹya tuntun ti Ẹmi lati ibi ipamọ GitHub ti Ghost ati ṣii faili faili ile-iwe sinu itọsọna ti o ṣẹṣẹ ṣe loke.

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

5. Bayi gbe si itọsọna iwin tuntun, ki o fi Ẹmi sii (awọn igbẹkẹle iṣelọpọ nikan) pẹlu awọn ofin wọnyi. Lọgan ti aṣẹ keji ba pari, o yẹ ki a fi Iwin sori ẹrọ rẹ.

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

Igbesẹ 3: Bẹrẹ ati Iwọle si Blog Ghost Default

6. Lati bẹrẹ Ẹmi, ṣiṣe aṣẹ atẹle lati itọsọna/var/www/iwin.

# npm start --production

7. Nipa aiyipada, Ẹmi yẹ ki o ṣiṣẹ lori ibudo 2368, nitorinaa ṣii ibudo lori ogiriina lati gba aaye laaye.

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

8. Bayi ṣii ẹrọ lilọ kiri lori ayelujara kan ki o lọ kiri si eyikeyi ti URL atẹle ni isalẹ.

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

Akiyesi: Lẹhin ṣiṣe Ẹmi fun igba akọkọ, faili config.js yoo ṣẹda ni itọsọna root ti Ẹmi. O le lo lati ṣeto iṣeto ipele ipele ayika fun iwin; nibi ti o ti le tunto awọn aṣayan bii URL aaye rẹ, ibi ipamọ data, awọn eto meeli abbl.

Igbesẹ 4: Fi sori ẹrọ ati Tunto Nginx fun Iwin

Fi sori ẹrọ ati bẹrẹ olupin ayelujara Nginx, ti ko ba fi sii nipa lilo ibi ipamọ EPEL bi o ti han.

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

Ti o ba n ṣiṣẹ ogiriina kan, lo awọn ofin wọnyi lati jẹ ki iraye si HTTP ati ijabọ HTTPS.

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

Igbese ti n tẹle ni lati tunto Nginx si olupin bulọọgi wa Ghost lori ibudo 80, ki awọn olumulo le wọle si bulọọgi Ghost laisi fifi ibudo : 2368 sii ni opin URL.

Ni akọkọ da apeere Ẹmi ti n ṣiṣẹ duro nipa kọlu awọn bọtini CTRL + C lori ebute naa.

Bayi tunto Nginx nipa ṣiṣẹda faili tuntun labẹ/ati be be/nginx/awọn aaye-ti o wa/iwin.

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

Ṣafikun iṣeto atẹle yii ki o rii daju lati yi awọn ila ila atẹle wọnyi pada si your_domain_or_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;
    }
}

Fipamọ faili naa ki o ṣiṣẹ iṣeto yii nipa ṣiṣẹda aami-ọrọ labẹ/ati be be/nginx/ilana agbara-aaye.

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

Bayi ṣii faili /etc/nginx.conf. ṣafikun awọn faili iṣeto ni itọsọna aaye ti o ṣiṣẹ ati mu aaye aiyipada ṣiṣẹ bi o ti han.

# vi /etc/nginx/nginx.conf

Bayi ṣafikun laini atẹle ni inu http bulọọki lati ṣafikun awọn faili iṣeto ni itọsọna ti o ni agbara awọn aaye.

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/*;

Lẹhinna sọ asọye patapata Àkọsílẹ olupin aiyipada ti a rii ninu http bulọọki

...

    # 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 {
#       }
...
...

Lakotan, fipamọ ati tun bẹrẹ olupin ayelujara nginx.

# systemctl restart nginx

Lekan si, ṣabẹwo si http:// your_domain_or_ip_address ati pe iwọ yoo wo bulọọgi Ẹmi rẹ.

Fun alaye diẹ sii, lọ si oju-ile Ẹmi: https://ghost.org/

Ninu nkan yii, a ti ṣalaye bi o ṣe le fi sori ẹrọ ati tunto Iwin ni CentOS 7. Lo fọọmu asọye ni isalẹ lati firanṣẹ awọn ibeere rẹ tabi eyikeyi awọn ero nipa itọsọna naa.

Kẹhin ṣugbọn kii kere ju, ninu ifiweranṣẹ wa ti o tẹle, a yoo fihan bi a ṣe le ṣeto Ghost ni Debian ati Ubuntu. Titi di igba naa, wa ni asopọ si linux-console.net.