Changes to CakeResque installation fixes #287

- CakeResque's installation instructions changed
2.2
iglocska 2014-09-12 13:29:30 +02:00
parent be19976da4
commit d51fa92206
8 changed files with 32 additions and 30 deletions

2
.gitignore vendored
View File

@ -1,4 +1,6 @@
/vendors
/app/Vendor
/app/composer*
/lib
/.project
/.settings

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "app/Plugin/CakeResque"]
path = app/Plugin/CakeResque
url = https://github.com/kamisama/Cake-Resque.git
[submodule "app/Lib/cakephp"]
path = app/Lib/cakephp
url = https://github.com/cakephp/cakephp.git

View File

@ -36,9 +36,11 @@ git config core.filemode false
cd "$MISP_PATH"
git submodule init
git submodule update
cd "$MISP_PATH/app/Plugin/CakeResque"
curl -s https://getcomposer.org/installer | php
php composer.phar install
cd "$MISP_PATH/app"
chown -R www-data:www-data "$MISP_PATH"
chmod -R 750 "$MISP_PATH"
chmod -R g+ws "$MISP_PATH/app/tmp"
chmod -R g+ws "$MISP_PATH/app/files"
cd "$MISP_PATH"
chown -R www-data:www-data "$MISP_PATH"
chmod -R 750 "$MISP_PATH"

View File

@ -45,18 +45,28 @@ git clone https://github.com/MISP/MISP.git
cd /var/www/MISP
git config core.filemode false
4/ CakePHP (and CakeResque)
4/ CakePHP
-----------
# CakePHP is now included as a submodule of MISP, execute the following commands to let git fetch it:
git submodule init
git submodule update
# Once done, install the dependencies of CakeResque if you intend to use the built in background jobs:
cd /var/www/MISP/app/Plugin/CakeResque
# Once done, install CakeResque along with its dependencies if you intend to use the built in background jobs:
cd /var/www/MISP/app
curl -s https://getcomposer.org/installer | php
php composer.phar require --no-update kamisama/cake-resque:4.1.0
php composer.phar config vendor-dir Vendor
php composer.phar install
# Once CakeResque is installed, make sure to enable it by uncommenting the following lines:
# in Core.php (if you have just recently updated MISP, just add this line at the end of the file):
# require_once dirname(__DIR__) . '/Vendor/autoload.php';
# in bootstrap.php uncomment the following line (at the end of the file):
# CakePlugin::loadAll(array('CakeResque' => array('bootstrap' => true)));
# set Configure::write('MISP.background_jobs', false); to Configure::write('MISP.background_jobs', true);
# CakeResque normally uses phpredis to connect to redis, but it has a (buggy) fallback connector through Redisent. It is highly advised to install phpredis
pecl install redis
# After installing it, enable it in your php.ini file
@ -146,8 +156,7 @@ sudo -u www-data gpg --homedir /var/www/MISP/.gnupg --gen-key
sudo -u www-data gpg --homedir /var/www/MISP/.gnupg --export --armor YOUR-EMAIL > /var/www/MISP/app/webroot/gpg.asc
# Start the workers to enable background jobs
cd /var/www/MISP/app/Console/worker/
./start.sh
/var/www/MISP/app/Console/worker/start.sh
# To make the background workers start on boot
chmod +x /var/www/MISP/app/Console/worker/start.sh

View File

@ -49,9 +49,13 @@ else
echo "Error, you need either apt-get, yum or brew to install Redis using this script. Please install it manually.";
fi
cd "$MISP_PATH/app/Plugin/CakeResque"
cd "$MISP_PATH/app"
curl -s https://getcomposer.org/installer | php
php composer.phar require --no-update kamisama/cake-resque:4.1.0
php composer.phar config vendor-dir Vendor
php composer.phar install
cd "$MISP_PATH"
chown -R www-data:www-data "$MISP_PATH"
chmod -R 750 "$MISP_PATH"

View File

@ -22,6 +22,7 @@ Enabling background jobs via CakeResque
- vim /var/www/MISP/app/Config/bootstrap.php
- set Configure::write('MISP.background_jobs', false); to Configure::write('MISP.background_jobs', true);
- uncomment CakePlugin::load('CakeResque', array('bootstrap' => true));
- in Core.php (if you have just recently updated MISP, just add this line at the end of the file): require_once dirname(__DIR__) . '/Vendor/autoload.php';
- start the background workers
- cd /var/www/MISP/app/Console/worker/

View File

@ -69,7 +69,8 @@ $config['CakeResque'] = array(
'host' => 'localhost', // Redis server hostname
'port' => 6379, // Redis server port
'database' => 0, // Redis database number
'namespace' => 'resque' // Redis keys namespace
'namespace' => 'resque', // Redis keys namespace
'password' => null // Redis password
),
'Worker' => array(
@ -98,7 +99,7 @@ $config['CakeResque'] = array(
//
// You can also define per-job tracking by passing true/false when calling
// CakeResque::enqueue(), CakeResque::enqueueAt() or CakeResque::enqueueIn()
'track' => true
'track' => false
),
/*
'Queues' => array(
@ -113,16 +114,6 @@ $config['CakeResque'] = array(
)
*/
'Resque' => array(
// Path to the php-resque library
//
// Relative or absolute path to the php-resque library
// If you are using Composer to install dependencies,
// this is the name of the vendor library
// Path is relative to the CakeResque/vendor
// Don't add trailing slash to path
'lib' => 'kamisama/php-resque-ex',
// Path to the directory containing the worker PID files
'tmpdir' => App::pluginPath('CakeResque') . 'tmp' . DS
),
@ -184,8 +175,6 @@ $config['CakeResque'] = array(
// Enable or disable delayed job
'enabled' => true,
// Path to the php-resque-ex-scheduler's library
'lib' => 'kamisama/php-resque-ex-scheduler',
// Path to the log file
'log' => TMP . 'logs' . DS . 'resque-scheduler-error.log',
@ -207,9 +196,5 @@ $config['CakeResque'] = array(
'handler' => 'RotatingFile',
'target' => TMP . 'logs' . DS . 'resque-scheduler.log'
)
),
'Status' => array(
// Path to the resque-status library
'lib' => 'kamisama/resque-status',
)
);

View File

@ -277,3 +277,5 @@ Cache::config('_cake_model_', array(
'serialize' => ($engine === 'File'),
'duration' => $duration
));
//require_once dirname(__DIR__) . '/Vendor/autoload.php';