본문 바로가기
개발공부/개발하다_발견함

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

by 맙소사 2022. 9. 14.

Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

 

web 서버에 아파치를 설치해서 구동했는데 위와 같은 메시지가 떴다.

대충 작업 실패했으니 systemctl status httpd.service나 journalctl -xe을 참조하셈

그래서 systemctl status httpd.service을 봤는데 딱히 별게 없어서 journalctl -xe을 써봤더니 오류메시지가 쫘르륵 나왔다.

-- Unit httpd.service has begun starting up.
Sep 14 10:35:17 deas-webhp1 httpd[22897]: AH00526: Syntax error on line 165 of /etc/httpd/conf/httpd.conf:
Sep 14 10:35:17 deas-webhp1 httpd[22897]: Invalid command 'index.jsp', perhaps misspelled or defined by a module not included in the server configuration
Sep 14 10:35:17 deas-webhp1 systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Sep 14 10:35:17 deas-webhp1 systemd[1]: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed

원인은 문장 오류였다... 궁금해서 가봤더니 DirectoryIndex 이 부분인데 줄바꿈이 되어 있으면 오류가 난다고 한다...

DirectoryIndex는 여러개 적어도 된다. 앞 쪽에 있는게 우선권이 있으니 메인이 되는 확장자 파일을 보고 앞 쪽에 작성해주면 된다. 당장 jsp 파일이 존재하지 않고 그냥 html쪽으로만 연결해줘도 괜찮기 때문에 아래 줄을 지워줬다.

둘 다 작성하고 싶다면

DirectiryIndex index.html index.jsp

이렇게 한 줄에 적어주면 됨.

댓글