From 246c8bbdc957f1837d8f7fecec3937c6946a9c1a Mon Sep 17 00:00:00 2001 From: Error202 Date: Sat, 23 Jan 2021 22:40:52 +0300 Subject: [PATCH] Update php7.4 Update provision files Disable installing ElasticSearch, SuperVisor and Redis --- Vagrantfile | 9 +- api/codeception.yml | 15 ++ api/config/.gitignore | 3 + api/config/bootstrap.php | 1 + api/config/main.php | 301 ++++++++++++++++++++++ api/config/params.php | 4 + api/config/test.php | 4 + api/web/favicon.ico | Bin 0 -> 1150 bytes api/web/index-test.php | 18 ++ api/web/index.php | 25 ++ common/config/bootstrap.php | 2 +- common/runtime/mail/20180211-204419-7974-3045.eml | 10 - common/runtime/mail/20180211-204542-9675-3097.eml | 10 - common/runtime/mail/20180211-204830-4001-4976.eml | 10 - common/runtime/mail/20180211-204904-0101-1020.eml | 10 - common/tests/_data/user.php | 12 +- environments/dev/common/config/params-local.php | 8 +- environments/dev/common/config/test-local.php | 2 +- environments/prod/common/config/main-local.php | 2 +- environments/prod/common/config/params-local.php | 8 +- frontend/tests/fixtures/data/user.php | 12 +- vagrant/config/vagrant-local.example.yml | 6 +- vagrant/nginx/app.conf | 49 +++- vagrant/nginx/log/.gitignore | 4 +- vagrant/nginx/log/static-error.log | 47 ---- vagrant/provision/always-as-root.sh | 8 +- vagrant/provision/once-as-root.sh | 33 +-- 27 files changed, 470 insertions(+), 143 deletions(-) create mode 100644 api/codeception.yml create mode 100644 api/config/.gitignore create mode 100644 api/config/bootstrap.php create mode 100644 api/config/main.php create mode 100644 api/config/params.php create mode 100644 api/config/test.php create mode 100644 api/web/favicon.ico create mode 100644 api/web/index-test.php create mode 100644 api/web/index.php delete mode 100644 common/runtime/mail/20180211-204419-7974-3045.eml delete mode 100644 common/runtime/mail/20180211-204542-9675-3097.eml delete mode 100644 common/runtime/mail/20180211-204830-4001-4976.eml delete mode 100644 common/runtime/mail/20180211-204904-0101-1020.eml delete mode 100644 vagrant/nginx/log/static-error.log diff --git a/Vagrantfile b/Vagrantfile index cd33d60..3bc9221 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -7,9 +7,10 @@ required_plugins.each do |plugin| end domains = { - frontend: 'morework.local', - backend: 'admin.morework.local', - static: 'static.morework.local', + frontend: 'zxcms.local', + backend: 'admin.zxcms.local', + static: 'static.zxcms.local', + api: 'api.zxcms.local', } config = { @@ -74,5 +75,5 @@ Vagrant.configure(2) do |config| config.vm.provision 'shell', path: './vagrant/provision/always-as-root.sh', run: 'always' # post-install message (vagrant console) - config.vm.post_up_message = "Frontend URL: http://#{domains[:frontend]}\nBackend URL: http://#{domains[:backend]}" + config.vm.post_up_message = "Frontend URL: http://#{domains[:frontend]}\nBackend URL: http://#{domains[:backend]}\nStatic URL: http://#{domains[:static]}\nAPI URL: http://#{domains[:api]}" end diff --git a/api/codeception.yml b/api/codeception.yml new file mode 100644 index 0000000..c6eb90a --- /dev/null +++ b/api/codeception.yml @@ -0,0 +1,15 @@ +namespace: api\tests +actor: Tester +paths: + tests: tests + log: tests/_output + data: tests/_data + helpers: tests/_support +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +modules: + config: + Yii2: + configFile: 'config/test-local.php' diff --git a/api/config/.gitignore b/api/config/.gitignore new file mode 100644 index 0000000..42799dd --- /dev/null +++ b/api/config/.gitignore @@ -0,0 +1,3 @@ +main-local.php +params-local.php +test-local.php diff --git a/api/config/bootstrap.php b/api/config/bootstrap.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/api/config/bootstrap.php @@ -0,0 +1 @@ + 'app-api', + 'language' => 'ru', + 'basePath' => dirname(__DIR__), + 'bootstrap' => [ + 'log', + 'common\bootstrap\SetUp', + 'api\bootstrap\SetUp', + [ + 'class' => ContentNegotiator::class, + 'formats' => [ + 'application/json' => 'json', + 'application/xml' => 'xml', + ] + ] + ], + 'aliases' => [ + '@staticRoot' => $params['staticPath'], + '@static' => $params['staticHostInfo'], + ], + 'controllerNamespace' => 'api\controllers', + 'modules' => [ + 'oauth2' => [ + 'class' => Module::class, + 'tokenParamName' => 'accessToken', + 'tokenAccessLifetime' => 3600 * 24, + 'storageMap' => [ + 'user_credentials' => Identity::class, + ], + 'components' => [ + 'request' => function () { + return Request::createFromGlobals(); + }, + 'response' => [ + 'class' => Response::class, + ], + ], + 'grantTypes' => [ + 'user_credentials' => [ + 'class' => UserCredentials::class, + ], + 'refresh_token' => [ + 'class' => RefreshToken::class, + 'always_issue_new_refresh_token' => true + ], + ], + ], + ], + 'components' => [ + 'request' => [ + 'baseUrl' => '', + 'cookieValidationKey' => $params['cookieValidationKey'], + 'parsers' => [ + 'application/json' => JsonParser::class, + ], + ], + 'response' => [ + 'formatters' => [ + 'json' => [ + 'class' => JsonResponseFormatter::class, + 'prettyPrint' => YII_DEBUG, + 'encodeOptions' => JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE, + ], + ], + ], + 'user' => [ + 'identityClass' => Identity::class, + 'enableAutoLogin' => false, + 'enableSession' => false, + /*'identityClass' => 'common\auth\Identity', + 'enableAutoLogin' => true, + 'identityCookie' => ['name' => '_identity', 'httpOnly' => true, 'domain' => $params['cookieDomain']], + 'loginUrl' => ['auth/auth/login'],*/ + ], + /*'session' => [ + 'name' => '_session', + 'class' => 'yii\web\DbSession', + 'writeCallback' => function ($session) { + return [ + 'user_id' => Yii::$app->user->id + ]; + }, + 'cookieParams' => [ + 'domain' => $params['cookieDomain'], + 'httpOnly' => true, + ], + ],*/ + 'log' => [ + 'traceLevel' => YII_DEBUG ? 3 : 0, + 'targets' => [ + [ + 'class' => FileTarget::class, + 'levels' => ['error', 'warning'], + ], + ], + ], + 'backendUrlManager' => require __DIR__ . '/../../backend/config/urlManager.php', + 'frontendUrlManager' => require __DIR__ . '/../../frontend/config/urlManager.php', + 'urlManager' => [ + 'enablePrettyUrl' => true, + 'enableStrictParsing' => true, + 'showScriptName' => false, + 'rules' => [ + '' => 'site/index', + 'GET offer' => 'site/offer', + + 'GET profile' => 'user/profile/index', + 'PUT profile' => 'user/profile/update', + 'GET profile/avatar' => 'user/profile/avatar-get', + 'POST profile/avatar' => 'user/profile/avatar-set', + + 'POST oauth2/' => 'oauth2/rest/', + + 'GET cards' => 'card/index', + 'GET card/main/' => 'card/main', + 'GET card/contacts/' => 'card/contacts', + 'GET card/education/' => 'card/education', + 'GET card/photos/' => 'card/photos', + 'GET card/biography/' => 'card/biography', + 'GET card/company/' => 'card/company', + + 'PUT card/main/' => 'card/main-update', + 'PUT card/contacts/' => 'card/contacts-update', + 'PUT card/education/' => 'card/education-update', + 'PUT card/photos/' => 'card/photos-update', + 'PUT card/biography/' => 'card/biography-update', + 'PUT card/company/' => 'card/company-update', + 'GET card/backgrounds' => 'card/backgrounds', + + 'POST card' => 'card/create', + 'POST card/sort' => 'card/sort', + 'DELETE card/' => 'card/delete', + 'PUT card/' => 'card/update', + + 'GET card/order/' => 'card/order', + + 'POST card/upload-file' => 'card/upload-file', + 'POST card/delete-file' => 'card/delete-file', + 'POST card/photo-process' => 'card/photo-process', + + 'GET card/block-toggle//' => 'card/block-toggle', + + 'POST auth/signup' => 'auth/signup/request', + 'POST auth/reset/request' => 'auth/reset/request', + 'POST auth/reset/check' => 'auth/reset/check', + 'POST auth/reset/confirm' => 'auth/reset/confirm', + ], + ], + 'i18n' => [ + 'translations' => [ + 'modules/oauth2/*' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@api/messages', + ], + 'user' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + 'auth' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + 'main' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + ], + ], + /*'errorHandler' => [ + 'errorAction' => 'site/error', + ], + 'backendUrlManager' => require __DIR__ . '/../../backend/config/urlManager.php', + 'frontendUrlManager' => require __DIR__ . '/urlManager.php', + 'urlManager' => function () { + return Yii::$app->get('frontendUrlManager'); + },*/ + /*'i18n' => [ + 'translations' => [ + 'post' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + 'slider' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + 'auth' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + 'user' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + 'main' => [ + 'class' => 'yii\i18n\PhpMessageSource', + 'basePath' => '@frontend/messages', + ], + ], + ],* + 'view' => [ + 'theme' => [ + 'basePath' => '@webroot/themes/sport', + 'baseUrl' => '@web/themes/sport', + 'pathMap' => [ + '@frontend/views' => '@webroot/themes/sport', + '@frontend/widgets' => '@webroot/themes/sport/widgets', + ], + ], + ], + 'assetManager' => [ + 'bundles' => [ + 'yii\web\JqueryAsset' => [ + 'sourcePath' => '@frontend/assets/libs/jquery321', // do not publish the bundle + 'js' => [ + YII_ENV_DEV ? 'jquery-3.2.1.js' : 'jquery-3.2.1.min.js' + ], + ], + 'yii\bootstrap\BootstrapAsset' => [ + 'sourcePath' => '@frontend/assets/libs/bootstrap4/css', // do not publish the bundle + 'css' => [ + YII_ENV_DEV ? 'bootstrap.css' : 'bootstrap.min.css' + ], + ], + 'yii\bootstrap\BootstrapPluginAsset' => [ + 'sourcePath' => '@frontend/assets/libs/bootstrap4/js', // do not publish the bundle + 'js' => [ + YII_ENV_DEV ? 'bootstrap.js' : 'bootstrap.min.js' + ], + 'depends' => [ + 'yii\web\JqueryAsset', + 'yii\bootstrap\BootstrapAsset', + ], + ], + ], + ],*/ + ], + 'as authenticator' => [ + 'class' => CompositeAuth::class, + 'except' => [ + 'site/index', + 'site/offer', + 'oauth2/rest/token', + 'auth/reset/check', + 'auth/reset/confirm', + 'auth/reset/request', + 'auth/signup/request' + ], + 'authMethods' => [ + ['class' => 'yii\filters\auth\HttpBearerAuth'], + ['class' => 'yii\filters\auth\QueryParamAuth', 'tokenParam' => 'accessToken'], + ] + ], + 'as access' => [ + 'class' => AccessControl::class, + 'except' => [ + 'site/index', + 'site/offer', + 'oauth2/rest/token', + 'auth/reset/check', + 'auth/reset/confirm', + 'auth/reset/request', + 'auth/signup/request' + ], + 'rules' => [ + [ + 'allow' => true, + 'roles' => ['@'], + ], + ], + ], + 'as exceptionFilter' => [ + 'class' => ErrorToExceptionFilter::class, + ], + 'params' => $params, +]; diff --git a/api/config/params.php b/api/config/params.php new file mode 100644 index 0000000..4ef2d82 --- /dev/null +++ b/api/config/params.php @@ -0,0 +1,4 @@ + 'admin@example.com', +]; diff --git a/api/config/test.php b/api/config/test.php new file mode 100644 index 0000000..4492857 --- /dev/null +++ b/api/config/test.php @@ -0,0 +1,4 @@ + 'app-api-tests', +]; diff --git a/api/web/favicon.ico b/api/web/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..af1efb131cc5fe8a1d72294456b8655b31fc5ea4 GIT binary patch literal 1150 zcmaKsUu;ul7{;HKWhfUwkO-SWiIRmNK@u-a)C z_I;l7p7;AsfhswdE`?lIV|O+1B7n7mgd{Q-mjRI9ZY`c;b}ko^cry zK6KSOdj{h1I4#T4oI!7AGescdYDGOK_#EFVETo>vFl=$K&JUqp4Jiwr#W5PV-Ri?@w_TC4rjF@y*N^^WjpdR9$($>B8u% z{v-Hr@F2SVEwvk^PgiuG^;(4ta|j`11!8!P2J=0JizCM>`eMevJ8&HI9|8vtpcLp> zzh2fVE&GGAS3W}ky#g^bj~}cXuH^@&d!N+dD%d^2U^_U}0{Xn-u^(T{vztU45^CVX zK7kmVXF$d|TBoL_c4dMc44nppC&c5Jcr>FR&wg99Yjus1y9jsCh}-BFvVu?eD4WZ= z3x&czR(Au#=fKb@FwiC*M^W~BQB!$8J&NC6scDz=Ws~%0yW==rnM{TmtDDiwRUEwl zhR=e-C&i-`jgM>fz0~5?{fNb4vumUGp_2&G?paN<3yfX@?|zBtkxuM*Qai7AiN`JN zp}&JM<1!Qdt7!iU#;>7dUO{{0B33?4TZu&?ku|Z%)!tOteIq@9i>W>|js1o#RyUrj nrun(); diff --git a/api/web/index.php b/api/web/index.php new file mode 100644 index 0000000..57fc2a3 --- /dev/null +++ b/api/web/index.php @@ -0,0 +1,25 @@ +run(); diff --git a/common/config/bootstrap.php b/common/config/bootstrap.php index a58602a..6565899 100644 --- a/common/config/bootstrap.php +++ b/common/config/bootstrap.php @@ -4,4 +4,4 @@ Yii::setAlias('@frontend', dirname(dirname(__DIR__)) . '/frontend'); Yii::setAlias('@backend', dirname(dirname(__DIR__)) . '/backend'); Yii::setAlias('@console', dirname(dirname(__DIR__)) . '/console'); Yii::setAlias('@core', dirname(dirname(__DIR__)) . '/core'); - +Yii::setAlias('@api', dirname(dirname(__DIR__)) . '/api'); diff --git a/common/runtime/mail/20180211-204419-7974-3045.eml b/common/runtime/mail/20180211-204419-7974-3045.eml deleted file mode 100644 index 69b55c8..0000000 --- a/common/runtime/mail/20180211-204419-7974-3045.eml +++ /dev/null @@ -1,10 +0,0 @@ -Message-ID: <20189f40525bb5a2e980be9f0962783e@morework.local> -Date: Sun, 11 Feb 2018 20:44:19 +0000 -Subject: 234 -From: -To: admin@example.com -MIME-Version: 1.0 -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -345 \ No newline at end of file diff --git a/common/runtime/mail/20180211-204542-9675-3097.eml b/common/runtime/mail/20180211-204542-9675-3097.eml deleted file mode 100644 index 23576fa..0000000 --- a/common/runtime/mail/20180211-204542-9675-3097.eml +++ /dev/null @@ -1,10 +0,0 @@ -Message-ID: <02451d183d7c136e702e1c2c5da2b33a@morework.local> -Date: Sun, 11 Feb 2018 20:45:42 +0000 -Subject: 234 -From: -To: admin@example.com -MIME-Version: 1.0 -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -sdsfgsf \ No newline at end of file diff --git a/common/runtime/mail/20180211-204830-4001-4976.eml b/common/runtime/mail/20180211-204830-4001-4976.eml deleted file mode 100644 index 2ccb3db..0000000 --- a/common/runtime/mail/20180211-204830-4001-4976.eml +++ /dev/null @@ -1,10 +0,0 @@ -Message-ID: <87697b396f9ad35d8ff3bed0a033fd4e@morework.local> -Date: Sun, 11 Feb 2018 20:48:30 +0000 -Subject: 234 -From: -To: admin@example.com -MIME-Version: 1.0 -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -555 \ No newline at end of file diff --git a/common/runtime/mail/20180211-204904-0101-1020.eml b/common/runtime/mail/20180211-204904-0101-1020.eml deleted file mode 100644 index e970b90..0000000 --- a/common/runtime/mail/20180211-204904-0101-1020.eml +++ /dev/null @@ -1,10 +0,0 @@ -Message-ID: -Date: Sun, 11 Feb 2018 20:49:03 +0000 -Subject: Test Subj -From: -To: admin@example.com -MIME-Version: 1.0 -Content-Type: text/plain; charset=utf-8 -Content-Transfer-Encoding: quoted-printable - -dscsdc \ No newline at end of file diff --git a/common/tests/_data/user.php b/common/tests/_data/user.php index 81a1748..edbd81a 100644 --- a/common/tests/_data/user.php +++ b/common/tests/_data/user.php @@ -3,11 +3,11 @@ return [ 'user1' => [ "id" => 1, - "username" => "Error202", + "username" => "user702", "auth_key" => "I4MJAUm8ZZ4rennRmwhjfeZ7xV2-FpYn", "password_hash" => '$2y$13$Q/XqSZs.6Y5KYmKf5OhpEOGWoB1GfBjxg8DTTnvionrJrCkezgyZe', "password_reset_token" => null, - "email" => "error-202@mail.ru", + "email" => "user-702@gmail.com", "email_confirm_token" => null, "status" => 10, "created_at" => 1516021751, @@ -18,11 +18,11 @@ return [ ], 'user2' => [ "id" => 17, - "username" => "Error203", + "username" => "user703", "auth_key" => "wW7PWDP0yUvGVzEqy3dZepb0tj19ejv6", "password_hash" => '$2y$13$Spf7/iHOj3aJARSORST4s.blouBXtUPLzMf7sD4AX9akSK1URGkfe', "password_reset_token" => null, - "email" => "error-202@yandex.ru", + "email" => "user-703@gmail.com", "email_confirm_token" => null, "status" => 10, "created_at" => 1518122129, @@ -33,11 +33,11 @@ return [ ], 'user3' => [ "id" => 18, - "username" => "zz", + "username" => "user704", "auth_key" => "JbLkAlfA7jQ0XxbaWxUEPWQCzsVZ9gn8", "password_hash" => '$2y$13$gyDo.ax9O962rq9pfh6sX.ZHrZ05cTZNAaX8VEMBL7n6UPsMr/vHa', "password_reset_token" => null, - "email" => "zz@morework.ru", + "email" => "user-704@gmail.com", "email_confirm_token" => "AcNTOgIMhefCq5tQaOyUqEIeIPLFqFdY", "status" => 0, "created_at" => 1518157352, diff --git a/environments/dev/common/config/params-local.php b/environments/dev/common/config/params-local.php index 3f7ca93..14226d7 100644 --- a/environments/dev/common/config/params-local.php +++ b/environments/dev/common/config/params-local.php @@ -13,9 +13,9 @@ return [ ]; /* - 'cookieDomain' => '.morework.local', + 'cookieDomain' => '.zxcms.local', 'staticPath' => dirname(__DIR__, 2) . '/static', - 'frontendHostInfo' => 'http://morework.local', - 'backendHostInfo' => 'http://admin.morework.local', - 'staticHostInfo' => 'http://static.morework.local', + 'frontendHostInfo' => 'http://zxcms.local', + 'backendHostInfo' => 'http://admin.zxcms.local', + 'staticHostInfo' => 'http://static.zxcms.local', */ diff --git a/environments/dev/common/config/test-local.php b/environments/dev/common/config/test-local.php index b3dc5c8..8d81d42 100644 --- a/environments/dev/common/config/test-local.php +++ b/environments/dev/common/config/test-local.php @@ -6,7 +6,7 @@ return yii\helpers\ArrayHelper::merge( [ 'components' => [ 'db' => [ - 'dsn' => 'mysql:host=localhost;dbname=morework_test', + 'dsn' => 'mysql:host=localhost;dbname=zxcms_test', ] ], ] diff --git a/environments/prod/common/config/main-local.php b/environments/prod/common/config/main-local.php index 20876b2..70c75c7 100644 --- a/environments/prod/common/config/main-local.php +++ b/environments/prod/common/config/main-local.php @@ -3,7 +3,7 @@ return [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', - //'dsn' => 'mysql:host=localhost;dbname=morework', + //'dsn' => 'mysql:host=localhost;dbname=zxcms', 'dsn' => '', 'username' => '', 'password' => '', diff --git a/environments/prod/common/config/params-local.php b/environments/prod/common/config/params-local.php index 3f7ca93..14226d7 100644 --- a/environments/prod/common/config/params-local.php +++ b/environments/prod/common/config/params-local.php @@ -13,9 +13,9 @@ return [ ]; /* - 'cookieDomain' => '.morework.local', + 'cookieDomain' => '.zxcms.local', 'staticPath' => dirname(__DIR__, 2) . '/static', - 'frontendHostInfo' => 'http://morework.local', - 'backendHostInfo' => 'http://admin.morework.local', - 'staticHostInfo' => 'http://static.morework.local', + 'frontendHostInfo' => 'http://zxcms.local', + 'backendHostInfo' => 'http://admin.zxcms.local', + 'staticHostInfo' => 'http://static.zxcms.local', */ diff --git a/frontend/tests/fixtures/data/user.php b/frontend/tests/fixtures/data/user.php index 0c58d09..c72b844 100644 --- a/frontend/tests/fixtures/data/user.php +++ b/frontend/tests/fixtures/data/user.php @@ -3,11 +3,11 @@ return [ 'user1' => [ "id" => 1, - "username" => "Error202", + "username" => "user701", "auth_key" => "I4MJAUm8ZZ4rennRmwhjfeZ7xV2-FpYn", "password_hash" => "$2y$13$53Y5IhwZyUkvLirp.qq.o.J0XRDOPRFVCbkHSzYXKVb6.DbdM9uYy", "password_reset_token" => null, - "email" => "error-202@mail.ru", + "email" => "user-701@gmail.com", "email_confirm_token" => null, "status" => 10, "created_at" => 1516021751, @@ -18,11 +18,11 @@ return [ ], 'user2' => [ "id" => 17, - "username" => "Error203", + "username" => "user703", "auth_key" => "wW7PWDP0yUvGVzEqy3dZepb0tj19ejv6", "password_hash" => '$2y$13$Spf7/iHOj3aJARSORST4s.blouBXtUPLzMf7sD4AX9akSK1URGkfe', "password_reset_token" => null, - "email" => "error-202@yandex.ru", + "email" => "user-703@gmail.com", "email_confirm_token" => null, "status" => 10, "created_at" => 1518122129, @@ -33,11 +33,11 @@ return [ ], 'user3' => [ "id" => 18, - "username" => "zz", + "username" => "user704", "auth_key" => "JbLkAlfA7jQ0XxbaWxUEPWQCzsVZ9gn8", "password_hash" => '$2y$13$gyDo.ax9O962rq9pfh6sX.ZHrZ05cTZNAaX8VEMBL7n6UPsMr/vHa', "password_reset_token" => null, - "email" => "zz@morework.ru", + "email" => "user-704@gmail.com", "email_confirm_token" => "AcNTOgIMhefCq5tQaOyUqEIeIPLFqFdY", "status" => 0, "created_at" => 1518157352, diff --git a/vagrant/config/vagrant-local.example.yml b/vagrant/config/vagrant-local.example.yml index 3e1e6e2..57112c5 100644 --- a/vagrant/config/vagrant-local.example.yml +++ b/vagrant/config/vagrant-local.example.yml @@ -1,5 +1,5 @@ # Your personal GitHub token -github_token: 87c011e7ff30a9d6218f2e946e4e4b8161bee640 +github_token: # Read more: https://github.com/blog/1509-personal-api-tokens # You can generate it here: https://github.com/settings/tokens @@ -10,10 +10,10 @@ timezone: Europe/Moscow box_check_update: false # Virtual machine name -machine_name: morework.dev +machine_name: zxcms.local # Virtual machine IP -ip: 192.168.83.83 +ip: 192.168.83.1 # Virtual machine CPU cores number cpus: 1 diff --git a/vagrant/nginx/app.conf b/vagrant/nginx/app.conf index 7d94c14..f960e85 100644 --- a/vagrant/nginx/app.conf +++ b/vagrant/nginx/app.conf @@ -6,7 +6,7 @@ server { listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 - server_name morework.local; + server_name zxcms.local; root /app/frontend/web/; index index.php; @@ -28,7 +28,7 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_pass 127.0.0.1:9000; - fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; try_files $uri =404; } @@ -45,7 +45,7 @@ server { listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 - server_name admin.morework.local; + server_name admin.zxcms.local; root /app/backend/web/; index index.php; @@ -67,7 +67,7 @@ server { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #fastcgi_pass 127.0.0.1:9000; - fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; + fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; try_files $uri =404; } @@ -84,7 +84,46 @@ server { listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 - server_name static.morework.local; + server_name api.zxcms.local; + root /app/api/web/; + index index.php; + + access_log /app/vagrant/nginx/log/api-access.log; + error_log /app/vagrant/nginx/log/api-error.log; + + location / { + # Redirect everything that isn't a real file to index.php + try_files $uri $uri/ /index.php$is_args$args; + } + + # uncomment to avoid processing of calls to non-existing static files by Yii + #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { + # try_files $uri =404; + #} + #error_page 404 /404.html; + + location ~ \.php$ { + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + #fastcgi_pass 127.0.0.1:9000; + fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; + try_files $uri =404; + } + + location ~ /\.(ht|svn|git) { + deny all; + } +} + +server { + charset utf-8; + client_max_body_size 128M; + sendfile off; + + listen 80; ## listen for ipv4 + #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 + + server_name static.zxcms.local; root /app/static/; error_log /app/vagrant/nginx/log/static-error.log; diff --git a/vagrant/nginx/log/.gitignore b/vagrant/nginx/log/.gitignore index c15cedd..352a26c 100644 --- a/vagrant/nginx/log/.gitignore +++ b/vagrant/nginx/log/.gitignore @@ -2,4 +2,6 @@ backend-access.log backend-error.log frontend-access.log -frontend-error.log \ No newline at end of file +frontend-error.log +static-access.log +static-error.log \ No newline at end of file diff --git a/vagrant/nginx/log/static-error.log b/vagrant/nginx/log/static-error.log deleted file mode 100644 index e6449cc..0000000 --- a/vagrant/nginx/log/static-error.log +++ /dev/null @@ -1,47 +0,0 @@ -2018/01/16 19:15:37 [error] 1912#1912: *160 open() "/app/static/favicon.ico" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.dev, request: "GET /favicon.ico HTTP/1.1", host: "static.morework.dev" -2018/01/16 19:15:37 [error] 1912#1912: *160 open() "/app/static/favicon.ico" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.dev, request: "GET /favicon.ico HTTP/1.1", host: "static.morework.dev" -2018/01/27 14:32:59 [error] 1935#1935: *199 open() "/app/static/photos/shutterstock_773261143_gb3tD.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /photos/shutterstock_773261143_gb3tD.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/slider/update?id=1" -2018/01/27 14:32:59 [error] 1935#1935: *199 open() "/app/static/photos/shutterstock_773261143_gb3tD.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /photos/shutterstock_773261143_gb3tD.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/slider/update?id=1" -2018/01/29 01:46:25 [error] 1838#1838: *1499 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/view?id=10" -2018/01/29 01:46:37 [error] 1838#1838: *1499 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/01/29 01:46:37 [error] 1838#1838: *1499 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/01/29 01:48:03 [error] 1838#1838: *1499 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/view?id=10" -2018/01/29 01:52:07 [error] 1838#1838: *1508 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/01/29 01:52:07 [error] 1838#1838: *1508 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/01/29 01:52:34 [error] 1838#1838: *1508 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/view?id=10" -2018/01/29 01:54:38 [error] 1838#1838: *1516 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/01/29 01:54:39 [error] 1838#1838: *1516 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/01/29 02:20:41 [error] 1838#1838: *1551 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/view?id=10" -2018/01/29 02:21:04 [error] 1838#1838: *1551 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/01/29 02:21:04 [error] 1838#1838: *1551 open() "/app/static/cache/posts/thumb_gallery_view_10.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_10.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/post/post/update?id=10" -2018/07/06 10:04:55 [error] 1920#1920: *1218 open() "/app/static/cache/posts/blog_post_-1.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_-1.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview" -2018/07/06 10:17:34 [error] 1920#1920: *1225 open() "/app/static/cache/posts/blog_post_-1.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_-1.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview" -2018/07/06 10:17:57 [error] 1920#1920: *1225 open() "/app/static/cache/posts/blog_post_-1.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_-1.jpg HTTP/1.1", host: "static.morework.local" -2018/07/06 10:18:44 [error] 1920#1920: *1228 open() "/app/static/cache/posts/blog_post_-1.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_-1.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview" -2018/07/06 10:20:25 [error] 1920#1920: *1232 open() "/app/static/cache/posts/blog_post_-1.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_-1.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview" -2018/07/25 14:48:26 [error] 1933#1933: *552 open() "/app/static/cache/posts/blog_post_13.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_13.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=22" -2018/07/25 14:49:11 [error] 1933#1933: *558 open() "/app/static/cache/posts/blog_post_23.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_23.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=23" -2018/07/25 14:49:57 [error] 1933#1933: *558 open() "/app/static/cache/posts/blog_post_24.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_24.png HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=24" -2018/07/25 14:50:22 [error] 1933#1933: *558 open() "/app/static/cache/posts/blog_post_25.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_25.png HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=25" -2018/07/25 14:55:07 [error] 1933#1933: *583 open() "/app/static/cache/posts/blog_post_26.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_26.png HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=26" -2018/07/25 14:55:25 [error] 1933#1933: *583 open() "/app/static/cache/posts/blog_post_26.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_26.png HTTP/1.1", host: "static.morework.local" -2018/07/25 14:55:32 [error] 1933#1933: *583 open() "/app/static/cache/posts/blog_post_26.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_26.png HTTP/1.1", host: "static.morework.local" -2018/07/25 15:14:57 [error] 1933#1933: *638 open() "/app/static/cache/posts/blog_post_28.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_28.png HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=28" -2018/07/25 15:19:30 [error] 1933#1933: *663 open() "/app/static/cache/posts/blog_post_30.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_30.png HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=30" -2018/07/25 15:33:18 [error] 1933#1933: *669 open() "/app/static/cache/posts/blog_post_31.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_31.png HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=31" -2018/07/25 15:35:13 [error] 1933#1933: *676 open() "/app/static/cache/posts/blog_post_32.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_32.png HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=32" -2018/07/25 20:06:07 [error] 1933#1933: *946 open() "/app/static/cache/posts/blog_post_53.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/blog_post_53.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://morework.local/blog/post/preview?id=53" -2018/07/25 23:05:07 [error] 1933#1933: *1256 open() "/app/static/cache/posts/thumb_gallery_view_68.jpg" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_68.jpg HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/view/68" -2018/07/25 23:36:51 [error] 1933#1933: *1389 open() "/app/static/cache/posts/thumb_gallery_view_27.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_27.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/view/27" -2018/07/25 23:47:55 [error] 1933#1933: *1465 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/view/83" -2018/07/25 23:48:13 [error] 1933#1933: *1465 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/update?id=83" -2018/07/25 23:48:13 [error] 1933#1933: *1465 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/update?id=83" -2018/07/25 23:50:33 [error] 1933#1933: *1497 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/view/83" -2018/07/25 23:50:39 [error] 1933#1933: *1497 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/update?id=83" -2018/07/25 23:50:39 [error] 1933#1933: *1497 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/update?id=83" -2018/07/25 23:51:08 [error] 1933#1933: *1497 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/view/83" -2018/07/25 23:51:14 [error] 1933#1933: *1497 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/update?id=83" -2018/07/25 23:51:14 [error] 1933#1933: *1497 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/update?id=83" -2018/07/26 15:10:09 [error] 1933#1933: *1523 open() "/app/static/cache/posts/thumb_gallery_view_83.png" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /cache/posts/thumb_gallery_view_83.png HTTP/1.1", host: "static.morework.local", referrer: "http://admin.morework.local/blog/manage/post/view/83" -2018/09/25 09:36:44 [error] 1951#1951: *1806 open() "/app/static/robots.txt" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /robots.txt HTTP/1.1", host: "static.morework.local" -2018/09/25 09:36:44 [error] 1951#1951: *1804 open() "/app/static/favicon.ico" failed (2: No such file or directory), client: 192.168.83.1, server: static.morework.local, request: "GET /favicon.ico HTTP/1.1", host: "static.morework.local", referrer: "http://static.morework.local/origin/products/1/1.jpg" diff --git a/vagrant/provision/always-as-root.sh b/vagrant/provision/always-as-root.sh index 72904c0..72b30a3 100644 --- a/vagrant/provision/always-as-root.sh +++ b/vagrant/provision/always-as-root.sh @@ -13,9 +13,9 @@ function info { info "Provision-script user: `whoami`" info "Restart web-stack" -service php7.1-fpm restart +service php7.4-fpm restart service nginx restart service mysql restart -service elasticsearch restart -service redis restart -service supervisor restart \ No newline at end of file +#service elasticsearch restart +#service redis restart +#service supervisor restart \ No newline at end of file diff --git a/vagrant/provision/once-as-root.sh b/vagrant/provision/once-as-root.sh index 5c992a0..4b39512 100644 --- a/vagrant/provision/once-as-root.sh +++ b/vagrant/provision/once-as-root.sh @@ -26,15 +26,15 @@ debconf-set-selections <<< "mysql-community-server mysql-community-server/root-p debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password \"''\"" echo "Done!" -info "Add PHp 7.1 repository" +info "Add PHP repository" add-apt-repository ppa:ondrej/php -y info "Add Oracle JDK repository" add-apt-repository ppa:webupd8team/java -y -info "Add ElasticSearch sources" -wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - -echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list +#info "Add ElasticSearch sources" +#wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - +#echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list info "Update OS software" apt-get update @@ -42,24 +42,25 @@ apt-get upgrade -y info "Install additional software" #apt-get install -y php7.0-curl php7.0-cli php7.0-intl php7.0-mysqlnd php7.0-gd php7.0-fpm php7.0-mbstring php7.0-xml unzip nginx mysql-server-5.7 php.xdebug -apt-get install -y php7.1-curl php7.1-cli php7.1-intl php7.1-mysqlnd php7.1-gd php7.1-fpm php7.1-mbstring php7.1-xml php7.1-zip unzip nginx mysql-server-5.7 php.xdebug +#apt-get install -y php7.1-curl php7.1-cli php7.1-intl php7.1-mysqlnd php7.1-gd php7.1-fpm php7.1-mbstring php7.1-xml php7.1-zip unzip nginx mysql-server-5.7 php.xdebug +apt-get install -y php7.4-curl php7.4-cli php7.4-intl php7.4-mysql php7.4-gd php7.4-fpm php7.4-mbstring php7.4-xml php7.4-zip unzip nginx mysql-server-5.7 libmagickwand-dev imagemagick php-dev php-imagick info "Install Oracle JDK" debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 select true" debconf-set-selections <<< "oracle-java8-installer shared/accepted-oracle-license-v1-1 seen true" apt-get install -y oracle-java8-installer -info "Install ElasticSearch" -apt-get install -y elasticsearch -sed -i 's/-Xms2g/-Xms64m/' /etc/elasticsearch/jvm.options -sed -i 's/-Xmx2g/-Xmx64m/' /etc/elasticsearch/jvm.options -service elasticsearch restart +#info "Install ElasticSearch" +#apt-get install -y elasticsearch +#sed -i 's/-Xms2g/-Xms64m/' /etc/elasticsearch/jvm.options +#sed -i 's/-Xmx2g/-Xmx64m/' /etc/elasticsearch/jvm.options +#service elasticsearch restart -info "Install Redis" -apt-get install -y redis-server +#info "Install Redis" +#apt-get install -y redis-server -info "Install Supervisor" -apt-get install -y supervisor +#info "Install Supervisor" +#apt-get install -y supervisor info "Configure MySQL" sed -i "s/.*bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/mysql.conf.d/mysqld.cnf @@ -91,8 +92,8 @@ ln -s /app/vagrant/nginx/app.conf /etc/nginx/sites-enabled/app.conf echo "Done!" info "Initailize databases for MySQL" -mysql -uroot <<< "CREATE DATABASE morework" -mysql -uroot <<< "CREATE DATABASE morework_test" +mysql -uroot <<< "CREATE DATABASE zxcms" +mysql -uroot <<< "CREATE DATABASE zxcms_test" echo "Done!" info "Enabling supervisor processes"