Cloud Nine

Avatar

This blog is my everything!!

Aug
13
VirtualHostの設定方法
Aug 13, 2008 0

VirtualHostの設定方法を紹介します。
VirtualHostを設定すると、複数のドメインを一台サーバで運営することができます。

httpd.conf の設定

Apacheのhttpd.confを変更します。
デフォルトなら、/etc/httpd/conf/httpd.conf あたりにいます。
みつからない時は、

locate httpd.conf

で探してください。

1.ServerNameのコメントアウト

# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
#ServerName localhost コメントアウトしてください。

2.httpd.conf にVirtualHostの設定を追加します。

<virtualhost *:80>
    DocumentRoot /home/text/www/ ドメインのRoot
    ServerName www.test.com 指定したいドメイン
</virtualhost>

3.apacheの再起動

Apacheの再起動方法はいろいろあります。

 /etc/rc.d/init.d/httpd restart
/usr/sbin/apachectl restart

上記の3つすれば、とりあずVirtualHostの設定は完了です。

,

Advertisings

Search Keyword

Calendar

2008年 August
« Jul   Sep »
 123
45678910
11121314151617
18192021222324
25262728293031

Status

フィードメーター - Cloud  Nine あわせて読みたいブログパーツ