Yii Framework Forum: Yii2 advanced on shared hosting - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yii2 advanced on shared hosting

#1 User is offline   taskas 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 28-October 10

Posted 28 October 2014 - 01:12 PM

Hello,
I like the structure of yii2-advanced, the seperation of frontend/backend/common and such. But problem is that in order to correctly deploy it, you need specific configuration of the server. And I have only shared hosting for now. I tried "yii2-practical" app, but there are still doubts about it's structure. I wanted to ask if the idea I have is very stupid or not.
I thought about such structure

backend/
controllers/
views/
models/

frontend/
controllers/
models/
views/
web/
index.php (with css, js, assets folders etc)
backend/
web/ (and move backend entry script with assets here)



Or should I stick with basic template and make backend as a module, like good old Yii1 style? Or just use htaccess to route backend/* to backend? But i would like not to have vendors and other folders in reachable location.
0

#2 User is offline   waitforit 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 479
  • Joined: 09-February 11

Posted 28 October 2014 - 03:20 PM

You can't really do the advanced app on a shared host since you can only set a single DocumentRoot.
0

#3 User is offline   samdark 

  • Having fun
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,224
  • Joined: 17-January 09
  • Location:Russia

Posted 28 October 2014 - 04:23 PM

There are workarounds but these are a bit tricky because of renaming CSRF and remember me cookies in order to prevent collisions.
Yii 2.0 Development Cookbook

Enjoying Yii? Star us at github

Support me so I can work more on Yii: https://www.patreon.com/samdark
0

#4 User is offline   artificial 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 130
  • Joined: 11-December 10
  • Location:Sydney, Australia

Posted 28 October 2014 - 05:22 PM

You can set up your own virtual environment for less than $10/mo. I really can't see the benefit of shared hosting.
Alex Berriman
www.formcorp.com.au
0

#5 User is offline   taskas 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 28-October 10

Posted 29 October 2014 - 02:42 AM

Thank you guys for your input! For not having virtual environments - well, it's sometimes not developer's but client's decision. Lets stick with that - let's say, we cannot have two document roots.
Samdark mentioned about workarounds, "hacks"(CSRF and cookies). Are there any other things to consider? I found this article in documentation: http://www.yiiframew...ed-hosting.html but sadly the subject i'm talking about is not written.
Or maybe it's still better to have let's say all "backend" with it's modules as a module in "yii2-basic" application? But it's a bit "nasty" in my opinion.
0

#6 User is offline   oliverussell 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 6
  • Joined: 14-March 16
  • Location:Dallas, United States

Posted 26 December 2017 - 07:05 AM

I would recommend you to use vps for hosting your Yii app. It is much better than shared hosting. You will get better performance and security because of dedicated server. If you don't have sysadmin skills to setup a server from scratch, then you can use Cloudways Yii hosting platform for that. Using this platform, you can instantly launch a server without have to manually install OS, stack or PHP.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users