Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
a9534084
Commit
a9534084
authored
Nov 06, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5865: Added info about adjusting advanced application in order to deploy…
Fixes #5865: Added info about adjusting advanced application in order to deploy it under a single domain
parent
649b830a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
7 deletions
+56
-7
tutorial-shared-hosting.md
docs/guide/tutorial-shared-hosting.md
+56
-7
No files found.
docs/guide/tutorial-shared-hosting.md
View file @
a9534084
...
...
@@ -10,7 +10,7 @@ Deploying basic application
Since there's typically only one webroot it is recommended to use basic application template. Refer to
[
Installing Yii chapter
](
start-installation.md
)
and install application template locally.
### Add extras for webserver
### Add extras for webserver
<a name="add-extras-for-webserver"></a>
If webserver used is Apache you'll need to add
`.htaccess`
file with the following content to
`web`
(where
`index.php`
is):
...
...
@@ -31,15 +31,15 @@ RewriteRule . index.php
In case of nginx you should not need any extra config files.
### Renaming webroot
### Renaming webroot
<a name="renaming-webroot"></a>
If after connecting to your shared hosting via FTP or by other means you're seeing something like the following, you're
most probably lucky.
```
config
/
logs
/
www
/
config
logs
www
```
In the above
`www`
is webserver directory root (i.e. webroot). It could be named differently. Common names are:
`www`
,
...
...
@@ -62,4 +62,54 @@ Deploying advanced application
------------------------------
Deploying advanced application to shared hosting is a bit trickier than doing it with basic application because it has
two webroots.
\ No newline at end of file
two webroots which shared hosting typically donesn't have. Because of that structure could be adjusted a bit.
### Move entry scripts into single webroot
First of all we need a webroot directory. Name it the way it matches your hosting webroot as described in
[
Renaming webroot
](
#renaming-webroot
)
above. Then create the following structure:
```
www
admin
backend
common
console
environments
frontend
...
```
`www`
will be our frontend directory so move contents of
`frontend/web`
into it. Do the same with
`backend/web`
moving
its contents into
`www/admin`
. In each case you need to adjust paths in
`index.php`
and
`index-test.php`
.
### Separate sessions and cookies
Originally backend and frontend are intended to run at different domains. When we're moving it all to the same domain it
is starting to share the same cookies creating a clash. It order to fix it adjust backend application config
`backend/config/main.php`
like the following:
```
php
'components'
=>
[
'request'
=>
[
'csrfParam'
=>
'_backendCSRF'
,
'csrfCookie'
=>
[
'httpOnly'
=>
true
,
'path'
=>
'/admin'
,
],
],
'user'
=>
[
'identityCookie'
=>
[
'name'
=>
'_backendIdentity'
,
'path'
=>
'/admin'
,
'httpOnly'
=>
true
,
],
],
'session'
=>
[
'name'
=>
'BACKENDSESSID'
,
'cookieParams'
=>
[
'path'
=>
'/admin'
,
],
],
],
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment