워드프레스 에서 어드민 로그인 하려고 할때 에러 You don’t have permission to access

워드프레스 wp-admin 로그인시 에러 문제

You don’t have permission to access /wp-login.php on this server.

갑자기 이런 에러가 나와서 아파치 나 권한 문제라고 생각했다.
아파치의 error_log를 확인해보니 mod_security에서 발생하는 문제였다.

[Fri May 20 12:14:52 2011] [error] [client 121.000.xxx.123] ModSecurity: Access denied with code 403 (phase 2).
Pattern match “=(http|https|ftp)\\\\:/” at REQUEST_URI. [file “/usr/local/apache2/conf/modsecurity_krcert.conf”]
[line “72”] [msg “PHP Injection Attacks”] [hostname “www.domain.com”] [uri “/wp-login.php”]
[unique_id “Vz6BLH8AAAEAAFpyBOQAAAAI”]

이것때문에 ModSecurity를 전체적으로 끌수는 없고 해당 사이트에만 ModSecurity를 끄게 설정하려고 했다.

htaccess 파일에 이렇게 설정해도 된다는데. (내가 사용하는 것은 ModSecurity2 이다.)

<IfModule mod_security.c>
SecRuleEngine Off
</IfModule>

아파치에 AllowOveride All 되어 있는데도 안먹힌다.

그래서 VirtualHost에 직접 넣으니 해결되었다.

<VirtualHost 1.234.567.89:80>
DocumentRoot /home/hosting/domain.com
ServerName domain.com
ServerAlias www.domain.com
SecRuleEngine Off
<Directory /home/hosting/domain.com>
AllowOverride all
</Directory>
</VirtualHost>

워드프레스 에서 어드민 로그인 하려고 할때 에러 You don’t have permission to access
Scroll to top