Webエンジニアの雄大です。
最近、さくらVPSを借りて、サーバーをいじいじしています。
ドメインを持っていなかったので、ドメインを作りました。
ドメインはムームードメインで作りました。
ムームードメインで取得した理由として、ただ、いつも使うというだけの理由ですが。
ドメインを取得して、ムームードメイン側で設定を行います。
そして、さくらVPSにドメインの設定を行いました。
参考にしたサイトはこのサイトです。
http://matsudam.com/blog/entry/128/
httpd.confの設定
vi /etc/httpd/conf/httpd.conf
#NameVirtualHost *:80 ↓ NameVirtualHost (IPアドレス):80
#<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
↓
<VirtualHost (IPアドレス):80>
ServerAdmin (メールアドレス)
DocumentRoot /home/(ユーザ)/public_html/(ドキュメントルートディレクトリ)
ServerName (ドメイン)
ErrorLog logs/(ドメイン)-error_log
CustomLog logs/(ドメイン)-access_log common
</VirtualHost>
あとは、上記の設定を反映させるために、apacheの再起動を行います。
apachectl restart
ドメインのほうが反映に時間がかかりそうなので、ここで、寝ました。
そのあと、取得したドメインをたたいて、反映が確認できました。
コメント