CentOSにApacheを入れる
折角Windows8 買ったんだし仮想環境でも作ってみようかな?と、
VirtalBox でCentOS を導入。
で、これからApache, PHP, MySQL を入れて環境を作ってみます。
まずはApache。
CentOS を起動して、ターミナルを起動。
以下のコマンドでroot に変更!
su -l
パスワード
Apache をインストールする
インストールが終わったらApache を起動する。
-k がないと動かないけど、必要だったっけ…。
/etc/init.d/httpd -k start
そしたら以下の様なエラー。
Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
httpd.conf でServerName の設定をしてないよ!ってことらしいので、
httpd.conf の設定を変更。
vim /etc/httpd/conf/httpd.conf
#ServerName www.example.com:80
↓
ServerName localhost:80
保存したらApache 再起動
/etc/init.d/httpd -k restart
そして確認。動いた!
▼参考にしたサイト
Linux - CentOSにLAMP環境を構築する - Qiita
↑実行コマンドとか、今とちょっと違う。