0
0

Apacheにつながらない(忘備録)

Posted at

Apacheにつながらない

パソコンの移行作業をしている最中のできごとでした。
どのプロジェクトを開いてもエラーでつながらない状態でした。

エラー内容

Forbidden
You don't have permission to access this resource.

結論

C:\xampp\apache\conf\extra\httpd-vhosts.conf
で設定したディレクトリパスが間違っていた。

間違えたパス:C:¥xampp¥htdocs

正しいパス:C:\xampp\htdocs

// 間違い
<VirtualHost localhost:80>
 DocumentRoot ""
 ServerName xxx.com
 <Directory "C:¥xampp¥htdocs">
  AllowOverride All
  Options All
  Require all granted
 </Directory>
</VirtualHost>
// 正しい
<VirtualHost localhost:80>
 DocumentRoot ""
 ServerName xxx.com
 <Directory "C:\xampp\htdocs">
  AllowOverride All
  Options All
  Require all granted
 </Directory>
</VirtualHost>

なぜ間違えたのか

環境構築の資料(PDF)から、そのままコピペして貼り付けたものが¥(円マーク)だった。
この2つ\(バックスラッシュ)と¥(円マーク)は、Windowsではどちらも¥として表示されてしまうため、気づくのが遅くなった。
パーミッションエラーと出ていたため、初めは権限関係かと思っていた。

所感

2時間以上かかったけど、なんとか解決できた時は感動しました。
あまりに局所的なので役に立たないかもしれませんが、自分の忘備録として。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0