Skip to content

Commit

Permalink
WordPress 安装说明
Browse files Browse the repository at this point in the history
  • Loading branch information
jysperm committed Jul 21, 2014
1 parent d58e381 commit f8a8a78
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 7 deletions.
49 changes: 49 additions & 0 deletions WIKI/App/WordPress.md
Original file line number Diff line number Diff line change
@@ -1 +1,50 @@
## 安装
首先你需要成功开通了套餐,然后开启 PHP-FPM, 修改 SSH 密码,修改 MySQL 密码。

登录 SSH, 执行以下命令下载 WordPress, 请自行到官网查看最新版本的下载地址:

wget http://cn.wordpress.org/wordpress-3.9-zh_CN.zip

解压文件:

unzip wordpress-*.zip

设置文件权限:

chmod -R 750 wordpress

删除安装包:

rm wordpress-*.zip

进入 MySQL 控制台(需要输入你的 MySQL 密码):

mysql -p

创建数据库(补全你的用户名):

CREATE DATABASE `<用户名>_wordpress`;

回到面板添加 Nginx 站点(补全你的用户名):

{
"listen": 80,
"server_name": ["<用户名>.rp3.rpvhost.net"],
"index": [
"index.php",
"index.html"
],
"root": "/home/<用户名>/web",
"location": {
"/": {
"try_files": ["$uri", "$uri/", "/index.php?$args"]
},
"~ \\.php$": {
"fastcgi_pass": "unix:///home/<用户名>/phpfpm.sock",
"fastcgi_index": ["index.php"],
"include": "fastcgi_params"
}
}
}

访问 `<用户名>.rp3.rpvhost.net`, 点击 `创建配置文件`, 正确填写数据库名、数据库用户名(你的用户名)、密码,然后下一个页面中填写你的博客的基本信息,即可完成安装。
2 changes: 1 addition & 1 deletion WIKI/Nginx/JSON-CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"try_files": ["$uri", "$uri/", "/index.php?$args"]
},
"~ \\.php$": {
"fastcgi_pass": "unix:///home/user/web",
"fastcgi_pass": "unix:///home/user/phpfpm.sock",
"fastcgi_index": ["index.php"],
"include": "fastcgi_params"
}
Expand Down
6 changes: 3 additions & 3 deletions core/router/utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ exports.checkHomeFilePath = (account, path) ->
unless /^[/A-Za-z0-9_\-\.]+\/?$/.test path
return false

unless path.slice(0, home_dir.length) == homedir
unless path.slice(0, home_dir.length) == home_dir
return false

unless path.length < 512
return false

unless path.slice(-3) == '/..'
unless path.slice(-3) != '/..'
return false

unless path.indexOf('/../') != -1
unless path.indexOf('/../') == -1
return false

return true
7 changes: 4 additions & 3 deletions plugin/nginx/configure.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ exports.assert = (account, config, site_id, callback) ->
callback 'unavailable_server_name'

, (err) ->
return callback err
if err
return callback err

if config.auto_index
config.auto_index = if config.auto_index then true else false

for file in config.index
unless utils.rx.test file
unless utils.rx.filename.test file
return callback 'invalid_index'

unless utils.checkHomeFilePath account, config.root
Expand All @@ -53,7 +54,7 @@ exports.assert = (account, config, site_id, callback) ->
return callback 'invalid_fastcgi_pass'
else if name == 'fastcgi_index'
for file in value
unless utils.rx.test file
unless utils.rx.filename.test file
return callback 'invalid_fastcgi_index'
else if name == 'include'
unless value == 'fastcgi_params'
Expand Down

0 comments on commit f8a8a78

Please sign in to comment.