
최근에 PHP-FPM 및 FastCGI 프록시와 함께 Apache 2.4 설치에서 이벤트 MPM을 사용하여 변경했는데 이것이 내 문제의 원인이 아니기를 바랍니다. 또한 여러 웹사이트가 없지만 이름 기반 VirtualHost 지시문을 사용하여 작업하기 시작했습니다. Linux(특히 CentOS 7)는 NAT 뒤에서 실행되는 VM일 뿐입니다.
이러한 변경 이전에는 VM이 여전히 NAT 뒤에서 실행되고 있다는 점을 제외하면 제대로 작동했지만(적어도 그렇게 생각합니다. 이에 대해서는 나중에 설명하겠습니다) 지금은 "IP 필요"가 저를 괴롭히고 있습니다.
<VirtualHost *:80>
DocumentRoot /home/website/public_html
<Directory /home/website>
Allow from all
Options +Indexes
AllowOverride All
</Directory>
<Location />
# Allow Internal IPs
Require ip 10.0.0.0/8
Require ip 172.16.0.0/12
Require ip 192.168.0.0/16
Require ip 0.0.0.0/8
Require ip 127.0.0.0/8
# Allow Company IPs
Require forward-dns broadband1.company.com
Require forward-dns broadband2.company.com
# Allow all IPs (comment it if disallowed)
Require all granted
</Location>
</VirtualHost>
그래서 웹 파일을 폴더 아래에 넣으면 public_html
잘 작동합니다. 멋진! 그런데 phpMyAdmin을 설치하고 아래와 같이 수정 phpMyAdmin.conf
했습니다 /etc/httpd/conf.d/
.
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
# Allow Internal IPs
Require ip 10.0.0.0/8
Require ip 172.16.0.0/12
Require ip 192.168.0.0/16
Require ip 0.0.0.0/8
Require ip 127.0.0.0/8
# Allow Company IPs
Require forward-dns broadband1.company.com
Require forward-dns broadband2.company.com
# Was here by default
Require ip 127.0.0.1
Require ip ::1
</RequireAny>
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order Deny,Allow
Deny from All
Allow from 127.0.0.1
Allow from ::1
</IfModule>
</Directory>
위의 VirtualHost와 달리 이번에는 무차별 공격으로 데이터베이스에 침입할 수 있는 경우 매우 위험하기 때문에 모든 IP 주소에 phpMyAdmin에 대한 액세스 권한을 부여하지 않았습니다.
/server-status
및 에도 동일하게 적용됩니다 /server-info
. 특정 IP만 해당 페이지에 액세스할 수 있으며 절대 그렇지 않습니다 Require all granted
. 그러나 VirtualHost를 사용하기 시작한 후에는 이러한 페이지에 액세스할 수 있으므로 문자 그대로 phpMyAdmin.conf 아래의 "IP 필요" 섹션과 /server-status 및 /server-info에 대해 생성한 지시문이 제대로 작동하지 않습니다.
그런 다음 호기심을 갖고 "모두 부여됨 요구"를 시도하고 댓글을 달고 httpd.conf
무슨 일이 일어나는지 확인했는데 예상대로 phpMyAdmin에 액세스할 수 없습니다. 따라서 "ip 필요"는 VirtualHost에만 기반한 것처럼 보입니다. 그런데 나머지 3페이지는 VirtualHost에 언급이 없어서 제가 뭘 잘못했는지 모르겠습니다.
내 질문은: phpMyAdmin, /server-status 및 /server-info에 대해 "ip 필요"를 다시 작동하게 만드는 방법은 무엇입니까? 미리 도움을 주셔서 감사합니다!