라즈베리파이3 오류 500 Internal Server Error

조회수 1531회

라즈베리파이를 막 시작했습니다. 책을 읽으면서 웹 서버를 구축하고있는데 오류가 납니다.

오류 내용은 이렇습니다.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

그리고 오류가 난 파일에 작성한 코드는 이렇습니다. 아무리 찾아봐도 뭐가 잘못된지 모르겠습니다.

#!/usr/bin/python
# Import modules for CGI handling
import cgi, cgitb
# Create instance of FieldStorage
form = cgi.FieldStorage()
# Get data from fields
login_id = form.getvalue('loginid')
password = form.getvalue('password')
print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>"
print "<title>Hello - Login CGI Program</title>"
print "</head>"
print "<body>"
print "<h2>Hello %s</h2>" % (login_id)
print "</body>"
print "</html>"

어디에 오류가 났을까요?

  • (•́ ✖ •̀)
    알 수 없는 사용자

1 답변

  • 웹서버는 무엇인지요? 보통 아파치를 많이 이용할 것 같습니다만...

    일단 http status 코드는 500 이고 500이면 서버쪽 오류라는 의미입니다.

    물론 서버오류라는 의미는 광범위해서 작성한 코드에서 오류일지는 알 수 없습니다.

    아파치의 로그도 함께 봐야 합니다.

    /var/log/apache2/error.log 같은 형태로 존재할 겁니다.

    그리고

    cgitb.enable()
    

    설정하여 디버깅 정보를 출력할 수 있습니다.

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)