아파치 구성이 잘못되었습니다. 내 스크립트는 실행되고 싶지 않으며 브라우저는 이를 파일로 다운로드하려고 합니다.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName president.com
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/cgi/
<Directory /var/www/cgi/>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
AddHandler cgi-script .cgi .pl
</Directory>
www-data:www-data
스크립트는 권한이 있는 사용자 의 소유755
이며 실행될 수 있습니다(+x
).- 셰방 예
#!/usr/bin/perl
: . - 오류 로그는비어 있는.
답변1
문제 해결됨!
모두 제거하고 Require all granted
(Apacvhe 2.4+에만 해당) 다음을 붙여넣습니다.
Order allow,deny
allow from all
AddHandler cgi-script .cgi .pl
또한 DocumentRoot 디렉토리 설명으로 이동합니다.