diff --git a/INSTALL.md b/INSTALL.md index 949970f..b81c6db 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -16,33 +16,33 @@ mongo use admin - db.addUser({user: 'rpadmin', pwd: 'password', roles: ['userAdminAnyDatabase', 'dbAdminAnyDatabase']}) + db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWriteAnyDatabase', 'userAdminAnyDatabase', 'dbAdminAnyDatabase', 'clusterAdmin']}) use RootPanel db.addUser({user: 'rpadmin', pwd: 'password', roles: ['readWrite']}) vi /etc/mongodb.conf auth = true + smallfiles = true + + vi /etc/redis/redis.conf + + requirepass password - rm /etc/php5/fpm/pool.d/www.conf rm /etc/nginx/sites-enabled/default - vi /etc/nginx/fastcgi_params - - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - cat > /etc/nginx/sites-available/rpadmin - server { - listen 80 default_server; - listen [::]:80 default_server ipv6only=on; + server { + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; - server_name DOMAIN; + server_name DOMAIN; - location / { - proxy_pass http://unix:/home/rpadmin/rootpanel.sock:/; - } + location / { + proxy_pass http://unix:/home/rpadmin/rootpanel.sock:/; } + } ln -s /etc/nginx/sites-available/rpadmin /etc/nginx/sites-enabled @@ -71,6 +71,7 @@ vi config.coffee + make install make start ### Runtime diff --git a/core/router/middleware.coffee b/core/router/middleware.coffee index 7e4ce41..29011b7 100644 --- a/core/router/middleware.coffee +++ b/core/router/middleware.coffee @@ -17,7 +17,7 @@ exports.getParam = (req, res, next) -> exports.errorHandling = (req, res, next) -> res.error = (name, param = {}) -> param = _.extend param, error: name - res.json 400, param + res.status(400).json param next() exports.accountInfo = (req, res, next) -> diff --git a/core/static/script/panel.coffee b/core/static/script/panel.coffee index 3aa7bef..0b329c2 100644 --- a/core/static/script/panel.coffee +++ b/core/static/script/panel.coffee @@ -48,7 +48,7 @@ $ -> switch $('.option-type :radio:checked').val() when 'fastcgi' config['root'] = $('.option-root input').val() or $('.option-root input').prop('placeholder') - config['index'] ['index.php', 'index.html'] + config['index'] ?= ['index.php', 'index.html'] config['location'] ?= {} config['location']['/'] = try_files: ['$uri', '$uri/', '/index.php?$args'] diff --git a/plugin/phpfpm/INSTALL.md b/plugin/phpfpm/INSTALL.md index e2d52e3..854e2c9 100644 --- a/plugin/phpfpm/INSTALL.md +++ b/plugin/phpfpm/INSTALL.md @@ -1,3 +1,9 @@ ## PHP-FPM apt-get install php5-cli php5-fpm php-pear php5-mysql php5-curl php5-gd php-pear php5-imap php5-mcrypt php5-memcache php5-tidy php5-xmlrpc php5-sqlite php5-mongo + + rm /etc/php5/fpm/pool.d/www.conf + + vi /etc/nginx/fastcgi_params + + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; \ No newline at end of file diff --git a/plugin/ssh/action.coffee b/plugin/ssh/action.coffee index 656f95f..232e4e6 100644 --- a/plugin/ssh/action.coffee +++ b/plugin/ssh/action.coffee @@ -13,7 +13,7 @@ exports.post '/update_password', (req, res) -> child_process.exec "echo '#{req.account.username}:#{req.body.password}' | sudo chpasswd", (err, stdout, stderr) -> throw err if err - res.json 200, {} + res.json {} exports.post '/kill', (req, res) -> pid = parseInt req.body.pid