menu
書いてる野郎
orebike@gmail.com
Linux Mint 16, Apache 2.4.6 多分 Ubuntu 系でも同じだと思う
このディレクトリ以下にURLとディレクトリの関係を記述するファイル群があるのでここにおく
/etc/apache2/sites-available
すでにデフォルトのやつが設定されているのでそれをコピー
$ sudo cp 000-default.conf 001-hogehoge.conf
このように編集 ServerName を追加しているところがポイント
<VirtualHost *:80> ServerName hoge.hoge.com ServerAdmin webmaster@localhost DocumentRoot /home/hoge/piyo/fuga ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> <Directory "/home/hoge/piyo/fuga"> AllowOverride All Require all granted </Directory>
Apache2.4 からは Directory にこのような記述が必要になったようだ。
勝手ドメインを作る
/etc/hosts
に
127.0.0.1 hoge.hoge.com
を追記してOK