ITの隊長のブログ

ITの隊長のブログです。Rubyを使って仕事しています。最近も色々やっているお(^ω^ = ^ω^)

【Apache】VirtualHostのデフォルト設定

スポンサードリンク

127.0.0.1にアクセスしたらhttpd.confの設定を見にいってほしかった。

しかし、VirtualHostを設定しただけではそうにはならないので。デフォルトの設定を追加した。

# ここがデフォルトの設定になる
<VirtualHost *:80>
  ServerName 127.0.0.1
</VirtualHost>

# ここが追加したい設定
<VirtualHost *:80>
  ServerName cakephp.localhost
  DocumentRoot "/var/www/html/cakephp/public_html/"
  <Directory "/var/www/html/cakephp/public_html/">
      #
      # 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
      AddType application/x-httpd-php .php

      #
      # 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>
</VirtualHost>