저는 Apache를 사용 중이며 index.html
에서 jQuery를 사용하여 ajax 요청을 보냅니다. get_data.pl
은 cgi-bin
에있는 파일입니다. 나는 403 Forbidden error
을 얻었습니다. 누구든지 나를 도울 것이고 사전에 감사 할 것이다. 내가 콘솔에서 가지고 무엇Windows에서 Apache 403 오류 (금지됨)
$.ajax({
async : true,
type: "GET",
url: "get_data.pl"
}).done(function(msg){
alert("Data Saved: " + msg);
}).fail(function(xmlHttpRequest,statusText,errorThrown) {
console.log(JSON.stringify(xmlHttpRequest));
console.log(statusText);
console.log(errorThrown);
});
:
{"readyState":4,"responseText":"<!DOCTYPE ...<title>403 Forbidden</title>...
<p>You don't have permission to access /get_data.pl\non this server.</p>\n</body>
</html>\n","status":403,"statusText":"Forbidden"}
그것은 윈도우 7. 내가 관리자 계정을 사용하여 크롬으로 실행 해요입니다.
얼마 후 문제의 방법을 찾지 못했습니다. 전문가가 내 문제를 재현 할 수있는 세부 정보를 제공해야한다고 생각합니다. 에 라인 193 :
<Directory />
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
나는 2 개 라인 삭제 :
Order allow,deny
Allow from all
을 343 :
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
을 내 httpd.conf를 소개 , 나는 원래 하나를 기반으로 장소 변경
이 섹션을 다음으로 변경했습니다 :
<Directory "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/cgi-bin">
AllowOverride None
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Allow from all
</Directory>
.pl 파일을 cgi-bin 폴더에 htdocs 폴더의 index.html에 넣었습니다. Windows7, Win2k3 64 비트 및 WIn2k3 32 비트를 사용해 보았습니다. 모두 금지 된 오류가 있습니다. 나는 아파치의 기본 printenv.pl도 사용했다.
'.htaccess'를 보여주세요. – haim770
conf 폴더에서 검색했지만 .htaccess를 찾지 못했습니다. Apache2.2/manual 폴더 밑에 htaccess.html 만 있고, 내가 언급 한 설정 파일이라고 생각하지 않습니다. –
다른 디렉토리 (예 :'/ image.jpg ')에 대한 다른 요청도 금지되어 있거나 단지'.pl' 파일입니까? – haim770