に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
が正しくので、ピックアップされていなかったかもしれないと思いました私は同じ問題で、仮想ホストに直接ルートを指定しました。あなたは、インデックスファイルはindex.htmlなどのDirectoryIndex、と指されていない、とあなたはインデックスが有効になっていないので、もし
<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'のようなデフォルトのドキュメントタイプに合ったファイルがあるかどうかチェックし、その設定をapache configから削除しないでください。 –
@KraangPrimeそれは 'index.php'です。しかし、まだ 'index'をピックアップするべきでしょうか?そうでなければ、どうすればphpファイルとして指定できますか?そして、Apache設定のどの設定について話していますか? – Growler
Apache設定の設定は 'DirectoryIndex'です。例: 'DirectoryIndex index.php default.php index.htm default.htm index.html default.html index.phps'。 phpファイルを実行する場合、手元にある単純なHTMLファイルを表示できることを確認します。 PHPがインストールされており、モジュールがリンクされている/適切に読み込まれていると仮定します。 –