Показать статистику
0 голосов
от (340 баллов)

Я создал новый VirtualHost по аналогии с ранее нормально работающими хостами.

Установил Yii2 basic.

Добавил все нужные .htaccess.

Сделал все настройки 'UrlManager'

Написал главную страницу,

Проблема в том, что после того, как создал первую внутреннюю страницу, обнаружил, что при переходе по любой внутренней линке срабатывает только роутинг 'site/index'

Apache работает на Ubunte 16.04

Вот мой VirtualHost:

<VirtualHost *:80>
ServerName blog.loc
ServerAlias www.blog.loc
ServerAdmin webmaster@localhost
DocumentRoot /var/www/blog.loc/public_html
<Directory /var/www/blog.loc/public_html>
    AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Вот мой apache2.conf:

# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
# default Apache2 installation attempts to make adding and removing modules,
# virtual hosts, and extra configuration directives as flexible as possible, in
# order to make automating the changes and administering the server as easy as
# possible.
# It is split into several files forming the configuration hierarchy outlined
# below, all located in the /etc/apache2/ directory:
#
# /etc/apache2/
# |-- apache2.conf
# | `--  ports.conf
# |-- mods-enabled
# | |-- *.load
# | `-- *.conf
# |-- conf-enabled
# | `-- *.conf
# `-- sites-enabled
# `-- *.conf
#
#
# * apache2.conf is the main configuration file (this file). It puts the pieces
#   together by including all remaining configuration files when starting up the
#   web server.
#
# * ports.conf is always included from the main configuration file. It is
#   supposed to determine listening ports for incoming connections which can be
#   customized anytime.
#
# * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
#   directories contain particular configuration snippets which manage modules,
#   global configuration fragments, or virtual host configurations,
#   respectively.
#
#   They are activated by symlinking available configuration files from their
#   respective *-available/ counterparts. These should be managed by using our
#   helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
#   their respective man pages for detailed information.
#
# * The binary is called apache2. Due to the use of environment variables, in
#   the default configuration, apache2 needs to be started/stopped with
#   /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
#   work with the default configuration.
355 просмотров 1 ответов
от (17.4тыс. баллов)
0

С синтаксисом конфигурационного файла все в порядке?

Выполните:

apachectl configtest

Результат - в студию.

1 Ответ

0 голосов
от (460 баллов)
Здравствуйте. А вы случайно не забыли дополнить файл /etc/hosts?
...