Ghostオープンソースブログの構築
8993 ワード
Ghostオープンソースブログの構築
概要
https://ghost.org/
https://ghost.org/docs/install/local/#install-ghost
設置環境
概要
Ghost NodeJs , , 、 、 。
WordPress UI John O’Nolan WordPress Hannah Wolfe ,
, 。
Ghost 2013 4 , 2013 9 Ghost 。
公式サイトhttps://ghost.org/
https://ghost.org/docs/install/local/#install-ghost
設置環境
CentOS-7
- Ghost
- Nginx
- Node.js
- Python
- MySQL
インストール要求- Intel x86 or compatible processor
- Minimum of 256 MB RAM
- Minimum of 150 MB hard drive space
- TCP/IP protocol support
- Compatible operantig systems:
- An x86 or x64 Linux operating system.
- A Windows operating system such as Windows Vista, Windows 7, Windows 8, Windows 10, Windows Server 2008 or Windows Server 2012.
- An OS X operating system.
インチングをインストール#
yum install nginx -y
# nginx
systemctl enable nginx
# nginx
systemctl start nginx
# nginx
ps -ef | grep nginx
Node.jsをインストールします#
yum -y update
# EPEL
yum install epel-release -y
# Node.js npm
yum install nodejs npm --enablerepo=epel
#
#
#
========================================================================================================================================
Package
========================================================================================================================================
:
nodejs x86_64 1:6.17.1-1.el7 epel 4.7 M
npm x86_64 1:3.10.10-1.6.17.1.1.el7 epel 2.5 M
:
libicu x86_64 50.2-4.el7_7 updates 6.9 M
libuv x86_64 1:1.34.0-1.el7 epel 144 k
========================================================================================================================================
2 (+2 )
:14 M
:51 M
#
#
#
# node.js
npm install -g n
#
#
#
/usr/bin/n -> /usr/lib/node_modules/n/bin/n
/usr/lib
└── [email protected]
#
#
#
# node.js
# n , node.js 8.11.3
n 8.11.3
installing : node-v8.11.3
mkdir : /usr/local/n/versions/node/8.11.3
fetch : https://nodejs.org/dist/v8.11.3/node-v8.11.3-linux-x64.tar.xz
installed : v8.11.3 (with npm 5.6.0)
Note: the node command changed location and the old location may be remembered in your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
To reset the command location hash either start a new shell, or execute PATH="$PATH"
#
#
#
#
vim ~/.bash_profile
#
exportN_PREFIX=/usr/local/bin/node
exportPATH=$N_PREFIX/bin:$PATH
#
source ~/.bash_profile
# , Node.js 。
npm install pm2 -g
#
#
#
/usr/local/bin/pm2 -> /usr/local/lib/node_modules/pm2/bin/pm2
/usr/local/bin/pm2-dev -> /usr/local/lib/node_modules/pm2/bin/pm2-dev
/usr/local/bin/pm2-docker -> /usr/local/lib/node_modules/pm2/bin/pm2-docker
/usr/local/bin/pm2-runtime -> /usr/local/lib/node_modules/pm2/bin/pm2-runtime
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/pm2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ [email protected]
added 199 packages in 75.388s
#
#
#
# Node.js
node -v
v8.11.3
npm -v
5.6.0
Ghostの設置# Ghost
mkdir -p /var/www/ghost
# Ghost , Ghost
cd /var/www/ghost
wget https://ghost.org/zip/ghost-latest.zip
unzip ghost-latest.zip
# gcc c++
yum -y install gcc gcc-c++
# npm Ghost
npm install -production
#
#
#
npm WARN notice [SECURITY] express-brute has the following vulnerability: 1 high. Go here for more details: https://www.npmjs.com/advisories?search=express-brute&version=1.0.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN deprecated [email protected]: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This project is unmaintained
npm WARN notice [SECURITY] mime has the following vulnerability: 1 moderate. Go here for more details: https://www.npmjs.com/advisories?search=mime&version=1.2.11 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.
npm WARN deprecated [email protected]: This project is unmaintained
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
> [email protected] install /var/www/ghost/node_modules/dtrace-provider
> node-gyp rebuild || node suppress-error.js
make: “/var/www/ghost/node_modules/dtrace-provider/build”
TOUCH Release/obj.target/DTraceProviderStub.stamp
make: “/var/www/ghost/node_modules/dtrace-provider/build”
> [email protected] install /var/www/ghost/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build
node-pre-gyp WARN Using request for node-pre-gyp https download
[sqlite3] Success: "/var/www/ghost/node_modules/sqlite3/lib/binding/node-v57-linux-x64/node_sqlite3.node" is installed via remote
> [email protected] install /var/www/ghost/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
#
#
#
# npm start Ghost, 。
#
vi /var/www/ghost/core/server/config/env/config.development.json
# config.development.json URL Ghost
#
#
#
{
"url": "http://localhost:2368",
"database": {
"client": "sqlite3",
"connection": {
"filename": "content/data/ghost-dev.db"
},
"debug": false
},
"paths": {
"contentPath": "content/"
},
"privacy": {
"useRpcPing": false,
"useUpdateCheck": true
},
"useMinFiles": false,
"caching": {
"theme": {
"maxAge": 0
},
"admin": {
"maxAge": 0
}
}
}
#
#
#
# gcc c++
yum -y install gcc gcc-c++
# npm Ghost
npm install -production
# npm start Ghost,
cd /var/www/ghost/
npm start
Ghostの逆エージェントとしてNgixを設定します.# Ghost Nginx
vim /etc/nginx/conf.d/ghost.conf
# ghost.conf , server_name Ghost
upstream ghost {
server 127.0.0.1:2368;
}
server {
listen 80;
server_name myghostblog.com;
access_log /var/log/nginx/ghost.access.log;
error_log /var/log/nginx/ghost.error.log;
proxy_buffers 16 64k;
proxy_buffer_size 128k;
location / {
proxy_pass http://ghost;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_X_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
}
}
nginx -t
#
systemctl restart nginx.service
スタートGhostcd /var/www/ghost/
npm start
ファイアウォールの配置# 【 】
systemctl status firewalld
# 【 】
firewall-cmd --state
#
service firewalld start
#
service firewalld restart
#
service firewalld stop
#
firewall-cmd --query-port=8080/tcp
# 80
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --permanent --add-port=8080-8085/tcp
#
firewall-cmd --permanent --remove-port=8080/tcp
#
firewall-cmd --permanent --list-ports
# ( )
firewall-cmd --reload