1. We go to the VestaCP control panel at http://you_ip_adress:8083/
    2. Create a domain in the VestaCP control panel.
    3. We connect to the server via SSH (instructions for connecting using the SSH protocol here) and go to the site directory:
    (where instead of is your site).
        4. We execute the command:
    rm -f index.html && rm -f robots.txt
    Installing Yii2 via Composer.
        1. Next, install Composer:
    curl -sS | php
    mv composer.phar /usr/local/bin/composer
        2. Now you need to go to the directory of your site, in our case it is:
    cd /home/admin/web/
        3. Now install Yii with the following command:
    composer create-project --prefer-dist yiisoft/yii2-app-basic public_html/ 
        4. We agree with all the conditions (enter yes and y twice)
        5. Next, issue admin rights for the public_html directory
    chown -R admin:admin /home/admin/web/
        6. Then we edit the domain and add a self-signed certificate for a while
        7. Now open the browser and in the address bar of the browser enter: where instead of is the name of your site.
    Done, Yii2 is installed, if you still don't see the "Congratulations!" then go to the following address and check what is missing for Yii2 to work. on the server you will probably want to change the application URL
    from to or just
    To do this, you need to edit httpd.conf and nginx.conf as follows:
    vim /home/admin/conf/web/ and add web in the places indicated in the screenshot, and comment the line php_admin_value open_basedir:
    vim /home/admin/conf/web/ and add web in the location shown in the screenshot:
    To save the changes, you need to restart the services:
    service httpd restart
    service nginx restart
    Now your site opens by domain without unnecessary paths, pleasant work :)