본문 바로가기

Development Note/Server

워드프레스 FTP 인증절차 오류 해결방법 [How to fix Wordpress FTP access problem]


 [KOR] 워드프레스를 사용하다 보면 업데이트나 테마 설치 등의 작업을 수행해야 할 때가 있습니다. 그런데 업데이트 버튼을 클릭하면 인증절차를 요구하는 경우가 있는데, 이 때 리눅스 서버의 사용자 이름을 입력하면 인증 작업이 완료되면서 설치가 시작됩니다. 그런데 종종, 리눅스 사용자 이름과 비밀번호를 입력해도 계속 FTP 인증서를 확인하라는 문구가 나오면서 에러가 나는 경우가 있습니다. 

 [ENG] When using Wordpress, sometimes we encounter the situation which needs updates or theme install. And sometimes it requires Username and Password. If Username and Password works, that's great. But if not, it's very annoying. In my case, I was entered username and password repeatedly but it never worked. It showed 'Failed to connect FTP server [server address]' message forever.



 [KOR] 이런 경우는 아파치 데몬의 사용자 이름과 리눅스 사용자 이름이 일치하지 않아서 발생하는 경우가 대다수입니다. 이런 경우에는 다음 두 가지 과정을 거치면 인증 없이 정상적으로 워드프레스 업데이트를 사용할 수 있습니다.

 [ENG] In this case, the problem causes from unmatching between Apache daemon username and Linux system username. You can fix this problem through two following steps.



단계 [Steps]:


1단계. 아파치 데몬의 사용자 그룹과 이름을 리눅스의 사용자 이름과 같게 변경한다.

step 1. Change Group and Username of Apache daemon as Linux system Username. 

2단계. 아파치 관련 폴더의 소유권을 현재 리눅스 사용자에게 부여한다.

Step 2. Give Ownership of Apache related folders to current Linux system Username.



 [KOR] 첫 번째 단계는 먼저 아파치 설정 파일을 변경하는 것 부터 시작합니다. 여기서는 apache2 와 leafpad 에디터 기준으로 작성했습니다. 아파치2의 설정파일 경로로 이동해서 설정 파일을 에디터로 열어줍니다.

 [ENG] The first step is modifying apache configuration file. This post has written based on apache2 and leafpad editor. Go to the apache folder and open configuration file.



#leafpad /etc/apache2/envvar



 [KOR] 그리고 아파치 데몬의 사용자 이름을 리눅스 시스템의 사용자 이름과 동일하게 변경합니다. 하이라이트 영역이 아파치 사용자 이름입니다.

 [ENG] And change username of Apache daemon as Linux system username. Highlighted areas are the username of apache2.





 [KOR] 두 번째 단계로 방금 전에 적용한 리눅스 시스템 사용자 이름으로 아파치 관련 폴더의 소유권을 이전 해 줍니다.

 [ENG] Second step. Give ownership of Apache related folders to the Linux username which had applied to 'envvar' file.



#chown -R username:username /var/run/apache2

#chown -R username:username /var/lock/apache2



 [KOR] 만약 워드프레스 설치 폴더의 소유권이 다른 사용자에게 있다면 역시 변경 해 줍니다.

 [ENG] If ownership of wordpress installed folder is belong to another username, then change it too.



#chown -R username:username /var/www/html



 [KOR] 이제 apache를 재시작 해 줍니다.

 [ENG] And now, restart apache2.



#service apache2 restart



 [KOR] 워드프레스 업데이트 및 플러그인 설치가 인증이나 에러 없이 잘 실행되는 것을 볼 수 있습니다.

 [ENG] Now you can see Wordpress ftp is working without access or error.