Tutorial

Como instalar Ghost (CMS) y nodejs usando Caddy Server

Como instalar Ghost (CMS) y nodejs usando Caddy Server

Necesitamos una base de datos

En este caso vamos a instalar MariaDB que personalmente nos ofrece mejor rendimiendo que el servidor mysql

sudo apt-get install mariadb-server
mysql_secure_installation

Ahora necesitamos crear un usuario para nuestra db:

mysql -u root

Mariadb creando usuarios

Importante cambiar "password" por vuestras propias claves

CREATE USER 'ghost'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON *.* TO 'ghost'@'localhost';

FLUSH PRIVILEGES;

#bind-address = 127.0.0.1

exit

service mysql restart

Instalamos nodejs

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install nodejs
node -v

CaddyFile para nuestro dominio

cd /etc/caddy

nano CaddyFile

Y pegamos el siguiente código en el Caddyfile cambiando "dominio.es" por nuestra url:

dominio.es {
root /var/www/
gzip
}
Y reiniamos Caddy para aplicar los cambios:
systemctl restart caddy

Instalamos Ghost Cli

sudo npm i -g ghost-cli

cd /var/www

mkdir ghost

cd ghost

ghost install

El proceso tiene que ser algo similar al siguiente:

root@:/var/www/ghost# ghost install
✔ Checking system Node.js version
✔ Checking current folder permissions
System checks failed with message: 'Linux version is not Ubuntu 16'
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using ghost install local instead.
? Continue anyway? Yes
✔ Checking operating system
✔ Checking MySQL is installed
✔ Checking for latest Ghost version
✔ Setting up install directory
✔ Downloading and installing Ghost v1.18.4
✔ Finishing install process
? Enter your blog URL: https://dominio.es
? Enter your MySQL hostname: localhost
? Enter your MySQL username: ghost
? Enter your MySQL password: [hidden]
? Enter your Ghost database name: ghost_prod
✔ Configuring Ghost
✔ Setting up instance
Running sudo command: useradd --system --user-group ghost
Running sudo command: chown -R ghost:ghost /var/www/ghost/content
✔ Setting up "ghost" system user
? Do you wish to set up Nginx? No
ℹ Setting up Nginx [skipped]
Task ssl depends on the 'nginx' stage, which was skipped.
ℹ Setting up SSL [skipped]
? Do you wish to set up "ghost" mysql user? Yes
MySQL user is not "root", skipping additional user setup
ℹ Setting up "ghost" mysql user [skipped]
? Do you wish to set up Systemd? Yes
✔ Creating systemd service file at /var/www/ghost/system/files/ghost_ovh-tecnonucleous-com.service
Running sudo command: ln -sf /var/www/ghost/system/files/ghost_ovh-tecnonucleous-com.service /lib/systemd/system/ghost_ovh-tecnonucleous-com.service
Running sudo command: systemctl daemon-reload
✔ Setting up Systemd
Running sudo command: /var/www/ghost/current/node_modules/.bin/knex-migrator-migrate --init --mgpath /var/www/ghost/current
✔ Running database migrations
? Do you want to start Ghost? Yes
✔ Validating config
Running sudo command: systemctl start ghost_ovh-tecnonucleous-com
✔ Starting Ghost
Running sudo command: systemctl enable ghost_ovh-tecnonucleous-com --quiet
✔ Starting Ghost
You can access your blog at https://dominio.es

Ghost uses direct mail by default
To set up an alternative email method read our docs at https://docs.ghost.org/docs/mail-config

CaddyFile para Ghost

cd /etc/caddy

nano CaddyFile

dominio.com {
proxy / 127.0.0.1:2368 {
transparent
header_upstream X-Forwarded-Proto https
}
}

Y reiniamos Caddy para aplicar los cambios:

systemctl restart caddy

Si esta todo bien al entrar en nuestro dominio desde el navegador nos tendría que salir algo parecido a esto.
ghost-inicio

Creamos nuestra cuenta de admin

Para iniciar la creación de nuestra cuenta de admin tenemos que ingresar en la ruta "/ghost" de nuestro dominio desde el navegador. Ej:

https://dominio.es/ghost

crear-cuenta-ghost

0 Comentarios 0 Comentarios
0 Comentarios 0 Comentarios