[Gandi] [Simple Hosting] Ghost installation.
1) Create a working directory:
➜ ~ mkdir GHOST ➜ ~ cd GHOST ➜ GHOST
2) Download and unzip the Ghost archive:
➜ GHOST wget https://ghost.org/zip/ghost-0.8.0.zip ➜ GHOST unzip ghost-0.8.0.zip ➜ GHOST rm ghost-0.8.0.zip
3) Create the user and its database via PhpMyAdmin.
CREATE DATABASE ghost; CREATE USER ghost@localhost IDENTIFIED BY 'password'; GRANT create,delete,insert,select,update,alter ON ghost.* TO 'ghost'@'localhost'; FLUSH privileges;
4) Configuration file:
➜ GHOST cp config.example.js config.js
Open:
config.js
Search:
config = {
// ### Production
// When running Ghost in the wild, use the production environment.
// Configure your URL and mail settings here
production: {
url: 'http://my-ghost-blog.com',
mail: {},
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost.db')
},
debug: false
},
server: {
host: '127.0.0.1',
port: '2368'
}
},
Replace by:
config = {
production: {
url: 'http://0199e79545.url-de-test.ws',
mail: {},
database: {
client: 'mysql',
connection: {
socketPath : '/srv/run/mysqld/mysqld.sock',
user : 'ghost',
password : 'password' ,
database : 'ghost',
charset : 'utf8'
},
debug: false
},
server: {
host: 'localhost',
port: '8080'
}
},
Open :
core/index.js
Search:
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
Replace by:
process.env.NODE_ENV = process.env.NODE_ENV || 'production';
Open:
package.json
Search and remove:
"sqlite3": "3.1.3",
5) Via Filefilla, copy all file in : /lamp0/web/vhosts/default
Remove : server.js
6) Activate the ssh console from the information page of the instance.
7) Connection to the instance via the ssh console :
➜ GHOST ssh 6619534@console.dc0.gpaas.net Asking for console, please wait Connected ... hosting-user@nodejs:/srv/data$
– Go to the default directory:
hosting-user@nodejs:/srv/data$ cd web/vhosts/default/ hosting-user@nodejs:/srv/data/web/vhosts/default$
– Install the application :
hosting-user@nodejs:/srv/data/web/vhosts/default$ npm install --production
Ignore all warnings and errors.
– Start the application :
hosting-user@nodejs:/srv/data/web/vhosts/default$ npm start --production
Ignore all warnings and errors.
8) Purge all objects in Varnish cache.
9) Test the application:
http://0199e79545.url-de-test.ws
10) Liens :
https://wiki.gandi.net/fr/tutorials/simple/nodejs/ghost
https://www.howson.me/setting-up-ghost-with-gandi-simple-hosting/
Comments are closed, but trackbacks and pingbacks are open.