Articles
mod_userdir을 사용하는 동안 XAMPP에서 발생하는 오류 403을 어떻게 수정합니까?
On 12월 1, 2020 by admin 저는 Arch Linux를 실행 중이며 웹 페이지를 만들고 테스트 할 수 있도록 XAMPP를 사용하기로 결정했습니다. 어쨌든 사이트의 지침에 따라 /opt/lampp
에 압축을 푼 다음 /opt/lampp/etc/httpd.conf
의 주석도 제거했습니다. 그래서 mod_userdir
가 활성화됩니다.
이제 사용자 public_html
( http://localhost/~user ), 다음 오류가 발생합니다.
Access forbidden! You don"t have permission to access the requested object. It is either read-protected or not readable by the server. If you think this is a server error, please contact the webmaster. Error 403
어떻게 작동하려면?
답변
웹 서버에서 public_html과 파일을 읽을 수 있도록 만들어야합니다.
한 가지 방법은 chmod o+x /home/user
(모든 사용자가 홈 디렉토리로 전환하도록 허용) 및 chmod -R o+rX /home/user/public_html
(make public_html 모든 사람이 읽을 수있는 파일).
더 나은 액세스 제어가 필요한 경우 ACL을 사용하십시오.
답변
이것을 사용해야합니다.
<Directory "/Users/*/Sites"> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>
iv 대신
Require all granted
를 사용해야합니다. id = “5c40ce1fdf”> Apache> 2.4를 사용할 때
댓글
- 이게 트릭이었습니다. 하지만 이것이 내가 찾은 튜토리얼에없는 이유가 궁금합니다. 그리고 " 모든 권한 부여 필요 "는 무엇을 의미합니까?
답변
기본 httpd.conf
파일은 모든 디렉토리를 사용할 수 없게 만듭니다.
<Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory>
디렉토리에 대한 액세스를 허용하도록 Apache를 구성해야합니다.
<Directory "/srv/httpd/htdocs"> Order allow,deny Allow from all </Directory>
최소한이 작업을 수행해야 할 수도 있습니다. 다른 것. 403 응답을받은 다음 /var/log/httpd/error_log
(또는 XAMPP가 배치하는 위치)에서 무슨 일이 있었는지 확인하십시오.
답글 남기기