@@ -6,12 +6,17 @@
ssh -i YOUR_KEY YOUR_ID@YOUR_ID.spring.wikipali.org
```
-## PHP 开发
+## PHP 开发(以用户 xxx 为例)
- `~/www/htdocs/info.php` => `https://YOUR_ID.spring.wikipali.org/info.php`
- 日志文件在 `~/www/logs/`
- 其余参见[常见 PHP 设置](php/)
+## 服务设置
+
+- PostgreSql 连接 `psql -h 127.0.0.1 -U xxx xxx_mint`
+- RabbitMQ 的 `virtual-host` 是`xxx-mint`
## 常用工具
- 文件传输[FileZilla](https://filezilla-project.org/download.php?type=client)
@@ -0,0 +1,19 @@
+#!/bin/bash
+set -e
+if [ "$#" -ne 2 ]
+then
+ echo "Usage: $0 USER PASSWORD"
+ exit 1
+fi
+psql -h 127.0.0.1 -U postgres << EOF
+CREATE DATABASE $1_mint WITH ENCODING = 'UTF8';
+CREATE USER $1 WITH PASSWORD '$2';
+GRANT ALL PRIVILEGES ON DATABASE $1_mint TO $1;
+EOF
+echo "done($1)."
+exit 0
@@ -0,0 +1,17 @@
+rabbitmqctl add_user $1 $2
+rabbitmqctl add_vhost $1-mint
+rabbitmqctl set_permissions -p $1-mint $1 ".*" ".*" ".*"