CentOS 7 VPS가 있고 다음 지침에 따라 가상 호스트를 설치하려고 합니다.https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-centos-7.
이 튜토리얼의 5단계를 완료했습니다. 그런 다음 아파치를 다시 시작하려고 하면 실패합니다.
$ sudo apachectl restart
[sudo] password for student01:
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.
$ sudo systemctl status httpd.service -l
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since বুধ 2018-04-11 14:29:55 +06; 4min 13s ago
Docs: man:httpd(8)
man:apachectl(8)
Process: 11116 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
Process: 11115 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 11115 (code=exited, status=1/FAILURE)
এপ্রি 11 14:29:55 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
এপ্রি 11 14:29:55 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
এপ্রি 11 14:29:55 localhost.localdomain kill[11116]: kill: cannot find process ""
এপ্রি 11 14:29:55 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
এপ্রি 11 14:29:55 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
এপ্রি 11 14:29:55 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
এপ্রি 11 14:29:55 localhost.localdomain systemd[1]: httpd.service failed.
이제 어떻게 해야 할까요?
편집하다
/var/log/httpd/error_log
[Sun Apr 08 03:23:02.040472 2018] [auth_digest:notice] [pid 20339] AH01757: generating secret for digest authentication ...
[Sun Apr 08 03:23:02.041376 2018] [lbmethod_heartbeat:notice] [pid 20339] AH02282: No slotmem from mod_heartmonitor
[Sun Apr 08 03:23:02.094944 2018] [mpm_prefork:notice] [pid 20339] AH00163: Apache/2.4.6 (CentOS) PHP/5.4.16 configured -- resuming normal operations
[Sun Apr 08 03:23:02.094956 2018] [core:notice] [pid 20339] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Sun Apr 08 05:35:00.720095 2018] [autoindex:error] [pid 30351] [client 66.102.6.114:59512] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Sun Apr 08 09:42:05.222459 2018] [autoindex:error] [pid 30347] [client 52.34.24.33:31614] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Sun Apr 08 11:06:56.497939 2018] [autoindex:error] [pid 30790] [client 54.145.188.132:22136] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Sun Apr 08 14:13:12.731870 2018] [autoindex:error] [pid 32239] [client 185.198.167.29:51750] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Sun Apr 08 19:06:12.521882 2018] [autoindex:error] [pid 30348] [client 180.234.211.210:57961] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Sun Apr 08 19:06:15.004820 2018] [autoindex:error] [pid 30790] [client 159.203.81.93:36934] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive, referer: http://csedu.cf/noindex/css/open-sans.css
[Sun Apr 08 21:20:59.825782 2018] [autoindex:error] [pid 1338] [client 66.102.6.114:52716] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 00:25:17.935192 2018] [autoindex:error] [pid 30348] [client 178.73.215.171:58579] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 02:50:04.593613 2018] [autoindex:error] [pid 30351] [client 141.8.142.139:50790] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 03:17:12.517868 2018] [autoindex:error] [pid 30347] [client 222.186.173.47:3128] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 04:10:37.253275 2018] [autoindex:error] [pid 31639] [client 164.132.91.1:38580] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 05:38:34.833406 2018] [autoindex:error] [pid 30350] [client 66.249.70.23:49821] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 05:42:25.297309 2018] [autoindex:error] [pid 30790] [client 66.102.6.118:49432] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 08:37:04.505363 2018] [autoindex:error] [pid 1338] [client 66.249.64.17:47360] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 11:34:29.890432 2018] [autoindex:error] [pid 30349] [client 60.10.114.129:4892] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 12:21:16.013396 2018] [autoindex:error] [pid 30351] [client 66.249.64.147:61628] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 13:16:44.877416 2018] [autoindex:error] [pid 30348] [client 66.249.64.18:48720] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 13:28:05.782783 2018] [autoindex:error] [pid 31639] [client 54.67.59.131:47628] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 15:59:59.764704 2018] [autoindex:error] [pid 30349] [client 66.102.6.116:50307] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 20:48:48.419540 2018] [autoindex:error] [pid 30349] [client 211.23.154.138:44382] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 20:49:19.596952 2018] [autoindex:error] [pid 30790] [client 146.185.223.240:61291] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 20:49:25.365282 2018] [:error] [pid 32239] [client 146.185.223.240:53694] script '/var/www/html/xmlrpc.php' not found or unable to stat
[Mon Apr 09 20:49:30.881307 2018] [autoindex:error] [pid 1338] [client 146.185.223.240:57697] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 21:59:59.860423 2018] [autoindex:error] [pid 30790] [client 52.41.211.72:54578] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 22:40:17.025377 2018] [autoindex:error] [pid 32239] [client 66.102.6.118:63371] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Mon Apr 09 23:54:26.754931 2018] [autoindex:error] [pid 30350] [client 141.8.142.139:44732] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 02:04:12.364159 2018] [autoindex:error] [pid 30350] [client 66.249.64.17:46304] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 04:31:13.380666 2018] [autoindex:error] [pid 30349] [client 66.249.79.21:45988] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 05:11:35.587141 2018] [autoindex:error] [pid 32239] [client 66.249.79.19:52379] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 05:41:26.176137 2018] [autoindex:error] [pid 1338] [client 66.102.6.118:51864] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 05:57:36.520454 2018] [autoindex:error] [pid 30347] [client 66.249.79.110:36194] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 12:44:25.251573 2018] [autoindex:error] [pid 32239] [client 52.34.24.33:60587] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 13:08:39.896323 2018] [autoindex:error] [pid 1338] [client 141.8.142.139:53710] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 13:31:14.603115 2018] [autoindex:error] [pid 30790] [client 180.234.211.210:44472] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 13:42:16.181640 2018] [autoindex:error] [pid 30351] [client 107.170.192.57:54176] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 16:31:20.752769 2018] [autoindex:error] [pid 30349] [client 196.52.43.109:6666] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 17:43:24.572519 2018] [autoindex:error] [pid 1338] [client 66.102.6.118:64283] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Tue Apr 10 23:32:45.653283 2018] [mpm_prefork:notice] [pid 20339] AH00170: caught SIGWINCH, shutting down gracefully
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
답변1
첫 번째 메시지 httpd.service: main process exited, code=exited, status=1/FAILURE
는 서비스를 시작할 수도 없음을 나타냅니다. 다음 메시지 kill[11116]: kill: cannot find process ""
는 서비스 프로세스가 이전에 시작될 수 없었기 때문에 종료될 수 없다는 것입니다.
/var/log/httpd/error_log
vhost 정의 문제로 인해 서비스가 중지된 로그 메시지에 따르면
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/example2.com/error.log.
AH00015: Unable to open logs
서비스가 구성된 로그 파일에 쓸 수 없는 경우
- 디렉토리가 존재하지 않습니다
- 하드 드라이브가 읽기 전용입니다.
- 하드 드라이브가 꽉 찼습니다.
서비스를 시작할 수 없습니다.
VirtualHost 구성도 살펴봐야 합니다 example2.com
.
한편으로는 로그에 DocumentRoot가 있다고 나와 있지만 /var/www/html/
로그를 다음에 기록하려고 하기 때문에 서비스 구성에 문제가 있는 것으로 의심됩니다./var/www/example2.com/
답변2
/etc/httpd/conf/httpd.conf에서 다음 줄을 주석 처리해 보세요.
#LoadModule mpm_event_module modules/mod_mpm_event.so
그리고 다음 줄의 주석을 해제하세요.
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so