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