質問: 仮想ホストの構成後、apacheが再起動しない webサーバーを作成しようとしていますが、仮想ホスト構成を追加した後、apacheが再起動しません。いくつかのエラーがありましたが、私はそれらのほとんどを修正することができました。 journalctl -xnからヒントが得られないので、何が起こっているのかわかりません。ここにログがあります:[root@localhost victorscarone]# systemctl restart httpd.service job for httpd.service failed. see 'systemctl status httpd.service' and 'journalctl -xn' for details. [root@localhost victorscarone]# systemctl status httpd.service httpd.service - the apache http server loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) active: failed (result: exit-code) since vie 2015-09-11 22:54:27 pyt; 2s ago process: 2681 execstop=/bin/kill -winch ${mainpid} (code=exited, status=1/failure) process: 2679 execstart=/usr/sbin/httpd $options -dforeground (code=exited, status=1/failure) main pid: 2679 (code=exited, status=1/failure) sep 11 22:54:27 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/failure sep 11 22:54:27 localhost.localdomain kill[2681]: kill: cannot find process "" sep 11 22:54:27 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 sep 11 22:54:27 localhost.localdomain systemd[1]: failed to start the apache http server. sep 11 22:54:27 localhost.localdomain systemd[1]: unit httpd.service entered failed state. [root@localhost victorscarone]# journalctl -xn -- logs begin at vie 2015-09-11 22:20:49 pyt, end at vie 2015-09-11 22:54:27 pyt. -- sep 11 22:48:29 localhost.localdomain kill[2658]: kill: cannot find process "" sep 11 22:48:29 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 sep 11 22:48:29 localhost.localdomain systemd[1]: failed to start the apache http server. -- subject: unit httpd.service has failed -- defined-by: systemd -- -- unit httpd.service has failed. -- -- the result is failed. sep 11 22:48:29 localhost.localdomain systemd[1]: unit httpd.service entered failed state. sep 11 22:54:27 localhost.localdomain systemd[1]: starting the apache http server... -- subject: unit httpd.service has begun with start-up -- defined-by: systemd -- -- unit httpd.service has begun starting up. sep 11 22:54:27 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/failure sep 11 22:54:27 localhost.localdomain kill[2681]: kill: cannot find process "" sep 11 22:54:27 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 sep 11 22:54:27 localhost.localdomain systemd[1]: failed to start the apache http server. -- subject: unit httpd.service has failed -- defined-by: systemd -- -- unit httpd.service has failed. -- -- the result is failed. sep 11 22:54:27 localhost.localdomain systemd[1]: unit httpd.service entered failed state. 助けてください、それは正当な理由のためです(私の大学の仕事:d)編集#1(2015年9月12日19:30 gmt -4)何をしたかはわかりませんが、「httpd -t」コマンド@gareththeredをテストするとわかりました。「httpd -h」を試して実行しました。次に、「apachectl restart」を実行すると、同じエラーが発生しました。しかし、今回は "journalctl -xn"を見たときに変更がありました。 apacheにはまだエラーがありますが、テストページ123ですでに実行されています。ただし、vhostはまだ機能していません。その後の出力は次のとおりです。[root@localhost victorscarone]# httpd -t syntax ok [root@localhost victorscarone]# httpd --help [root@localhost victorscarone]# httpd --h httpd (pid 2977) already running [root@localhost victorscarone]# systemctl status httpd.service httpd.service - the apache http server loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled) active: failed (result: exit-code) since sáb 2015-09-12 19:12:42 pyt; 4min 53s ago process: 2965 execstop=/bin/kill -winch ${mainpid} (code=exited, status=1/failure) process: 2963 execstart=/usr/sbin/httpd $options -dforeground (code=exited, status=1/failure) main pid: 2963 (code=exited, status=1/failure) sep 12 19:12:42 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/failure sep 12 19:12:42 localhost.localdomain kill[2965]: kill: cannot find process "" sep 12 19:12:42 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 sep 12 19:12:42 localhost.localdomain systemd[1]: failed to start the apache http server. sep 12 19:12:42 localhost.localdomain systemd[1]: unit httpd.service entered failed state. hint: some lines were ellipsized, use -l to show in full. [root@localhost victorscarone]# apachectl restart job for httpd.service failed. see 'systemctl status httpd.service' and 'journalctl -xn' for details. [root@localhost victorscarone]# journalctl -xn -- logs begin at sáb 2015-09-12 19:07:51 pyt, end at sáb 2015-09-12 19:18:32 pyt. -- sep 12 19:18:18 localhost.localdomain kill[2993]: kill: cannot find process "" sep 12 19:18:18 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 sep 12 19:18:18 localhost.localdomain systemd[1]: failed to start the apache http server. -- subject: unit httpd.service has failed -- defined-by: systemd -- -- unit httpd.service has failed. -- -- the result is failed. sep 12 19:18:18 localhost.localdomain systemd[1]: unit httpd.service entered failed state. sep 12 19:18:32 localhost.localdomain systemd[1]: starting the apache http server... -- subject: unit httpd.service has begun with start-up -- defined-by: systemd -- -- unit httpd.service has begun starting up. sep 12 19:18:32 localhost.localdomain httpd[3001]: httpd (pid 2977) already running sep 12 19:18:32 localhost.localdomain kill[3003]: kill: cannot find process "" sep 12 19:18:32 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1 sep 12 19:18:32 localhost.localdomain systemd[1]: failed to start the apache http server. -- subject: unit httpd.service has failed -- defined-by: systemd -- -- unit httpd.service has failed. -- -- the result is failed. sep 12 19:18:32 localhost.localdomain systemd[1]: unit httpd.service entered failed state. [root@localhost victorscarone]# httpd -t syntax ok 何か案は?編集#2 2015年9月24日19:29(gmt -4)遅れてすみません。これを続行する時間がありませんでしたが、今は再びそれに取り組んでいます。 @gareththeredが言ったことを試してみましたが、ある時点で行き詰まります[root@localhost victorscarone]# httpd -dforeground -e debug [thu sep 24 19:26:01.249663 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module access_compat_module from /etc/httpd/modules/mod_access_compat.so [thu sep 24 19:26:01.249913 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module actions_module from /etc/httpd/modules/mod_actions.so [thu sep 24 19:26:01.249975 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module alias_module from /etc/httpd/modules/mod_alias.so [thu sep 24 19:26:01.250021 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module allowmethods_module from /etc/httpd/modules/mod_allowmethods.so [thu sep 24 19:26:01.250065 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module auth_basic_module from /etc/httpd/modules/mod_auth_basic.so [thu sep 24 19:26:01.250130 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module auth_digest_module from /etc/httpd/modules/mod_auth_digest.so [thu sep 24 19:26:01.250180 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authn_anon_module from /etc/httpd/modules/mod_authn_anon.so [thu sep 24 19:26:01.250230 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authn_core_module from /etc/httpd/modules/mod_authn_core.so [thu sep 24 19:26:01.250277 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authn_dbd_module from /etc/httpd/modules/mod_authn_dbd.so [thu sep 24 19:26:01.250324 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authn_dbm_module from /etc/httpd/modules/mod_authn_dbm.so [thu sep 24 19:26:01.250368 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authn_file_module from /etc/httpd/modules/mod_authn_file.so [thu sep 24 19:26:01.250422 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authn_socache_module from /etc/httpd/modules/mod_authn_socache.so [thu sep 24 19:26:01.250484 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authz_core_module from /etc/httpd/modules/mod_authz_core.so [thu sep 24 19:26:01.250541 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authz_dbd_module from /etc/httpd/modules/mod_authz_dbd.so [thu sep 24 19:26:01.250597 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authz_dbm_module from /etc/httpd/modules/mod_authz_dbm.so [thu sep 24 19:26:01.250650 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authz_groupfile_module from /etc/httpd/modules/mod_authz_groupfile.so [thu sep 24 19:26:01.250701 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authz_host_module from /etc/httpd/modules/mod_authz_host.so [thu sep 24 19:26:01.250857 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authz_owner_module from /etc/httpd/modules/mod_authz_owner.so [thu sep 24 19:26:01.250914 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module authz_user_module from /etc/httpd/modules/mod_authz_user.so [thu sep 24 19:26:01.250986 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module autoindex_module from /etc/httpd/modules/mod_autoindex.so [thu sep 24 19:26:01.251082 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module cache_module from /etc/httpd/modules/mod_cache.so [thu sep 24 19:26:01.251370 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module cache_disk_module from /etc/httpd/modules/mod_cache_disk.so [thu sep 24 19:26:01.251431 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module data_module from /etc/httpd/modules/mod_data.so [thu sep 24 19:26:01.251498 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module dbd_module from /etc/httpd/modules/mod_dbd.so [thu sep 24 19:26:01.251662 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module deflate_module from /etc/httpd/modules/mod_deflate.so [thu sep 24 19:26:01.251805 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module dir_module from /etc/httpd/modules/mod_dir.so [thu sep 24 19:26:01.251873 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module dumpio_module from /etc/httpd/modules/mod_dumpio.so [thu sep 24 19:26:01.251929 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module echo_module from /etc/httpd/modules/mod_echo.so [thu sep 24 19:26:01.251985 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module env_module from /etc/httpd/modules/mod_env.so [thu sep 24 19:26:01.252044 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module expires_module from /etc/httpd/modules/mod_expires.so [thu sep 24 19:26:01.252113 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module ext_filter_module from /etc/httpd/modules/mod_ext_filter.so [thu sep 24 19:26:01.252184 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module filter_module from /etc/httpd/modules/mod_filter.so [thu sep 24 19:26:01.252309 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module headers_module from /etc/httpd/modules/mod_headers.so [thu sep 24 19:26:01.252392 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module include_module from /etc/httpd/modules/mod_include.so [thu sep 24 19:26:01.252475 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module info_module from /etc/httpd/modules/mod_info.so [thu sep 24 19:26:01.252547 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module log_config_module from /etc/httpd/modules/mod_log_config.so [thu sep 24 19:26:01.252611 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module logio_module from /etc/httpd/modules/mod_logio.so [thu sep 24 19:26:01.252684 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module mime_magic_module from /etc/httpd/modules/mod_mime_magic.so [thu sep 24 19:26:01.252822 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module mime_module from /etc/httpd/modules/mod_mime.so [thu sep 24 19:26:01.252916 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module negotiation_module from /etc/httpd/modules/mod_negotiation.so [thu sep 24 19:26:01.252985 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module remoteip_module from /etc/httpd/modules/mod_remoteip.so [thu sep 24 19:26:01.253050 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module reqtimeout_module from /etc/httpd/modules/mod_reqtimeout.so [thu sep 24 19:26:01.253150 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module rewrite_module from /etc/httpd/modules/mod_rewrite.so [thu sep 24 19:26:01.253219 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module setenvif_module from /etc/httpd/modules/mod_setenvif.so [thu sep 24 19:26:01.253303 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module slotmem_plain_module from /etc/httpd/modules/mod_slotmem_plain.so [thu sep 24 19:26:01.253373 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module slotmem_shm_module from /etc/httpd/modules/mod_slotmem_shm.so [thu sep 24 19:26:01.253440 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module socache_dbm_module from /etc/httpd/modules/mod_socache_dbm.so [thu sep 24 19:26:01.253503 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module socache_memcache_module from /etc/httpd/modules/mod_socache_memcache.so [thu sep 24 19:26:01.253567 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module socache_shmcb_module from /etc/httpd/modules/mod_socache_shmcb.so [thu sep 24 19:26:01.253638 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module status_module from /etc/httpd/modules/mod_status.so [thu sep 24 19:26:01.253747 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module substitute_module from /etc/httpd/modules/mod_substitute.so [thu sep 24 19:26:01.253823 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module suexec_module from /etc/httpd/modules/mod_suexec.so [thu sep 24 19:26:01.253884 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module unique_id_module from /etc/httpd/modules/mod_unique_id.so [thu sep 24 19:26:01.253960 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module unixd_module from /etc/httpd/modules/mod_unixd.so [thu sep 24 19:26:01.254028 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module userdir_module from /etc/httpd/modules/mod_userdir.so [thu sep 24 19:26:01.254094 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module version_module from /etc/httpd/modules/mod_version.so [thu sep 24 19:26:01.254157 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module vhost_alias_module from /etc/httpd/modules/mod_vhost_alias.so [thu sep 24 19:26:01.254350 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module dav_module from /etc/httpd/modules/mod_dav.so [thu sep 24 19:26:01.254491 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module dav_fs_module from /etc/httpd/modules/mod_dav_fs.so [thu sep 24 19:26:01.255042 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module dav_lock_module from /etc/httpd/modules/mod_dav_lock.so [thu sep 24 19:26:01.255892 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module lua_module from /etc/httpd/modules/mod_lua.so [thu sep 24 19:26:01.256053 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module mpm_prefork_module from /etc/httpd/modules/mod_mpm_prefork.so [thu sep 24 19:26:01.256261 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_module from /etc/httpd/modules/mod_proxy.so [thu sep 24 19:26:01.256362 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module lbmethod_bybusyness_module from /etc/httpd/modules/mod_lbmethod_bybusyness.so [thu sep 24 19:26:01.256434 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module lbmethod_byrequests_module from /etc/httpd/modules/mod_lbmethod_byrequests.so [thu sep 24 19:26:01.256505 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module lbmethod_bytraffic_module from /etc/httpd/modules/mod_lbmethod_bytraffic.so [thu sep 24 19:26:01.256709 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module lbmethod_heartbeat_module from /etc/httpd/modules/mod_lbmethod_heartbeat.so [thu sep 24 19:26:01.256904 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_ajp_module from /etc/httpd/modules/mod_proxy_ajp.so [thu sep 24 19:26:01.257042 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_balancer_module from /etc/httpd/modules/mod_proxy_balancer.so [thu sep 24 19:26:01.257142 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_connect_module from /etc/httpd/modules/mod_proxy_connect.so [thu sep 24 19:26:01.257227 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_express_module from /etc/httpd/modules/mod_proxy_express.so [thu sep 24 19:26:01.257334 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_fcgi_module from /etc/httpd/modules/mod_proxy_fcgi.so [thu sep 24 19:26:01.257421 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_fdpass_module from /etc/httpd/modules/mod_proxy_fdpass.so [thu sep 24 19:26:01.257543 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_ftp_module from /etc/httpd/modules/mod_proxy_ftp.so [thu sep 24 19:26:01.257736 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_http_module from /etc/httpd/modules/mod_proxy_http.so [thu sep 24 19:26:01.257861 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module proxy_scgi_module from /etc/httpd/modules/mod_proxy_scgi.so [thu sep 24 19:26:01.258128 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module systemd_module from /etc/httpd/modules/mod_systemd.so [thu sep 24 19:26:01.258301 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module cgi_module from /etc/httpd/modules/mod_cgi.so [thu sep 24 19:26:01.272364 2015] [so:debug] [pid 2603] mod_so.c(266): ah01575: loaded module php5_module from /etc/httpd/modules/libphp5.so
回答: 今後この問題が発生する場合は、selinuxを無効にせず、使用方法を学んでください。無効にすると、発砲しようとしたときにトリガーが機能しないため、銃器からすべての安全性を取り除くようなものです。これはこの問題に取り組む正しい方法です:`chcon -t httpd_sys_rw_content_t /var/www/html -r` 指定されたディレクトリに対する読み書きをapacheに許可します。ただsystemctl restart httpdその後、あなたは行ってもいいはずです。@madforfunandhappyによる投稿