use supervisor

This commit is contained in:
jysperm
2014-08-27 07:43:49 +08:00
parent f676bcb14e
commit ce076d08a9
5 changed files with 21 additions and 35 deletions

View File

@@ -17,7 +17,7 @@
vi /etc/hostname
vi /etc/hosts
apt-get install nodejs git mongodb=2.4 nginx postfix redis-server ntp
apt-get install nodejs git mongodb=2.4 nginx postfix redis-server ntp supervisor
apt-get install python g++ make screen git wget zip unzip iftop vim curl htop iptraf nethogs
apt-get install libcurl4-openssl-dev axel unrar-free emacs subversion subversion-tools tmux mercurial
@@ -74,14 +74,19 @@
cd ~
git clone https://github.com/jysperm/RootPanel.git
cd RootPanel
vi RootPanel/config.coffee
chmod 750 config.coffee
vi config.coffee
vi /etc/supervisor/conf.d/rpadmin.conf
[program:RootPanel]
command=node /home/rpadmin/RootPanel/start.js
autorestart=true
user=rpadmin
npm install
service supervisor restart
make install
make start
### Plugin
# Linux
@@ -121,7 +126,7 @@
# ShadowSocks
apt-get install python-pip python-m2crypto supervisor
apt-get install python-pip python-m2crypto
pip install shadowsocks
mkdir /etc/shadowsocks

View File

@@ -1,16 +0,0 @@
all: install
install:
npm install
run:
node start.js
start:
node node_modules/forever/bin/forever start start.js
restart:
node node_modules/forever/bin/forever restart start.js
stop:
node node_modules/forever/bin/forever stop start.js

View File

@@ -4,7 +4,7 @@ RootPanel 是一个高度插件化的,基于 Linux 的虚拟服务销售平台
它的核心功能包括用户和计费系统工单系统管理员面板其余具体的功能均以插件实现RootPanel 支持的典型服务有:
* Linux 虚拟主机(Nginx, PHP, MySQL, MongoDB, Memcached)
* Linux 虚拟主机(Nginx, PHP, MySQL, MongoDB)
即最传统的,将一台 Linux 服务器划分给多个用户的方式。
示例站点:<http://us1.rpvhost.net>
@@ -36,14 +36,9 @@ RootPanel 是一个高度插件化的,基于 Linux 的虚拟服务销售平台
rp-system-sync # 与操作系统同步信息
rp-clean # 清理冗余数据
Makefile:
运行:
make install # 安装依赖
make run # 直接运行
make test # 运行测试(开发中)
make start # 以 forever 启动
make restart # 重启 forever 进程
make stop # 停止 forever 进程
node start.js
配置文件示例(sample 目录):

View File

@@ -21,6 +21,8 @@ global.plugin = require './core/plugin'
if fs.existsSync(config.web.listen)
fs.unlinkSync config.web.listen
fs.chmodSync path.join(__dirname, 'config.coffee'), 0o750
bindRouters = ->
app.use require 'middleware-injector'
@@ -76,7 +78,8 @@ exports.runWebServer = ->
app.use harp.mount(path.join(__dirname, 'core/static'))
app.listen config.web.listen
app.listen config.web.listen, ->
fs.chmodSync config.web.listen, 0o770
unless module.parent
exports.runWebServer()

View File

@@ -16,7 +16,7 @@
}
],
"scripts": {
"start": "make run"
"start": "node start.js"
},
"bin": {
"rp-start": "./bin/rp-start.coffee",
@@ -31,7 +31,6 @@
"coffee-script": "~1.7.1",
"mongodb": "~1.4.8",
"underscore": "~1.6.0",
"forever": "~0.11.1",
"markdown": "~0.5.0",
"async": "~0.9.0",
"connect": "~2.17.3",