R
R
Ruslan Absalyamov2018-02-10 14:04:26
linux
Ruslan Absalyamov, 2018-02-10 14:04:26

How to set up yii2 on linux?

I can't get the site to output from the yii2 framework. I approximately implemented a virtual host for yii2 following the action The yii2 project itself is located in the /var/www/html/trainingYii. It's just a symbolic link. Then I created a file in the directory /etc/apache2/sites-available/yii2-app.confand wrote in it

<VirtualHost *:80>
        ServerName yii2-app
        ServerAdmin [email protected]
        DocumentRoot /var/www/html/trainingYii

         <Directory /var/www/html/trainingYii>
        Options Indexes FollowSymlinks
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

        ErrorLog /var/www/yii2-app/logs/error.log
        CustomLog /var/www/yii2-app/logs/access.log combined
</VirtualHost>

And make a symbolic link
sudo ln -s /etc/apache2/sites-available/yii2-app.conf /etc/apache2/sites-enabled/yii2-app.conf
I get a link and then I /etc/hostsentered in 127.0.0.1 yii2-appAnd then I rebooted apache2 and got this answer
[email protected]:/etc/apache2/sites-available$ sudo service apache2 restart
Job for apache2.service failed because the control process exited with error code.
See "systemctl status apache2.service" and "journalctl -xe" for details.

Looked in the logs what is the reason
[Sat Feb 10 12:52:58.622686 2018] [mpm_prefork:notice] [pid 7009] AH00169: caught SIGTERM, shutting down

How can I make a virtual host for yii2?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-02-10
@rusline18

Good afternoon.
Why make a symbolic link?
You need to disable the old configuration and connect your own.
This is done by commands in the console

a2dissite name_file.conf
a2ensite name_file.conf

In hosts, just leave it by default. 127.0.0.1 localhost
Inside the yii2-app.conf file, copy the default.conf configuration (or whatever you call this file) and replace the paths with your own.
When finished, reload apache2.
ps Your problem has nothing to do with yii2.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question