php - Install Yii2 advanced template in ubuntu -
i set project on localhost , on staging server.
but want move project on ubuntu
server.
i tried when try locate project giving me the requested url <project_name>/admin/site/login not found on server.
here main.php
file:
<?php use \yii\web\request; $params = array_merge( require(__dir__ . '/../../common/config/params.php'), require(__dir__ . '/../../common/config/params-local.php'), require(__dir__ . '/params.php'), require(__dir__ . '/params-local.php') ); include(__dir__ . '/constants.php'); include(__dir__ . '/print_arr_helper.php'); $siteurl = 'http://**ipaddress**/<project_name>/'; return [ 'id' => 'app-backend', 'basepath' => dirname(__dir__), 'controllernamespace' => 'backend\controllers', 'bootstrap' => ['log'], 'modules' => [], 'as beforerequest' => [ 'class' => 'yii\filters\accesscontrol', 'rules' => [ [ 'actions' => ['login', 'error'], 'allow' => true, ], [ 'allow' => true, 'roles' => ['@'], ], ], ], 'components' => [ 'request'=>[ 'class' => 'common\components\request', 'web'=> '/backend/web', 'adminurl' => '/admin', ], 'urlmanager' => [ 'enableprettyurl' => true, 'showscriptname' => false, 'rules' => [] ], 'user' => [ 'identityclass' => 'app\models\user', 'enableautologin' => false, ], 'log' => [ 'tracelevel' => yii_debug ? 3 : 0, 'targets' => [ [ 'class' => 'yii\log\filetarget', 'levels' => ['error', 'warning'], ], ], ], 'mongodb' => [ 'class' => '\yii\mongodb\connection', 'dsn' => 'mongodb://localhost:27017/<db_name>', ], 'errorhandler' => [ 'erroraction' => 'site/error', ], ], 'params' => $params, ]; ?>
here .htaacess
file:
options +followsymlinks rewriteengine on # deal admin first rewritecond %{request_uri} ^/<projrct_name>/(admin) rewriterule ^admin/assets/(.*)$ backend/web/assets/$1 [l] rewriterule ^admin/css/(.*)$ backend/web/css/$1 [l] rewritecond %{request_uri} !^/<projrct_name>/backend/web/(assets|css)/ rewritecond %{request_uri} ^/<projrct_name>/(admin) rewriterule ^.*$ backend/web/index.php [l] rewritecond %{request_uri} ^/<projrct_name>/(assets|css) rewriterule ^assets/(.*)$ frontend/web/assets/$1 [l] rewriterule ^css/(.*)$ frontend/web/css/$1 [l] rewritecond %{request_uri} !^/<projrct_name>/(frontend|backend|ws)/web/(assets|css)/ rewritecond %{request_uri} !index.php rewritecond %{request_filename} !-f [or] rewritecond %{request_filename} !-d rewriterule ^.*$ frontend/web/index.php
in backend/
forlders .htaccess
, if write <ipaddress>/backend/
in url
redirect http://<ipaddress>/<project_name>/admin/site/login
.
can help?
it solved making changes in /etc/apache2/apache2.conf
file.
made changes on line no:166
. form none
all
.
Comments
Post a Comment