CentOS6 Apache 設定
ホームページを公開するのに必要なWebサーバーがApache
Apacheインストール確認
httpdがインストールされているか確認する。
[root@localhost ~]# yum list installed | grep httpd
なければインストールする。
yum -y install httpd
設定ファイルの確認
設定ファイルのhttpd.confを確認する。
[root@localhost ~]# cd /etc/httpd/conf [root@localhost ~]# vi httpd.conf
DocumentRootに指定されているディレクトリがホームページ公開用フォルダ。
# DocumentRoot: The directory out of which you will serve your # documents. By default, all requests are taken from this directory, but # symbolic links and aliases may be used to point to other locations. # DocumentRoot "/var/www/html"
index.htmlファイルを作成し、ドキュメントルートに設置する。
<html> <body> Hello World! </body> </html>
Apacheの起動
Apacheを起動し、再起動時の設定もおこなう。
[root@localhost ~]# service httpd start [root@localhost ~]# chkconfig httpd --list
ブラウザで確認
http://localhost/で確認する。