CentOS 7에서 Ghost (CMS) 블로그 게시 플랫폼을 설치하는 방법
Ghost는 무료 오픈 소스이며 Nodejs로 작성된 간단하면서도 강력한 블로깅 또는 온라인 출판 소프트웨어입니다. 온라인 출판물을 쉽게 작성하고 실행하기 위해 설계된 최신 출판 도구 모음입니다.
- Fast, scalable and efficient.
- Offers a markdown based editing environment.
- Comes with a desktop app.
- Comes with beautiful handlebars templates.
- Supports for simple content management.
- Supports for multiples roles for authors, editors and administrators.
- Allows scheduling content in advance.
- Supports accelerated mobile Pages.
- Fully supports search engine optimization.
- Provides detailed structured data.
- Supports subscriptions by RSS, Email and Slack.
- Enables simple site editing and so much more.
- A CentOS 7 Server Minimal Install with 1GB Memory
- A CentOS 7 system with static IP address
- Node v6 LTS – Install Latest Node.js and NPM in CentOS 7
- A CentOS 7 server with Nginx installed
중요 : Ghost를 직접 설치하기 전에 좋은 VPS 호스팅이 필요합니다. BlueHost를 적극 권장합니다.
이 기사에서는 CentOS 7 시스템에 오픈 소스 Ghost (Content Management System) 블로그 플랫폼을 설치하는 방법을 설명합니다.
1 단계 : CentOS 7에 Nodejs 설치
1. CentOS의 소프트웨어 저장소에서는 Nodejs를 사용할 수 없으므로 먼저 저장소를 추가 한 후 다음과 같이 설치합니다.
# 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. nodejs가 설치되면 명령을 사용하여 권장되는 Nodejs 및 npm 버전이 설치되어 있는지 확인할 수 있습니다.
# node -v # npm -v

2 단계 : CentOs 7에 Ghost 설치
3. 이제 권장 설치 위치 인 /var/www/ghost
에 응용 프로그램 파일을 저장할 Ghost 루트 디렉토리를 만듭니다.
# mkdir -p /var/www/ghost
4. 그런 다음 Ghost의 GitHub 저장소에서 최신 버전의 Ghost를 다운로드하고 위에서 만든 디렉토리에 아카이브 파일의 압축을 풉니 다.
# curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip # unzip -uo ghost.zip -d /var/www/ghost
5. 이제 새 ghost 디렉토리로 이동하고 다음 명령을 사용하여 Ghost (생산 종속성 만 해당)를 설치하십시오. 두 번째 명령이 완료되면 시스템에 Ghost를 설치해야합니다.
# cd /var/www/ghost # npm install --production
3 단계 : 기본 Ghost 블로그 시작 및 액세스
6. Ghost를 시작하려면/var/www/ghost 디렉토리에서 다음 명령을 실행하십시오.
# npm start --production

7. 기본적으로 Ghost는 포트 2368에서 실행되어야하므로 방화벽에서 포트를 열어 액세스를 허용하십시오.
# firewall-cmd --zone=public --permanent --add-port=2368/tcp # firewall-cmd --reload
8. 이제 웹 브라우저를 열고 아래 URL 중 하나로 이동하십시오.
http://SERVER_IP:2368 OR http://localhost:2368
참고 : 처음으로 Ghost를 실행하면 Ghost의 루트 디렉토리에 config.js 파일이 생성됩니다. 이를 사용하여 고스트에 대한 환경 수준 구성을 설정할 수 있습니다. 사이트 URL, 데이터베이스, 메일 설정 등과 같은 옵션을 구성 할 수 있습니다.
4 단계 : Ghost 용 Nginx 설치 및 구성
표시된대로 EPEL 저장소를 사용하여 설치되지 않은 경우 Nginx 웹 서버를 설치하고 시작합니다.
# yum install epel-release # yum install nginx # systemctl start nginx
방화벽을 실행중인 경우 다음 명령을 사용하여 HTTP 및 HTTPS 트래픽에 대한 액세스를 활성화합니다.
# firewall-cmd --permanent --zone=public --add-service=http # firewall-cmd --permanent --zone=public --add-service=https # firewall-cmd --reload
다음 단계는 사용자가 URL 끝에 : 2368
포트를 추가하지 않고도 Ghost 블로그에 액세스 할 수 있도록 포트 80에서 Ghost 블로그를 서버하도록 Nginx를 구성하는 것입니다.
먼저 터미널에서 CTRL + C
키를 눌러 실행중인 Ghost 인스턴스를 중지하십시오.
이제/etc/nginx/sites-available/ghost 아래에 새 파일을 만들어 Nginx를 구성합니다.
# vi /etc/nginx/sites-available/ghost
다음 구성을 추가하고 강조 표시된 다음 줄을 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; } }
/ etc/nginx/sites-enabled 디렉토리에 심볼릭 링크를 만들어 파일을 저장하고이 구성을 활성화합니다.
# ln -s /etc/nginx/sites-available/ghost /etc/nginx/sites-enabled/ghost
이제 /etc/nginx.conf 파일을 엽니 다. "사이트가 활성화 된 디렉토리에 구성 파일을 포함하고 표시된대로 기본 사이트를 비활성화합니다.
# vi /etc/nginx/nginx.conf
이제 http
블록 내부에 다음 줄을 추가하여 사이트 사용 디렉터리에 구성 파일을 포함합니다.
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/*;
그런 다음 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/*; # 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 { # } ... ...
마지막으로 nginx 웹 서버를 저장하고 다시 시작하십시오.
# systemctl restart nginx
다시 한 번 http :/your_domain_or_ip_address를 방문하면 Ghost 블로그를 볼 수 있습니다.
자세한 내용은 Ghost 홈페이지 (https://ghost.org/)를 참조하십시오.
이 기사에서는 CentOS 7에서 Ghost를 설치하고 구성하는 방법을 설명했습니다. 아래 의견 양식을 사용하여 가이드에 대한 질문이나 의견을 보내주십시오.
마지막으로 다음 포스트에서는 데비안과 우분투에서 Ghost를 설정하는 방법을 보여 드리겠습니다. 그때까지는 Tecmint.com에 계속 연결하십시오.