我有Wordpress 3.6在ubuntu 12.04 LTS和apache2上运行。Wordpress在apache上的根目录已用完,即/var/www
我有一个FTP服务器设置(VSFTPD)。我将其设置为chroot到FTP用户的主目录。
我设置了一个FTP用户,在主目录中有一个名为public\\u html的文件夹。在那里,我装载了/var/www,以便用户可以访问apache上的根目录。
我在VSFTPD上设置了002的UMASK,在/var/www上设置了dr-xrwsr-x。在/var/www中的所有目录都是775,所有文件都是664。
我可以与ftp用户一起登录到ftp服务器,并按预期在/public\\u html中创建、覆盖和删除任何我喜欢的文件和文件夹。
如果我使用wordpress安装具有相同ftp凭据的插件,它将失败Unable to locate WordPress Content directory (wp-content).
我检查了wp-config.php documentation, 上面说要添加FTP_BASE
到我的配置,我喜欢这样:
define(\'FTP_BASE\', \'/public_html/\');
我重新启动了apache,注销并重新登录到wordpress。插件安装仍然失败,并显示相同的消息。
如果我在VSFTPD中打开协议调试(log_ftp_protocol=YES
), 我可以看到wordpress登录到VSFTPD,但它从未将目录更改为/public\\u html,尽管我的配置中设置了FTP\\u BASE。
奇怪的是,它确实尝试将内容CD到/var/www/wp,这显然行不通。发生了什么事?Wordpress是否忽略了我的FTP_BASE
?
我的vsftpd日志:
Sat Sep 21 04:16:15 2013 [pid 2] CONNECT: Client "w.x.y.z"
Sat Sep 21 04:16:15 2013 [pid 2] FTP response: Client "w.x.y.z", "220 (vsFTPd 2.3.5)"
Sat Sep 21 04:16:15 2013 [pid 2] FTP command: Client "w.x.y.z", "USER ftpuser"
Sat Sep 21 04:16:15 2013 [pid 2] [ftpuser] FTP response: Client "w.x.y.z", "331 Please specify the password."
Sat Sep 21 04:16:15 2013 [pid 2] [ftpuser] FTP command: Client "w.x.y.z", "PASS <password>"
Sat Sep 21 04:16:15 2013 [pid 1] [ftpuser] OK LOGIN: Client "w.x.y.z"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "230 Login successful."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "PASV"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "227 Entering Passive Mode (w,x,y,z,204,159)."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "TYPE A"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "200 Switching to ASCII mode."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "NLST /var/www/wp-content"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "150 Here comes the directory listing."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "226 Transfer done (but failed to open directory)."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "PWD"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "257 "/""
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "PASV"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "227 Entering Passive Mode (w,x,y,z,102,89)."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "NLST /"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "150 Here comes the directory listing."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "226 Directory send OK."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "CWD /"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "250 Directory successfully changed."
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "PWD"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "257 "/""
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "CWD /"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "250 Directory successfully changed."
...(above 10 lines repeated 4 times)
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP command: Client "w.x.y.z", "QUIT"
Sat Sep 21 04:16:15 2013 [pid 3] [ftpuser] FTP response: Client "w.x.y.z", "221 Goodbye."