我试图在亚马逊云服务器上设置FTP,但没有运气。
我在网上搜索,没有具体的步骤如何做到这一点。
我找到了这些命令:
$ yum install vsftpd
$ ec2-authorize default -p 20-21
$ ec2-authorize default -p 1024-1048
$ vi /etc/vsftpd/vsftpd.conf
#<em>---Add following lines at the end of file---</em>
pasv_enable=YES
pasv_min_port=1024
pasv_max_port=1048
pasv_address=<Public IP of your instance>
$ /etc/init.d/vsftpd restart
但我不知道在哪里写。
我一直跟着clone45的答案走到最后。一篇很棒的文章!由于我需要FTP访问权限来为我的一个wordpress站点安装插件,所以我将主目录更改为/var/www/mysitename。然后我继续把我的ftp用户添加到apache(或www)组,就像这样:
sudo usermod -a -G apache myftpuser
在此之后,我仍然在WP的插件安装页面上看到这个错误:“无法定位WordPress内容目录(WP - Content)”。在wp.org的问答环节上搜索并找到了这个解决方案:https://wordpress.org/support/topic/unable-to-locate-wordpress-content-directory-wp-content,并在wp-config.php的末尾添加了以下内容:
if(is_admin()) {
add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 );
}
在此之后,我的WP插件安装成功。