아파치 구성에 문제가 있나요? Perl 스크립트를 실행할 수 없는 이유 - 브라우저 다운로드 스크립트

아파치 구성에 문제가 있나요? Perl 스크립트를 실행할 수 없는 이유 - 브라우저 다운로드 스크립트

아파치 구성이 잘못되었습니다. 내 스크립트는 실행되고 싶지 않으며 브라우저는 이를 파일로 다운로드하려고 합니다.

<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>
  1. www-data:www-data스크립트는 권한이 있는 사용자 의 소유 755이며 실행될 수 있습니다( +x).
  2. 셰방 예 #!/usr/bin/perl: .
  3. 오류 로그는비어 있는.

답변1

문제 해결됨!

모두 제거하고 Require all granted(Apacvhe 2.4+에만 해당) 다음을 붙여넣습니다.

Order allow,deny
allow from all

AddHandler cgi-script .cgi .pl또한 DocumentRoot 디렉토리 설명으로 이동합니다.

관련 정보