Yii 2 Advanced Project Template with Deployer.php support
Yii 2 Advanced Project Template with Deployer.php support is a skeleton Yii 2 application for developing complex Web applications with multiple tiers.
The template includes three tiers: front end, back end, and console, each of which is a separate Yii application.
The template is designed to work in a team development environment. It supports deploying the application in different environments.
Documentation is at docs/guide/README.md.
- This project can be deployed by Deployer
.htaccessis added to the
backend/webfolders and FollowSymlinks is turned on.
- Init script has been removed because Deployer configures the project according to the values in
See my blog post Deploying Yii with Deployer
See also yii2-app-basic-deployer
The minimum requirement by this project template that your Web server supports PHP 5.4.0.
mv deployer.phar /usr/local/bin/dep chmod +x /usr/local/bin/dep
For more, see Deployer - Installation
You can then install this project template using the following command:
php composer.phar global require "fxp/composer-asset-plugin:~1.1.1" php composer.phar create-project --prefer-dist --stability=dev jacmoe/yii2-app-advanced-deployer advanced
First, create a file entitled
servers.yml in the
You can copy the contents of
servers-sample.yml to get you started.
Prior to deployment, make sure that you have created a database on the server you want to deploy to.
When you have created a server configuration file, all you need to do is run this command:
dep deploy production
dep deploy local
Note that the server configuration for the local stage needs to have a key called
local because that will make Deployer create a local server that doesn't use ssh.
If the active stage does not have local set for the server, you need an ssh server on your local machine (
sudo apt-get install openssh-server).
It is very common to serve the project in place when developing, and therefore this project template ships with a function to configure files, set writable directories and install vendors.
dep inplace local
This command assumes that you've set the deploy dir in the
servers.yml configuration file to point to your current source directory (the directory you are in).