Warning: Cannot modify header information - headers already sent in /home/dacelo/html/DocumentRoot/wp-includes/feed-rss2.php on line 8 Weblogy » apache http://blog.dacelo.info WordPressのカスタマイズとプラグイン、CSSテクニック、SEOの話題など。 Thu, 10 Nov 2011 12:00:04 +0000 ja hourly 1 http://wordpress.org/?v=3.2.1 apacheの prefork.cとworker.cの違い http://blog.dacelo.info/apache/entry-956.html?utm_source=rss&utm_medium=rss&utm_campaign=apache%25e3%2581%25ae-prefork-c%25e3%2581%25a8worker-c%25e3%2581%25ae%25e9%2581%2595%25e3%2581%2584 http://blog.dacelo.info/apache/entry-956.html#comments Thu, 12 May 2011 13:22:50 +0000 http://blog.dacelo.info/?p=956 続きを読む No related posts. Related posts brought to you by Yet Another Related Posts Plugin.]]>

/etc/httpd/conf/httpd.conf
を見ると、KeepAliveとかMaxClientとかの設定をする部分が、2つあることに気付きます。

 # prefork MPM
 
StartServers       2
MinSpareServers    5
MaxSpareServers   20
ServerLimit      32
MaxClients       32
MaxRequestsPerChild  0
 
# worker MPM
 
StartServers         2
MaxClients         30
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0

それぞれ一体何が違うのかというと…。

apacheの prefork.cとworker.cの違い

リクエストに対して子プロセスを起動していく方式=prefork
リクエストをスレッドにより対応していく方式=worker

という事のようです。

じゃあ自分が動かしているApacheは一体どっちの方式で動いているのか?
これは、コンパイル時にオプションで設定するんですが、おそらくデフォルトではprefork型のようです。

どっちで動いているかを調べる

それを調べるコマンドはこちら。

[root@ ~]# /usr/sbin/apachectl -V

環境によってはapache部分が違います。

[root@ ~]# /usr/sbin/apache2 -V

いずれにせよ、これでバージョン情報がズラズラと返ってきますが、その中に

Server MPM: Prefork

という記述があります。この場合はprefork型ですね。
もしくは、コンパイル情報の

Server compiled with….
-D APACHE_MPM_DIR=”server/mpm/prefork”

という箇所を探してください。

これで、Apacheの設定をちゃんとピンポイントで適切に行なうことができるようになって、めでたしめでたし。

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-956.html/feed 0
WordPress高速化チューニングの第一歩! APC導入 http://blog.dacelo.info/apache/entry-820.html?utm_source=rss&utm_medium=rss&utm_campaign=wordpress%25e9%25ab%2598%25e9%2580%259f%25e5%258c%2596%25e3%2583%2581%25e3%2583%25a5%25e3%2583%25bc%25e3%2583%258b%25e3%2583%25b3%25e3%2582%25b0%25e3%2581%25ae%25e7%25ac%25ac%25e4%25b8%2580%25e6%25ad%25a9%25ef%25bc%2581-apc%25e5%25b0%258e%25e5%2585%25a5 http://blog.dacelo.info/apache/entry-820.html#comments Wed, 29 Sep 2010 01:17:08 +0000 http://blog.dacelo.info/?p=820 続きを読む No related posts. Related posts brought to you by Yet Another Related Posts Plugin.]]>

CentOSでAPCをインストール(DTIのVPS)

サーバをDreamHost(米サーバ。糞重い)からDTIのVPS(国産VPS)に移転しました。
しかしWordPressの動作がそんなに速くならなかったので、PHP Acceleratorを何か入れることにしました。
VPSはルート権限があるのでこういうことも試せていいですね。

APCのインストール手順

ソースからコンパイルするのは面倒だし、PHPのバージョンと依存関係があったりするそうなので、peclでインストールすることにしました。

[root@dti-vps ]# pecl install APC
downloading APC-3.0.19.tgz ...
Starting to download APC-3.0.19.tgz (115,735 bytes)
.........................done: 115,735 bytes
47 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025
Use apxs to set compile flags (if using APC with Apache)? [yes] : yes
building in /var/tmp/pear-build-root/APC-3.0.19
running: /tmp/tmpu4u0H7/APC-3.0.19/configure --with-apxs
checking for egrep... grep -E
checking for a sed that does not truncate output... /bin/sed
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
ERROR: `/tmp/tmpu4u0H7/APC-3.0.19/configure --with-apxs' failed

お。エラーです。PAYHが通ってない、と言われていますが、どうやらいくつかのモジュールが足りないようです。

# yum -y install gcc gcc-c++

もう一度試行。

[root@dti-vps ]# pecl install APC
(略)
Sorry, I was not able to successfully run APXS.  Possible reasons:
 
1.  Perl is not installed;
2.  Apache was not compiled with DSO support (--enable-module=so);
3.  'apxs' is not in your path.  Try to use --with-apxs=/path/to/apxs
The output of apxs follows
/tmp/tmpuAcvYD/APC-3.0.19/configure: line 3232: apxs: command not found
configure: error: Aborting
ERROR: `/tmp/tmpuAcvYD/APC-3.0.19/configure --with-apxs' failed

まだエラーが出ます。
http-develも必要のようです。

# yum install httpd-devel
[root@dti-vps ]# pecl install APC
略
 
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
 
running: make INSTALL_ROOT="/var/tmp/pear-build-root/install-APC-3.0.19" install
Installing shared extensions:     /var/tmp/pear-build-root/install-APC-3.0.19/usr/lib/php/modules/
running: find "/var/tmp/pear-build-root/install-APC-3.0.19" -ls
241026596    4 drwxr-xr-x   3 root     root         4096  929 09:41 /var/tmp/pear-build-root/install-APC-3.0.19
241026657    4 drwxr-xr-x   3 root     root         4096  929 09:41 /var/tmp/pear-build-root/install-APC-3.0.19/usr
241026658    4 drwxr-xr-x   3 root     root         4096  929 09:41 /var/tmp/pear-build-root/install-APC-3.0.19/usr/lib
241026659    4 drwxr-xr-x   3 root     root         4096  929 09:41 /var/tmp/pear-build-root/install-APC-3.0.19/usr/lib/php
241026660    4 drwxr-xr-x   2 root     root         4096  929 09:41 /var/tmp/pear-build-root/install-APC-3.0.19/usr/lib/php/modules
241026656  408 -rwxr-xr-x   1 root     root       412650  929 09:41 /var/tmp/pear-build-root/install-APC-3.0.19/usr/lib/php/modules/apc.so
 
Build process completed successfully
Installing '/var/tmp/pear-build-root/install-APC-3.0.19//usr/lib/php/modules/apc.so'
install ok: channel://pecl.php.net/APC-3.0.19
You should add "extension=apc.so" to php.ini

成功しました。
php.iniを開いて、「extension=apc.so」の一行を追加して、ApacheをリスタートすればOKです。

[root@dti-vps ]# pecl install
[PHP]
extension=apc.so
;;;;;;;;;;;;;;;;;;;
; About php.ini   ;
;;;;;;;;;;;;;;;;;;;
[root@dti-vps ]# service httpd restart

以上!

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-820.html/feed 4
新VPSでPHPエラー『Warning: Unknown: open_basedir restriction in effect. File(/home/user/index.php) is not within the allowed path(s): (/tmp/:/var/lib/php/session/) in Unknown on line 0』 http://blog.dacelo.info/apache/entry-811.html?utm_source=rss&utm_medium=rss&utm_campaign=%25e6%2596%25b0vps%25e3%2581%25a7php%25e3%2582%25a8%25e3%2583%25a9%25e3%2583%25bc%25e3%2580%258ewarning-unknown-open_basedir-restriction-in-effect-filehomeuserindex-php-is-not-within-the-allowed-paths-tmpvarlibphpsess http://blog.dacelo.info/apache/entry-811.html#comments Mon, 20 Sep 2010 16:30:14 +0000 http://blog.dacelo.info/?p=811 続きを読む Related posts:
  1. メールのエラー「postdrop: warning: unable to look up public/pickup: No such file or directory」 サーバーのメールコマンドを使おうとしたら、こんなエラーが返ってきました。 [dacelo@dacelo.info ~]$ postdrop: warning: unable to look up public/picku...
Related posts brought to you by Yet Another Related Posts Plugin.]]>

ちょっとこのDreamHostのサーバーが重くて仕方ない、あとWordPressサイトで404やら500が発生しすぎなので、引っ越しを画策しています。

そこでとりあえず、最近はやりのVPSサーバーを借りてみたんですが、色々設定してみたところ、ドメインを設定してApacheでルートを設定させるところまでは出来たんですが、肝心のPHPが動かない。こんなエラーが出ます。

Warning: Unknown: open_basedir restriction in effect. File(/home/user/html/index.php) is not within the allowed path(s): (/tmp/:/var/lib/php/session/) in Unknown on line 0

これは、PHPの設定で、PHPを動かすベースディレクトリを設定してしまっているためで、「そのパスではPHPが動かない」と怒られている状態のようです。

/etc/php.ini を開いて…

open_basedir = /tmp/:/var/lib/php/session/

となっているところをコメントアウトして

; open_basedir = /tmp/:/var/lib/php/session/

Apacheを再起動すればOKです。

service httpd restart

Related posts:

  1. メールのエラー「postdrop: warning: unable to look up public/pickup: No such file or directory」 サーバーのメールコマンドを使おうとしたら、こんなエラーが返ってきました。 [dacelo@dacelo.info ~]$ postdrop: warning: unable to look up public/picku...

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-811.html/feed 0
Apacheのアクセスログから特定のIPを除外する http://blog.dacelo.info/apache/entry-799.html?utm_source=rss&utm_medium=rss&utm_campaign=apache%25e3%2581%25ae%25e3%2582%25a2%25e3%2582%25af%25e3%2582%25bb%25e3%2582%25b9%25e3%2583%25ad%25e3%2582%25b0%25e3%2581%258b%25e3%2582%2589%25e7%2589%25b9%25e5%25ae%259a%25e3%2581%25aeip%25e3%2582%2592%25e9%2599%25a4%25e5%25a4%2596%25e3%2581%2599%25e3%2582%258b http://blog.dacelo.info/apache/entry-799.html#comments Thu, 20 May 2010 11:33:32 +0000 http://blog.dacelo.info/apache/entry-799.html 続きを読む Related posts:
  1. adduser で補助ユーザーを作成する 社内の複数人数で使っているサーバーで、共通のディレクトリを編集する、共通グループの補助的なユーザーを作成したいときのコマンドです。 ユーザーとしては別れていた方がいいんだけど、専用のディレクトリを持たせたりはしたくない。 ...続きを読む...
Related posts brought to you by Yet Another Related Posts Plugin.]]>

2分に1回、死活監視をするプログラムを走らせてたんですけど、それだとApacheのログがそのアクセスで一杯になっちゃうんですね。
あんまりアクセスのないサイトだと、9割方それで埋まります…。

そこで今日のお題。

CustomLog logs/access_log common env=!nolog 
SetEnvIf Remote_Addr 192.168.1. nolog 
SetEnvIf Remote_Addr 192.168.2. nolog

これで当該サーバからのアクセスはログに記録されなくなり、めでたしめでたし。

Related posts:

  1. adduser で補助ユーザーを作成する 社内の複数人数で使っているサーバーで、共通のディレクトリを編集する、共通グループの補助的なユーザーを作成したいときのコマンドです。 ユーザーとしては別れていた方がいいんだけど、専用のディレクトリを持たせたりはしたくない。 ...続きを読む...

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-799.html/feed 1
.htaccessでHTTPSのアクセスをHTTPにリダイレクト http://blog.dacelo.info/apache/entry-792.html?utm_source=rss&utm_medium=rss&utm_campaign=htaccess%25e3%2581%25a7https%25e3%2581%25ae%25e3%2582%25a2%25e3%2582%25af%25e3%2582%25bb%25e3%2582%25b9%25e3%2582%2592http%25e3%2581%25ab%25e3%2583%25aa%25e3%2583%2580%25e3%2582%25a4%25e3%2583%25ac%25e3%2582%25af%25e3%2583%2588 http://blog.dacelo.info/apache/entry-792.html#comments Wed, 21 Apr 2010 07:24:38 +0000 http://blog.dacelo.info/apache/entry-792.html 続きを読む Related posts:
  1. 同一URLのままでスプラッシュページを作る 「最初の訪問時だけ、トップページでフラッシュ・ムービーが流れる」というようなページを手軽に作る方法です。 【スプラッシュページという手法】 Web制作には、「スプラッシュページ」という手法があります。これは実際のトップペ ...続きを読む...
Related posts brought to you by Yet Another Related Posts Plugin.]]>

.htaccessでの指定で、HTTPのアクセスをHTTPSにリダイレクトします。

RewriteEngine on
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^/home/dacelo/html/(.*) http://%{HTTP_HOST}/$1 [R=301,L]

解説

443ポート、すなわちHTTPSに来たアクセスを、HTTPにリライトしています。
逆にHTTP→HTTPSにする場合は、リライトルールを 80番ポートにして、HTTPSに送るようにすればOKです。 :-P

Related posts:

  1. 同一URLのままでスプラッシュページを作る 「最初の訪問時だけ、トップページでフラッシュ・ムービーが流れる」というようなページを手軽に作る方法です。 【スプラッシュページという手法】 Web制作には、「スプラッシュページ」という手法があります。これは実際のトップペ ...続きを読む...

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-792.html/feed 2
ApacheがRestartできない!(98)Address already in use: make_sock… http://blog.dacelo.info/apache/entry-782.html?utm_source=rss&utm_medium=rss&utm_campaign=apache%25e3%2581%258crestart%25e3%2581%25a7%25e3%2581%258d%25e3%2581%25aa%25e3%2581%2584%25ef%25bc%258198address-already-in-use-make_sock%25e2%2580%25a6 http://blog.dacelo.info/apache/entry-782.html#comments Fri, 26 Mar 2010 13:59:30 +0000 http://blog.dacelo.info/apache/entry-782.html 続きを読む Related posts:
  1. apacheの prefork.cとworker.cの違い /etc/httpd/conf/httpd.conf を見ると、KeepAliveとかMaxClientとかの設定をする部分が、2つあることに気付きます。 # prefork MPM   StartServer ...続きを読む...
  2. メールのエラー「postdrop: warning: unable to look up public/pickup: No such file or directory」 サーバーのメールコマンドを使おうとしたら、こんなエラーが返ってきました。 [dacelo@dacelo.info ~]$ postdrop: warning: unable to look up public/picku...
Related posts brought to you by Yet Another Related Posts Plugin.]]>

Apacheが突然死しているようなので再起動してみたら、どうもおかしい。
一旦立ち上がったんだけど、もう一度リスタートかけようとすると、こんなエラーメッセージが出て、停止もできない。

[root@www home]# service httpd restart
httpd を停止中: [失敗]
httpd を起動中: (98)Address already in use: make_sock: could not bind to address [::]:80
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[失敗]

これは通常、ポート80を他のプロセスが使用しているときに出るエラーメッセージ。
どうやらApacheが異常終了したせいで、古いApacheのプロセスが残っているのを、新しいApacheが「80番ポートが使われている!?」と誤解しているらしい。

lsofでhttpのプロセスを調べ、一つずつ強制KILLすると解決する。

[root@www ~]# /usr/sbin/lsof -i | grep http
httpd 7524 apache 3u IPv6 401602 TCP *:http (LISTEN)
httpd 7524 apache 5u IPv6 401607 TCP *:https (LISTEN)

こいつらが80番ポートに居残っているプロセス。

[root@www ~]# kill -9 7464
[root@www ~]# kill -9 7491

キル!キル!

[root@www ~]# service httpd restart
httpd を停止中: [失敗]
httpd を起動中: [ OK ]

全部キルしたらすっきりリスタートできるようになりました。

Related posts:

  1. apacheの prefork.cとworker.cの違い /etc/httpd/conf/httpd.conf を見ると、KeepAliveとかMaxClientとかの設定をする部分が、2つあることに気付きます。 # prefork MPM   StartServer ...続きを読む...
  2. メールのエラー「postdrop: warning: unable to look up public/pickup: No such file or directory」 サーバーのメールコマンドを使おうとしたら、こんなエラーが返ってきました。 [dacelo@dacelo.info ~]$ postdrop: warning: unable to look up public/picku...

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-782.html/feed 1
apacheのトリビア http://blog.dacelo.info/apache/entry-769.html?utm_source=rss&utm_medium=rss&utm_campaign=apach%25e3%2581%25ae%25e3%2583%2588%25e3%2583%25aa%25e3%2583%2593%25e3%2582%25a2 http://blog.dacelo.info/apache/entry-769.html#comments Wed, 27 Jan 2010 08:57:54 +0000 http://blog.dacelo.info/apache/entry-769.html 続きを読む No related posts. Related posts brought to you by Yet Another Related Posts Plugin.]]>

apacheのServerAliasには、果たしてどのくらいまで登録できるのか?
検証してみました。
【結論:8719byteまでOK】
ドメイン数ではなく、文字数で限界が設定されていました。

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-769.html/feed 1
httpd.confでsafe_modeをon/offにする http://blog.dacelo.info/apache/entry-765.html?utm_source=rss&utm_medium=rss&utm_campaign=httpd-conf%25e3%2581%25a7safe_mode%25e3%2582%2592onoff%25e3%2581%25ab%25e3%2581%2599%25e3%2582%258b http://blog.dacelo.info/apache/entry-765.html#comments Tue, 05 Jan 2010 06:44:56 +0000 http://blog.dacelo.info/apache/entry-765.html 続きを読む Related posts:
  1. Linux : ファイルにテキストを追記で書き込む Linuxコマンドでは「 > ファイル名」と入力すれば、画面に出力されるものはなんでもそのファイルに書き込むことができます。 例えば、echo でaaaと書き込んでみましょう。 [dacelo@info&# ...続きを読む...
  2. 公開鍵ファイルauthorized_keysの設置場所とパーミッション Linuxで鍵を作成するには、ssh-keygenコマンドを使用します。 で、出来た鍵を置く際のパーミッションで、よくハマる箇所があるのでメモ書き。 ファイル 場所 パーミッション ユーザールート /user 701 S ...続きを読む...
  3. メールのエラー「postdrop: warning: unable to look up public/pickup: No such file or directory」 サーバーのメールコマンドを使おうとしたら、こんなエラーが返ってきました。 [dacelo@dacelo.info ~]$ postdrop: warning: unable to look up public/picku...
Related posts brought to you by Yet Another Related Posts Plugin.]]>

皆様、明けましておめでとうございます。いやぁ、早いものでこのブログも2年目なんですね。今年もちょぼちょぼと更新してまいりますのでよろしくお願いいたします。

さて、今回はsafe_modeについて。
phpのsafe_modeは、PHP6で正式に削除されることが決定しているので、使わないことが推奨されているんですが、まぁ諸々の事情で使わざるを得ないことがあります。
通常、php.iniでon/offを切り替えるんですが、使うんであれば限定的に、あるサイトのバーチャルホストの中だけで有効にしたい、というような気持ちってありますね。

そんなときは、httpd.confにて次のように書きます。

<VirtualHost 192.168.11.111:80>
    DocumentRoot /home/blog.dacelo.info/
    ServerName blog.dacelo.info
    <Directory "/home/blog.dacelo.info">
    AllowOverride All
    Options ExecCGI FollowSymlinks
    </Directory>
    <IfModule mod_php5.c>
      php_admin_flag safe_mode on
    </IfModule> 
</VirtualHost>

これで、blog.dacelo.infoの中でだけsafe_modeがonになりました。

Related posts:

  1. Linux : ファイルにテキストを追記で書き込む Linuxコマンドでは「 > ファイル名」と入力すれば、画面に出力されるものはなんでもそのファイルに書き込むことができます。 例えば、echo でaaaと書き込んでみましょう。 [dacelo@info&# ...続きを読む...
  2. 公開鍵ファイルauthorized_keysの設置場所とパーミッション Linuxで鍵を作成するには、ssh-keygenコマンドを使用します。 で、出来た鍵を置く際のパーミッションで、よくハマる箇所があるのでメモ書き。 ファイル 場所 パーミッション ユーザールート /user 701 S ...続きを読む...
  3. メールのエラー「postdrop: warning: unable to look up public/pickup: No such file or directory」 サーバーのメールコマンドを使おうとしたら、こんなエラーが返ってきました。 [dacelo@dacelo.info ~]$ postdrop: warning: unable to look up public/picku...

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-765.html/feed 4
httpd.confでRedirectの設定 http://blog.dacelo.info/apache/entry-714.html?utm_source=rss&utm_medium=rss&utm_campaign=httpdconf%25e3%2581%25a7redirect%25e3%2581%25ae%25e8%25a8%25ad%25e5%25ae%259a http://blog.dacelo.info/apache/entry-714.html#comments Tue, 26 May 2009 06:08:52 +0000 http://blog.dacelo.info/apache/entry-714.html 続きを読む No related posts. Related posts brought to you by Yet Another Related Posts Plugin.]]>

Webサイトの移転で必須のRedirect設定、.htaccessでやることが多いですが、
Apacheの設定ファイル・httpd.confでやってしまうと一括指定できて早いです。

<VirtualHost 192.168.0.200>
ServerName old.example.jp
Redirect permanent / http://www.example.com/
</VirtualHost>

上記例では、使わなくなったサブドメイン「old」をwwwに恒久的リダイレクトさせています。
複数のサブドメインを指定する際には、ServerAliasで設定すればOKです。

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-714.html/feed 0
Apacheのエラー:Could not reliably determine the server’s fully qualified domain name… http://blog.dacelo.info/apache/entry-713.html?utm_source=rss&utm_medium=rss&utm_campaign=apache%25e3%2581%25ae%25e3%2582%25a8%25e3%2583%25a9%25e3%2583%25bc%25ef%25bc%259acould-not-reliably-determine-the-servers-fully-qualified-domain-name-2 http://blog.dacelo.info/apache/entry-713.html#comments Mon, 25 May 2009 01:25:47 +0000 http://blog.dacelo.info/uncategorized/entry-713.html 続きを読む Related posts:
  1. apacheの prefork.cとworker.cの違い /etc/httpd/conf/httpd.conf を見ると、KeepAliveとかMaxClientとかの設定をする部分が、2つあることに気付きます。 # prefork MPM   StartServer ...続きを読む...
  2. UbuntuのApache2でmod_rewriteを使う UbuntuのApacheは、初期状態ではmod_rewriteが動いていない。 が、インストールはされているので、有効化してあげてApache再起動してあげれば解決。 dacelo@ubt:/var/www$ sudo ...続きを読む...
Related posts brought to you by Yet Another Related Posts Plugin.]]>

Apacheを再起動した際に、

httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

というエラーが出る場合がある。
これでも起動はするので、Apache自体は動くのだが、エラーをそのままにしておくのは気持ちが悪いし、あとあと問題を引き起こす可能性が高い。

日本語訳をすると

ServerNameに127.0.0.1を使用した、FQDN(完全に適切なドメイン名)が確定できませんでした。

といった感じか。

このエラーは、/etc/hosts にlocalhost以外に自分で設定したホスト名が、Apacheの設定ファイルに定義されていないために発生する。

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               dacelo localhost.localdomain localhost

と書いた場合、/etc/httpd/conf/httpd.conf のServerNameの設定にも次のように書いておく。

# 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 dacelo:80

Related posts:

  1. apacheの prefork.cとworker.cの違い /etc/httpd/conf/httpd.conf を見ると、KeepAliveとかMaxClientとかの設定をする部分が、2つあることに気付きます。 # prefork MPM   StartServer ...続きを読む...
  2. UbuntuのApache2でmod_rewriteを使う UbuntuのApacheは、初期状態ではmod_rewriteが動いていない。 が、インストールはされているので、有効化してあげてApache再起動してあげれば解決。 dacelo@ubt:/var/www$ sudo ...続きを読む...

Related posts brought to you by Yet Another Related Posts Plugin.

]]>
http://blog.dacelo.info/apache/entry-713.html/feed 14