teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

記事を見て設定した内容と各バージョンについて追記しました

2019/02/27 04:15

投稿

Fukada
Fukada

スコア13

title CHANGED
File without changes
body CHANGED
@@ -2,4 +2,78 @@
2
2
  apacheは起動しているのですがlocalhost自体接続できません
3
3
  [https://qiita.com/haneri/items/7110ce24e74f9566de8b](https://qiita.com/haneri/items/7110ce24e74f9566de8b)を見て
4
4
  httpd.confの設定とhttpd-vhosts.confの設定をしました。
5
- よろしければご教授お願いいたします。
5
+ よろしければご教授お願いいたします。
6
+
7
+ ---------------------------------------------------
8
+ 追記
9
+
10
+ 記事を見て変更した箇所
11
+
12
+ httpd.conf
13
+ ```
14
+ #LoadModule include_module libexec/apache2/mod_include.so
15
+ #LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
16
+ #LoadModule userdir_module libexec/apache2/mod_userdir.so
17
+ #LoadModule rewrite_module libexec/apache2/mod_rewrite.so
18
+ #LoadModule php5_module libexec/apache2/libphp5.so
19
+ ```のコメントアウトを外す
20
+ ```
21
+ AllowOverride none
22
+ Require all denied
23
+
24
+ AllowOverride all
25
+ Require all granted
26
+ ```と書き換える
27
+ ```
28
+ Options FollowSymLinks Multiviews
29
+
30
+ Options FollowSymLinks Multiviews Indexes Includes
31
+ ```を追記
32
+ ```
33
+ #AddType text/html .shtml
34
+ #AddOutputFilter INCLUDES .shtml
35
+
36
+ AddType text/html .shtml
37
+ AddOutputFilter INCLUDES .shtml .html
38
+ ```コメントアウトを外し追記
39
+ ```
40
+ #Include /private/etc/apache2/extra/httpd-userdir.conf
41
+ #Include /private/etc/apache2/extra/httpd-vhosts.conf
42
+
43
+ Include /private/etc/apache2/extra/httpd-userdir.conf
44
+ Include /private/etc/apache2/extra/httpd-vhosts.conf
45
+ ```コメントアウトを外す
46
+
47
+ httpd-userdirの設定
48
+
49
+ ```
50
+ <VirtualHost *:80>
51
+ DocumentRoot "/Users/laz/Sites/index.html"
52
+ ServerName {yourservername}
53
+ <Directory "/Users/laz/Sites/index.html">
54
+ Require all granted
55
+ DirectoryIndex index.html
56
+ Options Includes
57
+ </Directory>
58
+ </VirtualHost>
59
+ ```を行末に追記
60
+
61
+ ホームにSitesというディレクトリを作成して以下の内容でlaz.confを作成(lazは私のユーザーネームです)
62
+ ```
63
+ <Directory "/Users/laz/Sites">
64
+ AddType text/html .shtml .html
65
+ AddHandler server-parsed .shtml .html
66
+ Options Indexes MultiViews FollowSymlinks Includes
67
+ AllowOverride all
68
+ Require all granted
69
+ </Directory>
70
+ ```
71
+
72
+ php,mysqlに関しては```brew install```を使用しました。
73
+ バージョンは
74
+ php:7.1.23
75
+ mysql:8.0.12
76
+
77
+ phpMyAdminは[https://www.phpmyadmin.net](https://www.phpmyadmin.net)より最新の4.8.5をダウンロードしました。
78
+
79
+ mysqlはターミナルからの接続はできました。