Apache2 서버에서 Perl 웹 응용 프로그램을 올바르게 설정하는 데 어려움이 있습니다. 웹 브라우저에서 사이트에 액세스하려고하면 500 Internal Server Error
이 표시됩니다.Apache Perl cgi-bin 설정 : 내부 서버 오류
오류 로그의 오류 메시지는 다음과 같습니다
[Wed Nov 30 23:55:46.848517 2016] [cgid:error] [pid 6899] (2)No such file or directory: AH01241: exec of '/var/cgi-bin/choose.pl' failed
[Wed Nov 30 23:55:46.849213 2016] [cgid:error] [pid 2090] [client 127.0.0.1] End of script output before headers: choose.pl, referer: http://localhost/test/
을하지만 오류없이, 터미널 (perl choose.pl
) 예상 등의 실행에서 스크립트를 실행하려고하면. 파일에는 755 개의 권리가 있으며 적절한 판매가 시작됩니다.
스크립트는 다음과 같은 html 파일로로드됩니다. <frame src=/cgi-bin/choose.pl name=choose scrolling=auto>
직접 액세스하려고 시도하면 오류가 발생합니다. 다음과 같이
내 /etc/apache2/sites-available/000-default.conf
은 다음과 같습니다 어떤 도움
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ScriptAlias "/cgi-bin/" "/var/cgi-bin/"
<Directory "/var/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
이
감사합니다! 대단히 감사합니다!
OS가'/ var/cgi-bin/choose.pl'이 존재하지 않는다고보고하고 있습니다. 그렇지 않다고 생각하니? – ikegami
서비스는 chroot jails와 SElinux와 같은 것이므로,/var로 보는 것은/var로 보는 것과 다를 수 있습니다. – ikegami
@ikegami 예, 파일이 존재합니다. 'perl/var/cgi-bin/choose.pl'을 실행하면 예상대로 실행됩니다. – JMac