В clg.localhost/
я получаю сообщение об ошибке:Apache - У вас нет разрешения на доступ/на этом сервере
You don't have permission to access/on this server.
Но, следуя this, я создал свой Apache httpd.conf
и sites.conf
разрешить доступ с AllowOverride all
и Require all granted
. Что еще мне не хватает?
Версии:
$ /usr/sbin/httpd -v
Server version: Apache/2.4.23 (Unix)
Server built: Aug 8 2016 18:10:45
Apache httpd.conf:
DocumentRoot "/Users/danniu/Sites"
<Directory "/Users/danniu/Sites">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.4/mod/core.html#options
# for more information.
#
Options FollowSymLinks Multiviews
MultiviewsMatch Any
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
Require all granted
</Directory>
...
#
# Deny access to the entirety of your server's filesystem. You must
# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
AllowOverride all
Require all granted
</Directory>
Apache sites.conf:
# Workaround for missing Authorization header under CGI/FastCGI Apache:
<IfModule setenvif_module>
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
</IfModule>
# Serve ~/Sites at http://localhost
ServerName localhost
<VirtualHost *:80>
ServerName clg.localhost
DocumentRoot /Users/danniu/Sites/CLG/CLG-dev
</VirtualHost>
Я думал, что, возможно, httpd.conf
не был должным образом подхватили, так Я указал корень непосредственно в виртуальном хосте, с той же проблемой.
<VirtualHost *:80>
ServerName clg.localhost
DocumentRoot /Users/danniu/Sites/CLG/CLG-dev
# Set access permission
<Directory "/Users/danniu/Sites/CLG/CLG-dev">
Require all granted
</Directory>
</VirtualHost>
Проверьте, есть ли файл, соответствующий типу документа по умолчанию, в корневом каталоге '/ Users/danniu/Sites/CLG/CLG-dev', например' index.html', 'default.htm', и проверьте, t удалите эту настройку из конфигурации apache. –
@KraangPrime это 'index.php'. Он все равно должен забрать «индекс», верно? Если нет, как я могу указать его как php-файл? И какая настройка в конфигурации apache вы говорите? – Growler
Настройка в конфигурации apache - «DirectoryIndex». Например: 'DirectoryIndex index.php default.php index.htm default.htm index.html default.html index.phps'. Что касается запуска php-файла - убедитесь, что он может отображать только простые html-файлы перед началом работы. Я предполагаю, что у вас установлен php, и модуль связан/загружен правильно. –