macOSでhttpd.confを編集してApacheを立ち上げるとForbidden応答が返ってくる
まず当方のシステム環境です。
macOS Sierra
Apache: 2.4.25 (Unix)
mysql: stable 5.7.19
サーバーを立ち上げ、
http://localhost/
へアクセスするも、
Forbidden You don't have permission to access / on this server.
エラーログは、
Cannot serve directory /users/ユーザー名/Sites/:
No matching DirectoryIndex (index.php,index.html,index.html,index.php)found,
and server-generated directory index forbidden by Options directive
httpd.conf(変更点)
# LoadModule userdir_module libexec/apache2/mod_userdir.so #コメントアウト
# LoadModule alias_module libexec/apache2/mod_alias.so #コメントアウト
# LoadModule rewrite_module libexec/apache2/mod_rewrite.so #コメントアウト
# LoadModule php5_module libexec/apache2/libphp5.so #コメントアウト
DocumentRoot "/users/ユーザー名/Sites/"
<Directory "/users/ユーザー名/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
Include /private/etc/apache2/extra/httpd-userdir.conf #コメントアウト
ユーザ名.confも作成し、
/apache2/users/ユーザ名
<Directory "/Users/ユーザ名/Sites/">
AllowOverride All
Options Indexes MultiViews
Options +FollowSymLinks
Require all granted
</Directory>
として入れてあります。
未熟な私に解決方法をご教授ください。
よろしくお願いいたします。