0
1

More than 3 years have passed since last update.

MAMPでバーチャルホストを設定する

Last updated at Posted at 2020-08-01

やったこと

バーチャルホスト設定を有効化する

"C:\MAMP\conf\apache\httpd.conf"を設定
初期設定は"Include conf/extra/httpd-vhosts.conf"が無効になっているので有効にする。

# Virtual hosts
Include "C:\MAMP\conf\apache\extra\httpd-vhosts.conf"

ホストの設定

"C:\MAMP\conf\apache\extra"にC:\MAMP\bin\apache\conf\extra\httpd-vhosts.conf"をコピー
下記のように設定

<VirtualHost *:80>
    DocumentRoot "C:\MAMP\htdocs\fanawill"
    ServerName local-fanawill.com
    <Directory "C:\MAMP\htdocs\fanawill">
        AllowOverride all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:\MAMP\htdocs\xxxxxx"
    ServerName local-xxxxxx.com
    <Directory "C:\MAMP\htdocs\xxxxxx">
        AllowOverride all
    </Directory>
</VirtualHost>

hostsの設定

"C:\Windows\System32\drivers\etc\hosts"に下記を追加

127.0.0.1       local-fanawill.com
127.0.0.1       local-xxxxxx.com

参考

MAMPを使って複数バーチャルホストのローカル環境を設定する

0
1
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
1