R
R
Ruslan Absalyamov2019-08-11 18:44:39
Yii
Ruslan Absalyamov, 2019-08-11 18:44:39

How to use yii2-docker?

I use from the ready solution https://github.com/yiisoft/yii2-docker. Which is described here https://www.yiiframework.com/doc/guide/2.0/en/tuto... But apache works, only one problem for me is that it pops up a 403 error You don't have permission to access / on this server . When I try to open the link localhost:8000
Only of all I changed files in apache php/image-files/etc/apache2/sites-available/000-default.conf.
DocumentRoot /app/frontend/webI changed it to different directories, it didn’t work out in any way
and added .htaccess to the root of the site.

Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on

# Добавляем другой запрос /frontend/web/$1
RewriteCond %{REQUEST_URI} !^/(frontend/web|backend/web|administrator)
RewriteRule (.*) /frontend/web/$1

# Если frontend запрос
RewriteCond %{REQUEST_URI} ^/frontend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /frontend/web/index.php

# Если backend запрос
RewriteCond %{REQUEST_URI} ^/backend/web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /backend/web/index.php

Project initialized.
But at the same time, in the docker logs it is written
php_1  | [Sun Aug 11 15:37:16.054024 2019] [authz_core:error] [pid 29] [client 172.24.0.1:48926] AH01630: client denied by server configuration: /app/frontend
php_1  | [Sun Aug 11 15:37:16.168644 2019] [authz_core:error] [pid 29] [client 172.24.0.1:48926] AH01630: client denied by server configuration: /app/frontend, referer: http://localhost:8000/frontend/web/
php_1  | 172.24.0.1 - - [11/Aug/2019:15:37:16 +0000] "GET /favicon.ico HTTP/1.1" 403 513 "http://localhost:8000/frontend/web/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"

What should I do to make the site work?
5d5037c90ad53828107868.png
Here are some directories from the root of the site. Not all folders but those that are needed

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question