FC4/Apache/Apacheのセットアップ
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
#contents
----
* Apache のセットアップ [#za6ea188]
Fedora Core のセットアップが終わった段階では、まだ Apac...
なお、Fedora Core および Red Hat Linux 8 以上では Apach...
** [1] 設定ファイルの場所 [#we82fec3]
設定ファイルがあるのは
/etc/httpd/conf/httpd.conf
です。&br;
Fedora Core(Red Hat 8以降) では追加で
/etc/httpd/conf.d/
以下にあるファイル群も自動で読み込む設定にあります(http...
$ ls -l /etc/httpd/conf.d/
合計 112
-rw-r--r-- 1 root root 392 5月 23 21:14 README
-rw-r--r-- 1 root root 3420 3月 3 23:00 auth_mysql...
-rw-r--r-- 1 root root 3512 4月 13 17:20 auth_pgsql...
-rw-r--r-- 1 root mailman 688 3月 8 02:01 mailman.conf
-rw-r--r-- 1 root root 778 5月 23 21:14 manual.conf
-rw-r--r-- 1 root root 330 3月 13 21:07 mrtg.conf
-rw-r--r-- 1 root root 1804 4月 19 07:25 perl.conf
-rw-r--r-- 1 root root 560 5月 10 00:22 php.conf
-rw-r--r-- 1 root root 1671 3月 4 17:55 python.conf
-rw-r--r-- 1 root root 96 1月 29 08:25 squirrelma...
-rw-r--r-- 1 root root 9799 5月 23 21:14 ssl.conf
-rw-r--r-- 1 root root 352 3月 4 19:51 webalizer....
-rw-r--r-- 1 root root 299 5月 23 21:14 welcome.conf
表示されるファイル群は、同時にセットアップされている各...
** [2] 最低限の設定箇所 [#ifd7bdd0]
Apache の設定ファイルを【 vi /etc/httpd/conf/httpd.conf...
*** [2-1] ServerAdmin (235行目) [#cec32e00]
ServerAdmin root@localhost
ここにはサーバ管理者のメールアドレスを記述します。エラ...
ServerAdmin webmaster@example.co.jp
とりあえず、何でも結構です。
*** [2-2] ServerName (249行目) [#pbb39cb9]
#ServerName www.example.com:80
初期状態では、このようにコメント(無効に)されています...
ServerName www.example.co.jp:80
先頭の【 # 】は消しておかなくてはいけません。&br;
もし www 無しの http://example.co.jp/ のようなアクセス...
ServerName example.co.jp:80
このように記述しておくほうが適切です。
*** [2-3] HostnameLookups (428行目) [#z8f908aa]
HostnameLookups Off
こちらは接続元の IP アドレスを逆引きするかどうか、です...
*** [2-4] LanguagePriority (715行目) [#xae60ae2]
LanguagePriority en ca cs da de el eo es et fr he hr it ...
sv zh-CN zh-TW
こちらも特に変更の必要はありませんが、英語より日本語の...
LanguagePriority ja en ca cs da de el eo es et fr he hr ...
sv zh-CN zh-TW
*** [2-5] AddDefaultCharset (731行目) [#mca55dbf]
こちらの設定は文字化け回避のために必須です。
AddDefaultCharset UTF-8
初期状態では、このようにページの文字コードが UTF-8(unic...
対策としては、基本的に「#」をつけてコメント(無効)にし...
#AddDefaultCharset UTF-8
もし Shift_JIS など特定の日本語コードを指定したい場合は...
AddDefaultCharset Shift_JIS
逆にコンテンツが全て UTF-8 であれば、そのまま設定を残し...
** [3] Apache の起動・停止コマンド [#nf57033e]
*** [3-1] 起動 [#l503e7d9]
# /sbin/service httpd start
httpd を起動中: ...
あるいは、
# /etc/init.d/httpd start
httpd を起動中: ...
です。&br;
*** [3-2] 停止 [#l77bb8ce]
# /sbin/service httpd stop
httpd を停止中: ...
あるいは、
# /etc/init.d/httpd stop
httpd を停止中: ...
です。&br;
*** [3-3] 再起動 [#ea6971a1]
再起動には「restart」と「graceful」の2種類があります。&...
いずれも基本的にプロセスの停止・再開を行います。主にhtt...
# /sbin/service httpd restart
httpd を停止中: ...
httpd を起動中: ...
あるいは、
# /etc/init.d/httpd restart
httpd を停止中: ...
httpd を起動中: ...
です。&br;
「restart」では httpd プロセスを完全に停止してから再起...
対して「graceful」では httpd プロセスの通信が終わるのを...
# /sbin/service httpd graceful
あるいは、
# /etc/init.d/httpd graceful
です。なお「graceful」を実行したときは、特に画面上に結...
[notice] Graceful restart requested, doing restart
このような記録が残ります。 &br;
ちゃんと再起動がかかっているか不安だな、という場合には...
** [4] Apache の自動起動設定 [#z817cf6d]
初期状態ではサーバの起動時 Apache が自動起動される設定...
# /sbin/chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off ...
chkconfig コマンドを用いて、自動起動されるように設定し...
# /sbin/chkconfig httpd on
コマンドの実行結果は特に画面に表示されません。もう一度 ...
# /sbin/chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on ...
終了行:
#contents
----
* Apache のセットアップ [#za6ea188]
Fedora Core のセットアップが終わった段階では、まだ Apac...
なお、Fedora Core および Red Hat Linux 8 以上では Apach...
** [1] 設定ファイルの場所 [#we82fec3]
設定ファイルがあるのは
/etc/httpd/conf/httpd.conf
です。&br;
Fedora Core(Red Hat 8以降) では追加で
/etc/httpd/conf.d/
以下にあるファイル群も自動で読み込む設定にあります(http...
$ ls -l /etc/httpd/conf.d/
合計 112
-rw-r--r-- 1 root root 392 5月 23 21:14 README
-rw-r--r-- 1 root root 3420 3月 3 23:00 auth_mysql...
-rw-r--r-- 1 root root 3512 4月 13 17:20 auth_pgsql...
-rw-r--r-- 1 root mailman 688 3月 8 02:01 mailman.conf
-rw-r--r-- 1 root root 778 5月 23 21:14 manual.conf
-rw-r--r-- 1 root root 330 3月 13 21:07 mrtg.conf
-rw-r--r-- 1 root root 1804 4月 19 07:25 perl.conf
-rw-r--r-- 1 root root 560 5月 10 00:22 php.conf
-rw-r--r-- 1 root root 1671 3月 4 17:55 python.conf
-rw-r--r-- 1 root root 96 1月 29 08:25 squirrelma...
-rw-r--r-- 1 root root 9799 5月 23 21:14 ssl.conf
-rw-r--r-- 1 root root 352 3月 4 19:51 webalizer....
-rw-r--r-- 1 root root 299 5月 23 21:14 welcome.conf
表示されるファイル群は、同時にセットアップされている各...
** [2] 最低限の設定箇所 [#ifd7bdd0]
Apache の設定ファイルを【 vi /etc/httpd/conf/httpd.conf...
*** [2-1] ServerAdmin (235行目) [#cec32e00]
ServerAdmin root@localhost
ここにはサーバ管理者のメールアドレスを記述します。エラ...
ServerAdmin webmaster@example.co.jp
とりあえず、何でも結構です。
*** [2-2] ServerName (249行目) [#pbb39cb9]
#ServerName www.example.com:80
初期状態では、このようにコメント(無効に)されています...
ServerName www.example.co.jp:80
先頭の【 # 】は消しておかなくてはいけません。&br;
もし www 無しの http://example.co.jp/ のようなアクセス...
ServerName example.co.jp:80
このように記述しておくほうが適切です。
*** [2-3] HostnameLookups (428行目) [#z8f908aa]
HostnameLookups Off
こちらは接続元の IP アドレスを逆引きするかどうか、です...
*** [2-4] LanguagePriority (715行目) [#xae60ae2]
LanguagePriority en ca cs da de el eo es et fr he hr it ...
sv zh-CN zh-TW
こちらも特に変更の必要はありませんが、英語より日本語の...
LanguagePriority ja en ca cs da de el eo es et fr he hr ...
sv zh-CN zh-TW
*** [2-5] AddDefaultCharset (731行目) [#mca55dbf]
こちらの設定は文字化け回避のために必須です。
AddDefaultCharset UTF-8
初期状態では、このようにページの文字コードが UTF-8(unic...
対策としては、基本的に「#」をつけてコメント(無効)にし...
#AddDefaultCharset UTF-8
もし Shift_JIS など特定の日本語コードを指定したい場合は...
AddDefaultCharset Shift_JIS
逆にコンテンツが全て UTF-8 であれば、そのまま設定を残し...
** [3] Apache の起動・停止コマンド [#nf57033e]
*** [3-1] 起動 [#l503e7d9]
# /sbin/service httpd start
httpd を起動中: ...
あるいは、
# /etc/init.d/httpd start
httpd を起動中: ...
です。&br;
*** [3-2] 停止 [#l77bb8ce]
# /sbin/service httpd stop
httpd を停止中: ...
あるいは、
# /etc/init.d/httpd stop
httpd を停止中: ...
です。&br;
*** [3-3] 再起動 [#ea6971a1]
再起動には「restart」と「graceful」の2種類があります。&...
いずれも基本的にプロセスの停止・再開を行います。主にhtt...
# /sbin/service httpd restart
httpd を停止中: ...
httpd を起動中: ...
あるいは、
# /etc/init.d/httpd restart
httpd を停止中: ...
httpd を起動中: ...
です。&br;
「restart」では httpd プロセスを完全に停止してから再起...
対して「graceful」では httpd プロセスの通信が終わるのを...
# /sbin/service httpd graceful
あるいは、
# /etc/init.d/httpd graceful
です。なお「graceful」を実行したときは、特に画面上に結...
[notice] Graceful restart requested, doing restart
このような記録が残ります。 &br;
ちゃんと再起動がかかっているか不安だな、という場合には...
** [4] Apache の自動起動設定 [#z817cf6d]
初期状態ではサーバの起動時 Apache が自動起動される設定...
# /sbin/chkconfig --list httpd
httpd 0:off 1:off 2:off 3:off 4:off ...
chkconfig コマンドを用いて、自動起動されるように設定し...
# /sbin/chkconfig httpd on
コマンドの実行結果は特に画面に表示されません。もう一度 ...
# /sbin/chkconfig --list httpd
httpd 0:off 1:off 2:on 3:on 4:on ...
ページ名: