◆当blogは、Linuxサーバ構築する際の実際の設定手順を個人的メモとして記載しております。LinuC試験の役に立つ情報があるかも…?
[root]# vi /etc/httpd/conf/httpd.conf←Apacheの設定ファイル
■下記の項目は必ず環境に合わせて設定する↓■
ServerAdmin apache@example.com←管理者メールアドレス
ServerName reverie.example.com:80←WWWサーバ名とポート番号
DocumentRoot "/var/www/html"←ドキュメントルートの場所
[root]# /etc/rc.d/init.d/httpd restart←設定反映のため、httpd再起動
httpdを停止中: [失敗]
httpdを起動中: [ OK ]
[root]# tail /var/log/messages
Nov 9 12:55:28 reverie xfs: xfs startup succeeded
Nov 9 12:55:28 reverie anacron: anacron startup succeeded
Nov 9 12:55:28 reverie atd: atd startup succeeded
Nov 9 12:55:28 reverie xfs: ignoring font path element /usr/X11R6/lib/X11/fonts/cyrillic (unreadable)
Nov 9 12:55:32 reverie kernel: mice: PS/2 mouse device common for all mice
Nov 9 12:57:49 reverie sshd(pam_unix)[1295]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=192.168.0.21 user=reverie
Nov 9 12:57:53 reverie sshd(pam_unix)[1297]: session opened for user reverie by (uid=500)
Nov 9 12:57:55 reverie 11月 9 12:57:55 su(pam_unix)[1327]: session opened for user root by reverie(uid=500)
Nov 9 13:36:54 reverie 11月 9 13:36:54 httpd: httpd停止 failed
Nov 9 13:36:56 reverie 11月 9 13:36:56 httpd: httpd起動 succeeded
→Windowsから「http://www.example.com/」にアクセス
[root]# tail /var/log/httpd/access_log←この時点ではindex.htmlが無いためエラーとなる
192.168.0.50 - - [09/Nov/2010:13:43:29 +0900] "GET /index.html HTTP/1.1" 404 1057 "-" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
192.168.0.50 - - [09/Nov/2010:13:43:38 +0900] "GET / HTTP/1.1" 403 2898 "-" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
192.168.0.50 - - [09/Nov/2010:13:43:38 +0900] "GET /icons/apache_pb.gif HTTP/1.1" 200 2326 "http://www.example.com/" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
192.168.0.50 - - [09/Nov/2010:13:43:38 +0900] "GET /icons/powered_by.gif HTTP/1.1" 200 581 "http://www.example.com/" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
[root]# vi /var/www/html/index.html
■適当にHTMLを作成↓■
<HTML>
<HEAD><TITLE> test </TITLE></HEAD>
<BODY>
www server test...
</BODY>
</HTML>
→Windowsから「http://www.example.com/」にアクセス
[root]# tail /var/log/httpd/access_log←index.htmlにアクセスできることを確認する
192.168.0.50 - - [09/Nov/2010:13:57:23 +0900] "GET / HTTP/1.1" 200 117 "-" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
192.168.0.50 - - [09/Nov/2010:13:57:35 +0900] "GET /index.html HTTP/1.1" 200 117 "-" "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"
COMMENT