Синтаксическая ошибка Apache2, нет доступа к 000-по умолчанию

Я использовал Apache2 и Webmin с моей Raspberry Pi. После перезапуска и переустановки Apache не запустится.

> sudo /etc/init.d/apache2 restart
apache2: Syntax error on line 268 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/sites-enabled/000-default: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
failed!

Файл 000-default и неоткрытые разрешения для root-root. Мой файл apache2.conf выглядит так (нижняя половина):

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog ${APACHE_LOG_DIR}/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel debug

# Include module configuration:
Include mods-enabled/*.load
Include mods-enabled/*.conf

# Include list of ports to listen on and which to use for name based vhosts
Include ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

# Include of directories ignores editors' and dpkg's backup files,
# see the comments above for details.

# Include generic snippets of statements
Include conf.d/

# Include the virtual host configurations:
Include sites-enabled/
<VirtualHost *:80>
DocumentRoot /var/www
<Directory /var/www>
allow from all
Options +Indexes
</Directory>
ServerName IMASERVER
</VirtualHost>

Кто-нибудь знает, что является причиной этого?

4
задан 12 June 2014 в 10:09

1 ответ

Во-первых, наличие VirtualHost (s) внутри файла конфигурации является плохим ходом, (я даже не уверен, что это возможно), вся идея сайтов с поддержкой заключается в том, чтобы ваши VirtualHosts были в разных файлах в этой папке, и используйте

a2ensite default
a2dissite 000-default

С учетом сказанного, вы можете попробовать удалить VirtualHost-блок из вашего конфигурационного файла и сделать (или отредактировать) файл по умолчанию для сайтов с поддержкой. Убедитесь, что вы перезапустите apache.

Я предполагаю, что вы разместили файл /<some-dir>/apache2/apache2.conf

Однако файл, который вы разместили выше, не похож на файлы конфигурации, которые я видел для apache. Не могу помочь тебе в этом.

0
ответ дан 12 June 2014 в 10:09

Другие вопросы по тегам:

Похожие вопросы: