Ghost+MySQL 到底要怎么设置呢? 各位指点下

2014-12-13 00:23:05 +08:00
 Jays
配置文件如下:

// # Ghost Configuration
// Setup your Ghost install for various environments
// Documentation can be found at http://support.ghost.org/config/

var path = require('path'),
config;

config = {
// ### Production
// When running Ghost in the wild, use the production environment
// Configure your URL and mail settings here
production: {
url: 'http://localhost',
mail: {},
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root', //我们暂且用 MySQL 的 root 账户
password : '111111', //输入你的 MySQL 密码
database : 'ghost', //我们前面为 Ghost 创建的数据库名称
charset : 'utf8'
},
debug: false
},

server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
}
},

// ### Development **(default)**
development: {
// The url to use when providing links to the site, E.g. in RSS and email.
// Change this to your Ghost blogs published URL.
url: 'http://localhost:2368',

// Example mail config
// Visit http://support.ghost.org/mail for instructions
// ```
// mail: {
// transport: 'SMTP',
// options: {
// service: 'Mailgun',
// auth: {
// user: '', // mailgun username
// pass: '' // mailgun password
// }
// }
// },
// ```

database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root', //我们暂且用 MySQL 的 root 账户
password : '111111', //输入你的 MySQL 密码
database : 'ghost', //我们前面为 Ghost 创建的数据库名称
charset : 'utf8'
},
debug: false
},
server: {
// Host to be passed to node's `net.Server#listen()`
host: '127.0.0.1',
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT`
port: '2368'
},
paths: {
contentPath: path.join(__dirname, '/content/')
}
},

// **Developers only need to edit below here**

// ### Testing
// Used when developing Ghost to run tests and check the health of Ghost
// Uses a different port number
testing: {
url: 'http://127.0.0.1:2369',
database: {
client: 'sqlite3',
connection: {
filename: path.join(__dirname, '/content/data/ghost-test.db')
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},

// ### Testing MySQL
// Used by Travis - Automated testing run through GitHub
'testing-mysql': {
url: 'http://127.0.0.1:2369',
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'root',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
},

// ### Testing pg
// Used by Travis - Automated testing run through GitHub
'testing-pg': {
url: 'http://127.0.0.1:2369',
database: {
client: 'pg',
connection: {
host : '127.0.0.1',
user : 'postgres',
password : '',
database : 'ghost_testing',
charset : 'utf8'
}
},
server: {
host: '127.0.0.1',
port: '2369'
},
logging: false
}
};

// Export config
module.exports = config;



npm start 后提示

> ghost@0.5.6 start /www/web/ghost
> node index

ERROR: Ghost is unable to start due to missing dependencies:
Cannot find module 'bcryptjs'
Cannot find module 'bluebird'
Cannot find module 'body-parser'
Cannot find module 'bookshelf'
Cannot find module 'busboy'
Cannot find module 'cheerio'
Cannot find module 'colors'
Cannot find module 'compression'
Cannot find module 'connect-slashes'
Cannot find module 'downsize'
Cannot find module 'express'
Cannot find module 'express-hbs'
Cannot find module 'fs-extra'
Cannot find module 'html-to-text'
Cannot find module 'knex'
Cannot find module 'lodash'
Cannot find module 'moment'
Cannot find module 'morgan'
Cannot find module 'node-uuid'
Cannot find module 'nodemailer'
Cannot find module 'oauth2orize'
Cannot find module 'passport'
Cannot find module 'passport-http-bearer'
Cannot find module 'passport-oauth2-client-password'
Cannot find module 'request'
Cannot find module 'rss'
Cannot find module 'semver'
Cannot find module 'showdown-ghost'
Cannot find module 'sqlite3'
Cannot find module 'unidecode'
Cannot find module 'validator'
Cannot find module 'xml'
Cannot find module 'qiniu'
Cannot find module 'upyun'
Cannot find module 'aliyun-sdk'

Please run `npm install --production` and try starting Ghost again.
Help and documentation can be found at http://support.ghost.org.


npm install --production 运行后还是使用SQLite3
3150 次点击
所在节点    问与答
2 条回复
Lesilva
2014-12-13 06:03:14 +08:00
database: {
client: 'mysql',
connection: {
host : '127.0.0.1',
user : 'your_database_user',
password : 'your_database_password',
database : 'ghost_db',
charset : 'utf8'
}
}

要改Production里面的 你改成Development的设置了
Jays
2014-12-13 09:59:40 +08:00
@Lesilva Production也是mysql的配置

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/153567

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX