Vagrant/ VM VirtualBoxでCentOSを入れて環境構築していた際に起こったエラーとかの解決法まとめ

CakePHPの勉強と同時にテスト環境構築の勉強もしようと思いCentOSをVagrant/ VM VirtualBoxで入れた際に起こったエラーについて
自分なりにまとめておこう思います。
ド素人すぎて何書いてるのかわからない＆数日前のことで忘れてごっちゃになってる可能性があると思いますけど
どっかのだれかの役にでも立てば幸です。

今回はドットインストールの以下の講座を見ながら構築していた際に起こったエラーたちです。
*【旧版】ローカル開発環境の構築  Windows編  (全10回)*
http://dotinstall.com/lessons/basic_localdev_win


#■Vagrantが起動できない（タイムアウトする）
>
C:\Users\user\MyVagrant\mycentos>vagrant reload
==> default: Attempting graceful shutdown of VM...
    default: Guest communication could not be established! This is usually because
    default: SSH is not running, the authentication information was changed,
    default: or some other networking issue. Vagrant will force halt, if
    default: capable.
==> default: Forcing shutdown of VM...
==> default: Checking if box 'bento/centos-6.7' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
**Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.**
>

このエラーはBIOSで
**Intel(R) Virtualization Technology**(仮想化を支援する機能)
という項目を有効にしないといけないらしい
例：**Intel(R) Virtualization Technology: Enabled**

でも自分の場合、もともと有効になっていました。
結局SSHが入ってなかったのが原因っぽかったので*Cygwin Terminal*というソフトを使ってインストール

![WS000047.JPG](https://qiita-image-store.s3.amazonaws.com/0/85815/93d76d51-a447-a832-f5b7-6f103e06aa7d.jpeg)
>
C:\Users\user\MyVagrant\mycentos>vagrant ssh
`ssh` executable not found in any directories in the %PATH% variable. Is an
SSH client installed? Try installing Cygwin, MinGW or Git, all of which
contain an SSH client. Or use your favorite SSH client with the following
authentication information shown below:
Host: 127.0.0.1
Port: 2222
Username: vagrant
Private key: C:/Users/user/MyVagrant/mycentos/.vagrant/machines/default/virtualbox/private_key
>


参考にさせていただいた記事：
*Windows7にmingw-getでMSYSのsshとrsyncをインストールする - ひろうぃんの雑記*
http://heroween.hateblo.jp/entry/2014/06/06/203440


これで（おそらく）解決しました

<br>
* * *


#■サーバーネームを変更しろというCentOSでのエラー
> 
httpd を起動中: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain for ServerName
(13)Permission denied: make_sock: could not bind to address [::]:80
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
>

これはCentOSの/etc/httpd/conf/httpd.confの以下の箇所をroot権限で編集してやれば解決できました
![WS000051.JPG](https://qiita-image-store.s3.amazonaws.com/0/85815/64a309f0-0354-f588-7379-a4212e36e0fc.jpeg)
>
\# ServerName gives the name and port that the server uses to identify itself.
\# This can often be determined automatically, but we recommend you specify
\# it explicitly to prevent problems during startup.
\#
\# If this is not set to valid DNS name for your host, server-generated
\# redirections will not work.  See also the UseCanonicalName directive.
\#
\# 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 www.example.com:80
**ServerName localhost:80**
>

↑ServerNameに適当に名前つけて保存で再起動


##★ドットインストールの言われるがままにいれたからroot権限のユーザーネームとパスがわからん
これで結構時間とられましたがこれでroot権限でhttpd.confを変更更新できました。
>
**username = root**
**password = vagrant**
>

<br>
* * *
他にも何かあったとおもうけど忘れた
思い出したらorまたエラーでたときまとめようと思いますん・・・

おわり