블로그 설치
블로그 설치 과정 (ghost)
사전 설치 단계
'#dnf -y update
'#reboot
'#sudo setenforce 0# sudo sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config
'#sudo dnf remove -y @nodejs# curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo bash -
'#dnf install -y nodejs
'#node -v# npm install pm2 -g
'#useradd ghostadmin# passwd ghostadmin
'#usermod -aG wheel ghostadmin
'#npm i -g ghost-cli
'#which ghost/bin/ghost
'#mkdir -p /var/www/ghost# chown ghostadmin:ghostadmin /var/www/ghost# chmod 775 /var/www/ghost
'#su - ghostadmin# cd /var/www/ghost# mkdir <웹 서비스 디렉토리># cd <웹 서비스 디렉토리>
sqlite로 일단 설치
'#ghost install --db=sqlite3
Ghost was installed successfully! To complete setup of your publication, visit:
'#ghost ls
Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.https://careers.ghost.org/product-engineer-node-js
Warning: MySQL 8 will be the required database in the next major release of Ghost.
Make sure your database is up to date to ensure forwards compatibility.
'#sudo systemctl is-active ghost_localhost
| Name | Location | Version | Status | URL | Port | Process Manager |
|---|---|---|---|---|---|---|
| localhost | /var/www/ghost/<웹 서비스 디렉토리> | 5.9.1 | running (production) | http://localhost:2368/ | 2368 | systemd |
Migration (sqllite3 -> mysql8)
config.production.json file
...
"database": {
"client": "sqlite3",
"connection": {
"filename": "/var/www/ghost/blog.parbat.link/content/data/ghost.db"
}
},
...
to
...
"database": {
"client": "mysql",
"connection": {
"host": "localhost",
"port": "3306",
"user": "**username**",
"password": "**passwd**",
"database": "**database**"
}
},
...
Web Server nginx configuration
server {
listen 80;listen [::]:80;
server_name blog.example.com;
root /var/www/ghost/blog.example.com/system/nginx-root;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://127.0.0.1:2368;
}
location ~ /.well-known {
allow all;
}
client_max_body_size 50m;
}Enjoy my blog & Try your own blog...
