Find us on facebook

Jul 3, 2015

Setup SVN server on ubuntu 14.04

Start the installation .
Step 1 : Update the repositories.
sudo apt-get update

Step 2 : Install SVN and apache webserver (To access SVN through http ) .
sudo apt-get install subversion apache2 libapache2-svn apache2-utils

Step 3 » Create a directory and create a new repository in that directory ( testrepo is the repository name ).
sudo mkdir -p /svn/repos/
sudo svnadmin create /svn/repos/testrepo

Step 4 » Change ownership for the repository.
sudo chown -R www-data:www-data /svn/repos/testrepo

Step 5 » Create a file testrepo.conf in /etc/apache2/sites-available/ and add the below lines for creating apache virtual host.
<Location /svn>
  DAV svn
  SVNParentPath /svn/repos/
  AuthType Basic
  AuthName "Test Repo"
  AuthUserFile /etc/svnpasswd
  Require valid-user
</Location>
SVNParentPath /svn/repos/ : Parent Directory without repository name.
AuthUserFile /etc/svnpasswd : File need to be created ( Step 8) for user details.

Step 6 »Enable the Site ( testrepo in the below command should match the file name created in the previous step )
sudo a2ensite testrepo

Step 7 » Restart or reload apache service.
sudo service apache2 reload

Step 8 » Create user for accessing repository and add the user details to /etc/svnpasswd file.
Use this command to create first user.
sudo htpasswd -cm /etc/svnpasswd user1

Use the same command without c option to create additional users.
sudo htpasswd -m /etc/svnpasswd user2

Step 9 » Access http://yourip/svn/testrepo in your browser ( Eg http://10.0.1.15/svn/testrepo ) and you can see the page like below after successful authentication.

Install Subversion Using Yum CentOS 6.x

yum install mod_dav_svn subversion

sudo vim /etc/httpd/conf.d/subversion.conf

LoadModule dav_svn_module     modules/mod_dav_svn.so
LoadModule authz_svn_module   modules/mod_authz_svn.so

<Location /svn>
   DAV svn
   SVNParentPath /var/www/svn

   # Limit write permission to list of valid users.
   #<LimitExcept GET PROPFIND OPTIONS REPORT>
      # Require SSL connection for password protection.
      # SSLRequireSSL

      AuthType Basic
      AuthName "Subversion repositories"
      AuthUserFile /etc/svn-auth-users
      Require valid-user
   #</LimitExcept>
</Location>

apachectl configtest
sudo service httpd restart

================================
sudo yum install mod_auth_mysql
sudo vi /etc/httpd/conf.d/subversion.conf
    AuthType Basic
    AuthName "svn repository"
    Require valid-user
    AuthMySQLEnable on
    AuthMySQLPwEncryption sha1
    AuthMySQLHost localhost
    AuthMySQLUser username(of redmine)
    AuthMySQLPassword password
    AuthMySQLDB redmine
    AuthMySQLNameField login
    AuthMySQLPasswordField hashed_password
    AuthMySQLUserTable "users"
apachectl configtest
sudo service httpd restart
===============================
Next we have to actually create the password file that you specified in the previous step. Initially you'll use the -cm arguments. This creates the file and also encrypts the password with MD5. If you need to add users make sure you simply use the -m flag, and not the -c after the initial creation.

## Create testuser ##
htpasswd -cm /etc/svn-auth-users testuser
New password:
Re-type new password:
Adding password for user testuser

## Create testuser2 ##
htpasswd -m /etc/svn-auth-users testuser2
New password:
Re-type new password:
Adding password for user testuser2

mkdir /var/www/svn
cd /var/www/svn

sudo chown -R apache:apache /var/www/svn

svnadmin create testrepo
sudo chown -R apache.apache testrepo

## If you have SELinux enabled (you can check it with "sestatus" command) ##
## then change SELinux security context with chcon command ##

chcon -R -t httpd_sys_content_t /var/www/svn/testrepo

## Following enables commits over http ##
chcon -R -t httpd_sys_rw_content_t /var/www/svn/testrepo

## Fedora 21/20/19/18 and CentOS/Red Hat (RHEL) 7 ##
systemctl restart httpd.service

## CentOS/Red Hat (RHEL) 6.6/5.11 ##
service httpd restart
## OR ##
/etc/init.d/httpd restart

Goto http://localhost/svn/testrepo address and you should see popup to enter username and password:

Then Configure repository
To disable anonymous access and enable access control add following rows to testrepo/conf/svnserve.conf file:

## Disable anonymous access ##
anon-access = none

## Enable access control ##
authz-db = authz

Create trunk, branches and tags structure under testrepo
Create “template” directories with following command:
mkdir -p /tmp/svn-structure-template/{trunk,branches,tags}

Then import template to project repository using “svn import” command:
Shell

svn import -m 'Initial import' /tmp/svn-structure-template/ http://localhost/svn/testrepo/
Adding         /tmp/svn-structure-template/trunk
Adding         /tmp/svn-structure-template/branches
Adding         /tmp/svn-structure-template/tags

Committed revision 1.

Import online project to SVN folder
svn import /var/www/vhosts/xxx.cf/httpdocs/yyy http://xx.xxx.xxx.xx/svn/testrepo2 -m "first import"

Go to domain/httpdocs and use following command to get first repo to this folder
svn co http://88.208.221.72/svn/testrepo2

After each commit, to update online site,
Go to domain/httpdocs and use following command
svn co http://88.208.221.72/svn/testrepo2

Jul 2, 2015

Install VSFTP in CentOS 6

Check what ports are standard for a given service
cat /etc/services | grep ftp

View running service
netstat -antlp | grep ftp

Install vsftpd on your virtual private server in the command line:
sudo yum install vsftpd

Install the FTP client, so that we can connect to an FTP server:
sudo yum install ftp

Open up the configuration file:

sudo vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO (vsftpd will not allow anonymous, unidentified users to access the VPS's files)

local_enable=YES

chroot_local_user=YES (all the local users will be within their chroot and will be denied access to any other part of the server.)

Add following lines to end of the file
pasv_enable=YES
pasv_min_port=64000
pasv_max_port=64321
port_enable=YES

Restart vsftpd:
sudo service vsftpd restart

To vsftpd runs at boot, run chkconfig:
chkconfig vsftpd on


Jul 1, 2015

Configure BitBucket Git Repository in Eclipse Environment. Git version control with Eclipse (EGit)

Open Eclipse
Click on Help menu
Click Install New Software

Install eGit into Eclipse. Git version control with Eclipse (EGit)
URL: http://download.eclipse.org/egit/updates


Click Add


Give a name and click OK


Click Next.

After install Go to Window->Open perspective->Other 


Select Git and click OK.

Then Clone a Git repo


OR





Click next. 


Select the branches you want and click next


Browse the directory you want to setup the project and click finish.

Go to Window->Open perspective->Other and select resource

Click OK

Go to 
‘File’ > ‘Import’ > ‘Git’ > ‘Projects from Git’ > ‘Existing local repository’ > ‘Select a Git Repository’ >
‘Import as General Project’ >
‘Next’ >
‘Finish’
The code should then appear in your ‘Project Explorer’ window as a normal project
Now make changes to your file as you want
Look at ‘Git Staging’ view to see your changed files and Click ‘Commit and Push‘




That's all...





FTP Connection refused error

Verify that ftp server installed:

Debian Linux
$ dpkg -l | grep -i "ftp"
Output:
ii  ftpd                           0.17-21                       FTP server

OR:
$ dpkg -l | grep -i ftp

Red Hat/Novell Suse/Fedora Linux:
# rpm -qa | grep -i "*ftp*"

If you have the ftp package installed it will return output. If the ftp package is not installed, it will notify or not give any output. If not installed, Install FTP server.

Red Hat/Fedora Linux install vsftpd server :
# up2date vsftpd

Fedora Linux:
# yum install vsftpd

Debian Linux:
# apt-get install vsftpd

Next configure vsftpd by modifying /etc/vsftpd.conf file.

Is ftp server running (is port 21 open)?
Login to server using ssh and telnet port 21 (to see port is open or not):
$ telnet localhost 21

Next run netstat -tulpn command to see if port 21 is in open:
$ netstat -tulpn | grep :21

Output:
tcp        0      0 0.0.0.0:21             0.0.0.0:*               LISTEN

OR :
$ netstat -a | grep ftp
Output:
tcp        0      0 *:ftp                   *:*                     LISTEN

If port is not open, start ftp server /service.
RedHat/Fedora Linux :
# service vsftpd start

Debian Linux:
# /etc/init.d/vsftpd start

FTP user permissions
File /etc/ftpusers - list of users disallowed use vsftpd server access.

Security or Firewall
Check iptables firewall/tcpd does not block access to ftp server. Run following command on ftp server
# iptables -L -n

Use iptables rules to open port 21. Make sure file /etc/hosts.deny (TCPD wrappers) does not block access to port 21 for your ftp host.

Disable Telnet in CentOS

Telnet is un secure network protocol.It sends clear text passwords over network. Its highly recommended to disable it on any public server and use ssh server instead.


  1. sudo nano /etc/xinetd.d/telnet
  2. disable = yes
  3. CTRL+O (to save) and CTRL+X (to exit)
  4. Now disable it in chkconfig: chkconfig telnet off
  5. /etc/rc.d/init.d/xinetd restart  |  /etc/rc.d/init.d/xinetd stop

Setup virtual host in any location

Step 1: Go to "C:/Windows/System32/drivers/etc" and open the "hosts" file in Notepad.

Step 2: At the bottom of the hosts file, below all the other text, add a new line with the following:
127.0.0.1   mysite.local    #My Test Site

Step 3: Open "httpd.conf" in "C:/wamp/bin/apache/Apache2.2.21/conf/"

Step 4: under "# Virtual hosts", uncomment (remove the hashtag [#]) before the line "Include conf/extra/httpd-vhosts.conf"

Step 5 : Go to "C:/wamp/bin/apache/Apache2.2.21/conf/extra" and open the file "httpd.vhosts.conf".
<Directory D:/Projects>
Require all granted
</Directory>
 <VirtualHost *:80>  
DocumentRoot "D:\Projects\skwirk"
ServerName skwirk.ml

</VirtualHost>

Jun 30, 2015

Setup Chef Server


View Ubuntu version details - cat /etc/lsb-release

chef-solo -v
Install chef - curl -L https://www.opscode.com/chef/install.sh | sudo bash

check version - chef-solo -v

make configuration file 
cd /etc/
sudo mkdir chef
In etc/chef create file solo.rb
sudo vi solo.rb

repo = '/etc/chef/src'

cookbook_path repo + '/cookbooks'
data_bag_path repo + '/data_bags'
role_path repo + '/roles'

log_level :info
log_location STDOUT


Press esc to go to normal mode and :x or :wq to save and exit
sudo mkdir src
go to src
cd src
cat ../solo.rb


sudo mkdir cookbooks data_bags roles
cookbooks - contain bunch of recipes
within cookbooks create directory called common and go inside it
create recipes directory and create sudo vi default.rb
directory '/root' do
 user 'root'
 group 'root'
 mode '0700'
end
Save and exit


Create run list to run the default recipes with command - sudo chef-solo -o 'recipe[common]'
change the mode - sudo chmod 0770 /root
Again run the default recipes with command - sudo chef-solo -o 'recipe[common]'


Jun 29, 2015

Setting up a cron in AWS Linux/Ubuntu


  1. Login to server using SSH (Windows users PuTTY)
  2. sudo crontab -l
  3. sudo crontab -e
  4. Linux : Open vim editor and allow to enter commands
  5. Ubuntu : For the first time it asks which editor to use (nano is easy)
  6. Enter following commands and save the file

MAILTO=yyy@gmail.com
*/5 * * * * /usr/bin/wget http://yyy.com/mail201506/index.php >/dev/null

>/dev/null
Send all the normal output to a place called "/dev/null" which is basically like a black hole. It accepts anything you dump there, but you will never see it again.

Jun 28, 2015

CentOS6.6 MySql Login with admin password


  1. cat /etc/psa/.psa.shadow
  2. Display Eg : "$AES-128-CBC$33yZTimLYQFax/iFgiQGkQ==$gqGlImLkTalp26cDeS3C9g=="
  3. mysql -u admin -p
  4. When say Enter Password: Just enter above displayed password. And hit Enter.

Plesk 12 Login error after changing MySql Password -Resolved


  1. old-passwords = 1 should be disabled in the /etc/my.cnf file.
  2. Obtain the correct Plesk password: cat /etc/psa/.psa.shadow ($AES-128-CBC$33yZTimLYQFax/iFgiQGkQ==$gqGlImLkTalp26cDeS3C9g==)
  3. sudo /etc/init.d/mysqld stop
  4. sudo mysqld_safe --skip-grant-tables &
  5. mysql -u admin
  6. update mysql.user set password=PASSWORD("$AES-128-CBC$33yZTimLYQFax/iFgiQGkQ==$gqGlImLkTalp26cDeS3C9g==") where User='admin';
  7. flush privileges;
  8. sudo /etc/init.d/mysqld stop
  9. sudo /etc/init.d/mysqld start
Update the password for Plesk using the ch_admin_passwd utility:
  1. /usr/local/psa/bin/admin --show-password
  2. export PSA_PASSWORD=Abe3s3
  3. /usr/local/psa/admin/bin/ch_admin_passwd

Jun 21, 2015

server API calls with AngularJS - yii2 (Part 2)

assets/AppAsset.php


web/js/services.js


web/js/controllers.js


Angular JS with Yii2

assets/AppAsset.php


assets/AngularAsset.php


web/js/app.js


web/js/controllers.js

view file


Jun 17, 2015

Send emails using SMTP Yii 2.0

In your controller
Yii::$app->mail->compose()->setFrom('yyy@gmail.com')->setTo('sss@gmail.com')->setSubject('Email sent from Yii2-Swiftmailer')->send();

In common/config/main-local.php
 In components array
 'mail' => [
        'class' => 'yii\swiftmailer\Mailer',
        'transport' => [
        'class' => 'Swift_SmtpTransport',
        'host' => 'smtp.gmail.com',  // e.g. smtp.mandrillapp.com or smtp.gmail.com
        'username' => 'ttt@gmail.com',
        'password' => 'ggg',
        'port' => '587', // Port 25 is a very common port too
        'encryption' => 'tls', // It is often used, check your provider or mail server specs
        ],
        ],

Jun 16, 2015

Selecting data using JDatabase

Select query
Method 1 : 
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('fname', 'lname')));
$query->from($db->quoteName('#__students'));
$db->setQuery($query);
$row = $db->loadAssocList();

Method 2 : 
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName(array('fname', 'lname')));
$query->from($db->quoteName('#__students'));
$db->setQuery($query);
$row = $db->loadRowList();
return $row[0][0];

Access individual values:

Method 1 
echo  $row[1]['lname'];

Method 2 : 
echo  $row[1][1];


Creating a table on module install

Step 1 : mod_students.php

<?php
/**
 * Students Name Module Entry Point
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link http://docs.joomla.org/J2.5:Creating_a_simple_module/Developing_a_Basic_Module
 * @license        GNU/GPL, see LICENSE.php
 * mod_students is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */

// No direct access
defined('_JEXEC' ) or die;

// Include the syndicate functions only once
require_once dirname(__FILE__) . '/helper.php';

$studentName = modStudentsHelper::getStudentNames($params);
require(JModuleHelper::getLayoutPath('mod_students'));
?>

Step 2 : helper.php

<?php
/**
 * Helper class for Students module
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link docs.joomla.org/J2.5:Creating_a_simple_module/Developing_a_Basic_Module
 * @license        GNU/GPL, see LICENSE.php
 * mod_students is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
class ModStudentsHelper
{
    /**
     * Retrieves the hello message
     *
     * @param array $params An object containing the module parameters
     * @access public
     */  
    public static function getStudentNames( $params )
    {
        // Obtain a database connection
$db = JFactory::getDbo();
// Retrieve the shout
$query = $db->getQuery(true)
->select($db->quoteName('fname'))
->from($db->quoteName('#__students'))
->where('lang = ' . $db->Quote('en-GB'));
// Prepare the query
$db->setQuery($query);
// Load the row.
$result = $db->loadResult();
// Return the Hello
return $result;
    }
}
?>

Step 3 : mod_students.xml

<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="2.5.0" client="site" method="upgrade">
    <name>Student Names</name>
    <author>Ishara</author>
    <version>1.0.0</version>
    <description>Display Student Names module.</description>
    <files>
        <filename>mod_students.xml</filename>
        <filename module="mod_students">mod_students.php</filename>
        <filename>index.html</filename>
        <filename>helper.php</filename>
        <filename>tmpl/default.php</filename>
        <filename>tmpl/index.html</filename>
<filename>sql/install.mysql.utf8.sql</filename>
<filename>sql/uninstall.mysql.utf8.sql</filename>
    </files>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
</sql>
</uninstall>

<config>
    </config>
</extension>

Step 4: sql/install.mysql.utf8.sql

CREATE TABLE IF NOT EXISTS `#__students` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`fname` varchar(25) NOT NULL,
`lname` varchar(25) NOT NULL,

  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;

INSERT INTO `#__students` (`fname`, `lname`) VALUES ('Derick', 'Cristo');
INSERT INTO `#__students` (`fname`, `lname`) VALUES ('Ruchi', 'Doe');
INSERT INTO `#__students` (`fname`, `lname`) VALUES ('Brunila', 'Cristine');

Step 5: sql/uninstall.mysql.utf8.sql

DROP TABLE IF EXISTS `#__students`

Step 6 : tmpl/default.php

<?php
// No direct access
defined('_JEXEC') or die; ?>
<?php echo $studentName; ?>

Create simple module with Joomla 2.5

Step 1: Create folder and name it as mod_helloworld

Step 2: Create folder tmpl under mod_helloworld

Step 3: Create mod_helloworld.php under  mod_helloworld

<?php
/**
 * Hello World! Module Entry Point
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link http://docs.joomla.org/J2.5:Creating_a_simple_module/Developing_a_Basic_Module
 * @license        GNU/GPL, see LICENSE.php
 * mod_helloworld is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */

// No direct access
defined('_JEXEC' ) or die;

// Include the syndicate functions only once
require_once dirname(__FILE__) . '/helper.php';

$hello = modHelloWorldHelper::getHello($params);
require(JModuleHelper::getLayoutPath('mod_helloworld'));
?>

Step 4: Create helper.php under  mod_helloworld
<?php
/**
 * Helper class for Hello World! module
 *
 * @package    Joomla.Tutorials
 * @subpackage Modules
 * @link docs.joomla.org/J2.5:Creating_a_simple_module/Developing_a_Basic_Module
 * @license        GNU/GPL, see LICENSE.php
 * mod_helloworld is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 */
class ModHelloWorldHelper
{
    /**
     * Retrieves the hello message
     *
     * @param array $params An object containing the module parameters
     * @access public
     */  
    public static function getHello( $params )
    {
        return 'Hello, World!';
    }
}
?>

Step 5: Create mod_helloworld.xml under  mod_helloworld
<?xml version="1.0" encoding="utf-8"?>
<extension type="module" version="2.5.0" client="site" method="upgrade">
    <name>Hello, World!</name>
    <author>John Doe</author>
    <version>1.0.0</version>
    <description>A simple Hello, World! module.</description>
    <files>
        <filename>mod_helloworld.xml</filename>
        <filename module="mod_helloworld">mod_helloworld.php</filename>
        <filename>index.html</filename>
        <filename>helper.php</filename>
        <filename>tmpl/default.php</filename>
        <filename>tmpl/index.html</filename>
    </files>
    <config>
    </config>
</extension>

Step 6: Create default.php under  mod_helloworld/tmpl
<?php
// No direct access
defined('_JEXEC') or die; ?>
<?php echo $hello; ?>

Step 7: Put  mod_helloworld under joomla/tmp (To install the module)

Step 8 : Go to Extensions->Extension manager

Step 8 : Go to Extensions->Module Manager
Configure module position


Jun 13, 2015

Enable Pretty URL - Yii2 Advanced template

Step 1 : edit common/config/main.php as below
'urlManager' => [
'class' => 'yii\web\UrlManager',
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
],
Step 2 : Add following .htaccess file into backend/web folder

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

Step 3 :Add following .htaccess file into frontend/web folder

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php

Step 4: Add following to apache\apache2.4.9\conf\extra\httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot "D:\Projects\new\yii-application"
ServerName yii2_test.ml
<Directory "D:\Projects\new\yii-application">
        AllowOverride All
    </Directory>
</VirtualHost>

Step 5: Enable mod_rewrite on apache\apache2.4.9\conf\httpd.conf


Configuring RBAC Manager Yii2-Advanced Template

Step 1 : edit common/config/main.php And console/config/main.php  as below
'authManager' => [
            'class' => 'yii\rbac\DbManager',
        ],


Step 2: use the migration stored in @yii/rbac/migrations:

[yii migrate --migrationPath=@yii/rbac/migrations]

Step 3: Install yii2-admin via composer [composer.phar should be within yii-application folder]

1) php composer.phar require mdmsoft/yii2-admin "~2.0" OR
2) add "mdmsoft/yii2-admin": "~2.0" to the require section of your composer.json file[and run composer.phar update].


 Step 4: edit common/config/main.php as below

'modules' => [
        'admin' => [
            'class' => 'mdm\admin\Module',
        ]
],
'as access' => [
        'class' => 'mdm\admin\components\AccessControl',
        'allowActions' => [
            'admin/*', // add or remove allowed actions to this list
        ]
    ],

Now you can access admin panel for creating/editing Roles/Permissions , Assign users to roles etc...
http://localhost/path/to/index.php?r=admin
http://localhost/path/to/index.php?r=admin/route
http://localhost/path/to/index.php?r=admin/permission
http://localhost/path/to/index.php?r=admin/menu
http://localhost/path/to/index.php?r=admin/role
http://localhost/path/to/index.php?r=admin/assignment

Install Yii2 Advanced Application Template via Composer

Step 1 : Create a folder under your web root (Let's say yii2)
Step 2 : Copy the composer.phar file into to yii2
Step 3 : Go to that folder in cmd
Step 4 : Type in cmd [php composer.phar global require "fxp/composer-asset-plugin:1.0.0"]

Step 5 : Type in cmd [php composer.phar create-project --prefer-dist yiisoft/yii2-app-advanced yii-application]
Step 6 : In middle of the process this would ask for a token.

(To get a token, login to your github profile and generate a token. Steps are as below.
Step A : In the top right corner of any page, click your profile photo, then click Settings.

Step B : Personal access tokensIn the user settings sidebar, click Personal access tokens.


Step C : Generate new token buttonClick Generate new token.


Step D : Token description field Give your token a descriptive name.
Step E:  Selecting token scopesSelect the scopes you wish to grant to this token. The default scopes allow you to interact with public and private repositories, user data.
Step F: Generate token buttonClick Generate token.


[Newly created tokenCopy the token to your clipboard. For security reasons, after you navigate off this page, no one will be able to see the token again.]
)
Step 6 :  Copy and paste this token into cmd and hit enter.

Step 7 :  It says token stored successfully. And install all the packages.


Step 8 : Move to the folder that is project created and Run in cmd [php init]

Step 9 : Create a new database in mysql and adjust the components['db'] configuration in common/config/main-local.php accordingly.


Step 10 : Apply migrations with console command yii migrate.

Step 11 : Open yii2-advanced web on browser





Jun 8, 2015

you should configure authmanager option error (When using yii migrate --migrationPath=@yii/rbac/migrations)

yii2-base template: change config/console.php configuration file where the authManager needs to be declared. And change the config/web.php too.
'authManager' => [
    'class' => 'yii\rbac\DbManager',
],

yii2-advanced template: Change console/config/main.php And common/config/main.php

Then run yii migrate --migrationPath=@yii/rbac/migrations command