apache2がworkerにならない

このQ&Aのポイント
  • apache2をworker MPMでインストールしたのですが、prefork MPMとしてインストールされています。
  • どうすればworker MPMを使用できるでしょうか?
  • OSはFreeBSD4.6で、configure内容はenv OPTIM=-O2 ./configure --enable-layout=Apache --with-mpm=worker --enable-shared=max --enable-rewrite --disable-autoindex --disable-imap --disable-userdir --disable-alias --disable-include --disable-userdです。
回答を見る
  • ベストアンサー

apache2がworkerにならない

apache2をworker MPMでインストールしたのですが、httpd -lで確認するとどう してもprefork MPMとしてインストールされています。 どうすればworker MPMを使用出来るでしょうか? OS:FreeBSD4.6 configure内容:env OPTIM=-O2 ./configure --enable-layout=Apache --with-mpm=worker --enable-shared=max --enable-rewrite --disable-autoindex --disable-imap --disable-userdir --disable-alias --disable-include --disable-userd

  • _777_
  • お礼率58% (7/12)

質問者が選んだベストアンサー

  • ベストアンサー
  • Lean
  • ベストアンサー率72% (435/603)
回答No.1

INSTALLの「Quick Start - Unix」のNOTESに以下のように書かれています。 FreeBSDの場合デフォルトでprefork MPMになります。 また、同様に書かれているようにスレッドを使用するMPM(worker/perchild)を使用したい場合には、configure実行時に「--enable-threads」を指定する必要があります。 -------8<-------8<-------8<-------8<------- * If you are building on FreeBSD, be aware that threads will  be disabled and the prefork MPM will be used by default,  as threads do not work well with Apache on FreeBSD. If  you wish to try a threaded Apache on FreeBSD anyway, use  "./configure --enable-threads". -------8<-------8<-------8<-------8<------- ちなみに %uname -r 4.10-STABLE な環境で2.0.53で貴殿が書いたconfigureの実行イメージに「--enable-threads」を追加して作成したApacheのhttpd -lの結果は以下のようになります。 %./httpd -l Compiled in modules: core.c mod_access.c mod_auth.c mod_log_config.c mod_env.c mod_setenvif.c worker.c http_core.c mod_mime.c mod_status.c mod_asis.c mod_cgid.c mod_negotiation.c mod_dir.c mod_actions.c mod_rewrite.c mod_so.c

_777_
質問者

お礼

Lean様、回答をして頂いたのに返答が遅くなってしまって申し訳ありません…。 Lean様が回答して下さったように、configureを実行する際に「--enable-threads」を追記して実行してみました所、mpmがworkerになりました! インストール後にhttpd -lで「worker.c」となっている事を確認致しました。 INSTALLには目を通していませんでした…。 英語なので最初から読む気さえありませんでした(ダメですね)。 とりあえずマニュアルをちゃんと読むという事をしようと反省しました。 この度は本当にありがとうございました!

関連するQ&A

  • Apache2.0のインストール及び起動について

    はじめまして、 RedHat9に対してApache2.0(2.0.33)を下記のような方法でインストールしたのですが、Apacheが起動しません。 apachectl start を実行しても、エラーは発生しないのですが、プロセスが存在しません。 どなたか、同様の現象が発生した方がいらっしゃいましたら、何卒解決方法をご教授願います。 [Apacheインストール方法] ・ソースファイルよりインストール [configureオプション] ./configure \ --enable-ssl=shared \ --with-ssl=/usr/local/ssl \ --enable-so \ --enable-access=shared \ --enable-auth=shared \ --enable-auth_anon=shared \ --enable-include=shared \ --enable-env=shared \ --enable-mime_magic=shared \ --enable-cern_meta=shared \ --enable-expires=shared \ --enable-deflate=shared \ --enable-headers=shared \ --enable-usertrack=shared \ --enable-unique_id=shared \ --enable-setenvif=shared \ --enable-mime=shared \ --enable-dav=shared \ --enable-status=shared \ --enable-autoindex=shared \ --enable-asis=shared \ --enable-info=shared \ --enable-vhost_alias=shared \ --enable-negotiation=shared \ --enable-dir=shared \ --enable-imap=shared \ --enable-actions=shared \ --enable-alias=shared \ --enable-rewrite=shared \ --enable-cache=shared \ --enable-disk_cache=shared \ --enable-file_cache=shared \ --enable-mem_cache=shared \ --enable-cgi=shared ------- 長くなってしまい申し訳ございませんが、 何卒よろしくお願い致します

  • yumで実現するには

    ./configure \ --enable-so \ --enable-rewrite \ --with-mpm=prefork をyumでのインストールで実現するにはどのようにすればよろしいでしょうか? よろしくお願いします。

  • Fedora Core6にApacheをインストールしたい

    Fedora Core6を導入しています。 これにApacheをインストールしたいのですが、以下のように実行するとエラーが出てインストールできません。 # ./configure \ > --enable-mods-shared=all \ > --enable-proxy=shared \ > --disable-ipv6 \ > --prefix=/usr/local/src/origdev/opt/apache2 エラーメッセージとして checking whether to enable mod_deflate... configure: error: mod_deflate has been requested but can not be built due to prerequisite failures このように出ます。 この状態で#makeをして#make installをしても失敗します。 解決策はありませんか?

  • アクセスが多い場合のApacheの設定について?

    アクセスが多いサイトを運用しておりますが、Topコマンドで見ると、すぐにCPUが99%になってしまます。 ロードアベレージは、1前後です。 この場合、どの様にApacheを設定すべきでしょうか? 要するに、CPU値を安定させたいのですが。 今、Apache2を入れおりまして、以下の様になっております。 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 200 MaxRequestsPerChild 100 </IfModule> # worker MPM # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_worker_module> StartServers 2 MaxClients 200 MinSpareThreads 25 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 200 MaxRequestsPerChild 100 </IfModule> # worker MPM # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_worker_module> StartServers 2 MaxClients 200 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 100 <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 200 MaxRequestsPerChild 100 </IfModule> MaxKeepAliveRequest は、300で、Timeoutは30です。 修正すべき箇所はございますか?

  • Apache+SuexecでForbidden

    Apache 2.4.18 + PHP 5.6.18 で Suexec VirtualHost & Suexecを用いて、PHPの実行権を 各VirtualHostで異なるようにしたいのですが gdtest.php を /usr/local/apache2/htdocs に置いて http://172.16.72.152/gdtest.php では正常動作しますが gdtest.php を /home/user1/public_html に置いて http://dummy-host1.XXXXXXX.jp/gdtest.php では Forbidden You don't have permission to access /php-user1/php_user-cgi/gdtest.php on this server と表示されます。 以下に当方の情報をお示しますので、どこが間違っているのか ご指摘いだだけますようお願いいたします。 1.Apache config ./configure --prefix=/usr/local/apache2 \ --with-apr=/usr/local/apr/apr-1.5.2 \ --with-apr-util=/usr/local/apr-util/apr-util-1.5.4 \ --with-pcre=/usr/local/pcre/pcre-8.38 \ --with-mpm=prefork \ --with-suexec-userdir=public_html \ --with-suexec-docroot=/home \ --with-suexec-caller=daemon \ --enable-suexec apache は User daemon, Group daemon で動作する 2.PHP config phpinfo()で確認 Configure Command : './configure' '--enable-mbstring=ja' '--enable-bcmath' '--with-gd' '--with-freetype-dir=/usr/include/' '--with-png-dir=/usr/include' '--with-jpeg-dir=/usr/include' Server API : CGI/FastCGI Virtual Directory Support : disabled Loaded Configuration File : /usr/local/lib/php.ini : 3.Virtual Hostは正常動作 /usr/local/apache2/conf/extra/httpd-vhosts.conf # 1st priority <VirtualHost 172.16.72.152:80> ServerAdmin root@172.16.72.152 DocumentRoot "/usr/local/apache2/htdocs" ServerName 172.16.72.152:80 ErrorLog "logs/error_log" CustomLog "logs/access_log" common ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/" <Directory "/usr/local/apache2/htdocs"> Options Indexes FollowSymLinks AllowOverride All Action php56 /cgi-bin/php56-cgi AddHandler php56 .php Require all granted </Directory> </VirtualHost> # 2nd priority <VirtualHost 172.16.72.152:80> ServerAdmin root@172.16.72.152 DocumentRoot "/home/user1/public_html" ServerName dummy-host1.XXXXXXX.jp ErrorLog "logs/dummy-host1-error_log" CustomLog "logs/dummy-host1-access_log" common SuexecUserGroup user1 user1 ScriptAlias /cgi-bin/ "/home/user1/cgi-bin/" Action php_user1 /cgi-bin/php_user1-cgi AddHandler php_user1 .php <Directory "/home/user1/public_html"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted </Directory> </VirtualHost> 4.suexec -V -D AP_DOC_ROOT="/home" -D AP_GID_MIN=100 -D AP_HTTPD_USER="daemon" -D AP_LOG_EXEC="/usr/local/apache2/logs/suexec_log" -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin" -D AP_UID_MIN=100 -D AP_USERDIR_SUFFIX="public_html" 5. httpd -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_prefork_module (static) authn_file_module (shared) authn_core_module (shared) authz_host_module (shared) authz_groupfile_module (shared) authz_user_module (shared) authz_core_module (shared) access_compat_module (shared) auth_basic_module (shared) reqtimeout_module (shared) filter_module (shared) mime_module (shared) log_config_module (shared) env_module (shared) headers_module (shared) setenvif_module (shared) version_module (shared) unixd_module (shared) status_module (shared) autoindex_module (shared) suexec_module (shared) cgid_module (shared) vhost_alias_module (shared) dir_module (shared) actions_module (shared) userdir_module (shared) alias_module (shared) 6. directory, file関係 755 user1 user1 /home/user1/cgi-bin <-- daemon でも変わらない 755 user1 user1 /home/user1/cgi-bin/php_user1-cgi cgi版phpである /usr/local/apache2/cgi-bin/pgp56-cgi を php_user1-cgi としてコピー 755 user1 user1 /home/user1/public_html/gdtest.php /home, /home/user1 もパーミッションは 755 7. log messages 172.16.72.152 - - [09/Feb/2016:15:13:30 +0900] "GET /gdtest.php HTTP/1.1" 403 241 [/usr/local/apache2/logs/dummy-host1-error_log] [Tue Feb 09 15:13:] [authz_core:error] [pid 4905] [client 172.16.72.152:43902] AH01630: client denied by server configuration: /home/user1/cgi-bin/php_user1-cgi

  • Apacheモジュールの追加方法

    ./configure --enable-module=so --enable-shared=max --activate-module= src/modules/php4/libphp4.a で、ApacheをLinuxへインストールしたのですが、mod_userdir.soがないというエラーになります。 モジュールを追加するにはどうすれば良いでしょうか? /etc/rc.d/init.d/httpd start Starting httpd: Syntax error on line 217 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/mod_userdir.so into server: /usr/local/apache/libexec/mod_user dir.so: undefined symbol: ap_os_is_path_absolute 又、Apacheはmodule=maxだとWWWサーバが 重くなるでしょうか?

  • Apache1.3にmod_sslを追加インストール

    こんにちは。 まず、Apacheをインストールします。 tar zxvf apache1.3.33.tar.gz cd apache1.3.33 ./configure --enable-shared=max make make install このあとに、mod_sslを追加しようと思いインストールします。 tar zxvf mod_ssl-2.8.24-1.3.33.tar.gz cd mod_ssl-2.8.24-1.3.33 ./configure --with-apache=../apache1.3.33 --enable-ssl=/usr/local --enable-shared=max cd ../apache1.3.33 make make certificate make install そうすると下記のエラーになってしまいます。 [root@localhost apache_1.3.33]# /usr/local/apache/bin/apachectl startssl [Sat Sep 10 23:28:58 2005] [warn] Loaded DSO libexec/mod_mmap_static.so uses plain Apache 1.3 API, this module might crash under EAPI! (please recompile it with -DEAPI) ※途中削除 Syntax error on line 226 of /usr/local/apache/conf/httpd.conf: Cannot load /usr/local/apache/libexec/mod_rewrite.so into server: /usr/local/apache/libexec/mod_rewrite.so: undefined symbol: dbm_fetch /usr/local/apache/bin/apachectl startssl: httpd could not be started Apacheが入ってない状態で、mod_sslをインストールすれば上手くいくのですが。 どうしてこういうエラーが出てしまうのでしょうか? よろしくお願いします。

  • Apache1.33 PHP4.3.9 でApacheが起動できない

    ■環境 Microsoft Virtual PC 上でFreeBSD動作(WindowsXP Serviec Pack 2) FreeBSD4.10 Apache1.3.3 PHP4.3.9 PostgreSQL8.2.4 ○Apache1.3.3のインストール ./configure --enable-shared=max --enable-module=most make make install ○PHP4.3.9のインストール ./configure --without-mysql --with-apxs=/usr/local/apache/sbin/apxs --enable-mbstring --with-pgsql make make install cp php.ini-dist /usr/local/lib/php.ini ○/usr/local/apache/etc/httpd.conf の内容 ----------------------------------------------------------- # Example: # LoadModule foo_module libexec/mod_foo.so LoadModule env_module libexec/mod_env.so LoadModule config_log_module libexec/mod_log_config.so LoadModule mime_magic_module libexec/mod_mime_magic.so LoadModule mime_module libexec/mod_mime.so LoadModule nagotiation_module libexec/mod_nagotiation.so LoadModule status_module libexec/mod_status.so LoadModule info_module libexec/mod_info.so LoadModule includes_module libexec/mod_include.so LoadModule autoindex_module libexec/mod_autoindex.so LoadModule dir_module libexec/mod_dir.so LoadModule cgi_module libexec/mod_cgi.so LoadModule asis_module libexec/mod_asis.so LoadModule imap_module libexec/mod_imap.so LoadModule action_module libexec/mod_actions.so LoadModule speling_module libexec/mod_speling.so LoadModule userdir_module libexec/mod_userdir.so LoadModule proxy_module libexec/mod_libproxy.so LoadModule alias_module libexec/mod_alias.so LoadModule rewrite_module libexec/mod_rewrite.so LoadModule access_module libexec/mod_access.so LoadModule auth_module libexec/mod_auth.so LoadModule anon_auth_module libexec/mod_auth_anon.so LoadModule dbm_auth_module libexec/mod_auth_dbm.so LoadModule digest_module libexec/mod_digest.so LoadModule cern_meta_module libexec/mod_cern_meta.so LoadModule expires_module libexec/mod_expires.so LoadModule headers_module libexec/mod_headers.so LoadModule usertrack_module libexec/mod_usertrack.so LoadModule unique_id_module libexec/mod_unique_id.so LoadModule setenvif_module libexec/mod_setenvif.so LoadModule php4_module libexec/libphp4.so # Reconstruction of the complete module list from all available modules # (static and shared ones) to achieve correct module execution order. # [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO] ClearModuleList AddModule mod_env.c AddModule mod_log_config.c AddModule mod_mime_magic.c AddModule mod_mime.c AddModule mod_nagotiation.c AddModule mod_status.c AddModule mod_info.c AddModule mod_include.c AddModule mod_autoindex.c AddModule mod_dir.c AddModule mod_cgi.c AddModule mod_asis.c AddModule mod_imap.c AddModule mod_actions.c AddModule mod_speling.c AddModule mod_userdir.c AddModule mod_proxy.c AddModule mod_alias.c AddModule mod_rewrite.c AddModule mod_access.c AddModule mod_auth.c AddModule mod_auth_anon.c AddModule mod_auth_dbm.c AddModule mod_digest.c AddModule mod_cern_meta.c AddModule mod_expires.c AddModule mod_headers.c AddModule mod_usertrack.c AddModule mod_unique_id.c AddModule mod_so.c AddModule mod_setenvif.c AddModule mod_php4.c AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps ------------------------------------------------ 以下のコマンドでapacheを起動しようとすると /usr/local/apache/sbin/apachectl start 下記のエラーが発生してしまいます。どうか解決策を教えてください。 /usr/local/apache/sbin/apachectl start Syntax error on line 26 of /usr/local/apache/etc/httpd.conf Cannot load /usr/local/apache/libexec/mode_env.so into server : /usr/local/apache/ libexec/mod_env.so: Undefined symbol "ap_palloc" /usr/local/apache/sbin/apachectl start: httpd could not be started

  • 続 apacheのインストール

    ./configure --prefix=/opt/apache \ Apacheのインストール先を指定 --enable-module=so DSOをサポート という指示なのですが、¥ってどこを押すと出てくるのでしょうか?

  • apacheのインストールがうまく行きません

    環境はUbuntu64bitです。 このサイトを参考にしました。http://www.whitemark.co.jp/tec/apache/InstallLinApache22.html ファイルをダウンロードして # tar zxvf httpd-2.4.6.tar.gz # cd httpd-2.4.6 # ./configure --enable-mods-shared=all ここまでは上手く行きます。 しかしmakeを実行すると make: *** ターゲットが指定されておらず, makefile も見つかりません. 中止. と出てインストールすることができません。助けてください

    • ベストアンサー
    • PHP