서버에 phpmyadmin 설치 후 웹에서 연결이 안됩니다.

서버에 phpmyadmin 설치 후 웹에서 연결이 안됩니다.

QA

서버에 phpmyadmin 설치 후 웹에서 연결이 안됩니다.

본문

안녕하세요?

이틀 전 cafe2x에서 linux 가상서버서비스를 신청했습니다.

=====================================

기본제공사양 : 64bit CentOS 7.x/APM은 RPM 방식으로 설치/

APM 및 root계정 설치 지원)만 설치해 드리며, 서버 내 프로그램 설치 및 설정은 사용자께서 직접하셔야 합니다.

=====================================

서버 내에서 제가 작업한 내용입니다.

http/ftp/mariadb 암호설정 및 활성화 확인.

phpmyadmin 설치 정도입니다.

그누보드 설치하기 위해 웹상에서 phpmyadmin 호출을 했는데, 

"Forbidden

You don't have permission to access /phpmyadmin on this server."

에러메세지 송출을 하고 연결이 되지 않습니다.

 

=====================================

웹에서 검색한 바로는 ...

방법1)

sudo vi /etc/httpd/conf.d/phpMyAdmin.conf

<Directory "/usr/share/phpMyAdmin">
Order allow,deny
Allow from all
</Directory>
그리고 재시작

$ service httpd restart

 

방법2)

/etc/httpd/conf.d/phpMyAdmin.conf 와 /etc/httpd/conf.d/httpd.conf 를 모두 수정해주어야한다.

우선 phpMyAdmin.conf


<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       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> 

위 처럼 되어 있는 부분의 가운데를 통째로 날려 그냥 다음과 같이 만들어 준다. 모든 접속의 접근을 허용한다는 뜻이다.

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8
   Order Allow,Deny
   Allow from All
</Directory>

다음으로 httpd.conf 당연히 시스템마다 조금씩 다를 줄 있지만 약 102번째 줄에 다음과 같은 구문이 있다.

<Directory />
    AllowOverride none
    Require all denied 
</Directory>

Require all denied 줄을 Require all granted로 변경해주자. / 를 거쳐 접속하는 것에 대해 허용된다.

=====================================

 

웹에서의 설명이 거의 같은데, 해결이 안됩니다.

어디를 어떻게 해야 할 지모르겠어요.

도와주세요~~

이 질문에 댓글 쓰기 :

답변 3

yum 을 이용해 설치 하셨다면

phpMyAdmin.conf 파일을 아래 코드로 바꾸고 아파치와 php-fpm 을 재시작 해 주세요.

 


Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny> 
      Require all granted
     </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>
<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
       Require all granted
     </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>

var/log/http 에서 에러 로그 화일을 확인해보세요

ModSecurity: Access denied with code 403 (phase 2).~~~~[id "960009"]~~~<--- 이런게 보일 것입니다

ModSecurity를 off하면 되긴하는데(SecRuleEngine)

보안상 좋지않으니 에러 id를 제외시켜주는 방법으로 합니다

ModSecurity로 구글 검색해보세요

 

 

답변을 작성하시기 전에 로그인 해주세요.
전체 34
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT