virtual host (apache)の設定。
グループウェア環境同期のため virtual host 設定
まず、ホスト名の確認と修正方法。
以下の二つのファイルを修正してホスト名を変更する。
/etc/hosts
/etc/sysconfig/network
どうやら、/etc/hostsだけの修正だとuname -aをした際に名前の変更が反映されないため、/etc/sysconfig/networkの設定も変更してnetworkを再起動。
uname -aにてホスト名変更を確認
groupware.xxxxxxx.jp
IPベースのバーチャルホストのため、NICに追加IPの割り当て。
NIC一枚に対して2つのローカルIPを設定。
エイリアスを使えばいいらしいのですが、ifcfg-eth0をifcfg-eth0:0としてファイルコピー
ネットワークを再起動後
ifconfigにて確認。
eth0 Link encap:Ethernet HWaddr 00:13:72:30:11:6F
inet addr:192.168.18.210 Bcast:192.168.18.255 Mask:255.255.255.0
inet6 addr: fe80::213:72ff:fe30:116f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:40496 errors:0 dropped:0 overruns:0 frame:0
TX packets:29554 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:6991556 (6.6 MiB) TX bytes:7433103 (7.0 MiB)
Interrupt:177
eth0:0 Link encap:Ethernet HWaddr 00:13:72:30:11:6F
inet addr:192.168.18.208 Bcast:192.168.18.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:177
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:5009 errors:0 dropped:0 overruns:0 frame:0
TX packets:5009 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5753161 (5.4 MiB) TX bytes:5753161 (5.4 MiB)
eth0:0が追加されてさらにIPが割り当てられているので問題なさそうです。
危うく、NICを購入するところですが、教えてくれた先輩には感謝です。
参考サイト:http://www.itmedia.co.jp/help/tips/linux/l0494.html
httpd.confに以下のバーチャルホストディレクティブを追記
<VirtualHost 192.168.18.208:80>
DocumentRoot /home/77/ttd5700/
ServerName groupware.*****-hosting.jp
ErrorLog /var/log/office7.*****-hosting.jp/error.log
CustomLog logs/all-dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost 192.168.18.210:80>
ServerAdmin ******.co.jp
DocumentRoot /var/www/html/
ServerName groupware.*****-hosting.jp
ErrorLog /var/log/office7.*****-hosting.jp/error.log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
設定後apacheを再起動。
ログディレクトリがなかったため再起動に少々つまづきましたが現状稼動中で問題なさそうな感じ…。
これで192.168.18.210と192.168.18.208のIPベースvirtualhost設定が完了です。