本文通過其他安裝流程總結后的最簡流程,方便需要快速安裝配置的讀者們參考。
最簡潔的安裝步驟
[root@itdragon ~]# useradd ftpuser [root@itdragon ~]# passwd ftpuser Changing password for user ftpuser. New password: BAD PASSWORD: it is too short BAD PASSWORD: is too simple Retype new password: passwd: all authentication tokens updated successfully. [root@itdragon ~]# yum -y install vsftpd [root@itdragon ~]# ifconfig
第一步:添加ftp用戶
第二步:設置ftp用戶密碼
第三步:安裝vsftpd
第四步:查看ip地址
第五步:本地使用免費的FileZilla 鏈接虛擬機
遇到的問題
連接失敗
狀態: 正在等待重試... 狀態: 正在連接 192.168.0.11:21... 錯誤: 20 秒后無活動,連接超時 錯誤: 無法連接到服務器
不用灰心,安裝本來就不是順風順水的,每個人會根據自己的環境出現不同的問題。下面是我的解決方法
首先,要確定兩邊能 pind 通,虛擬機選擇的是橋接模式,能正常 ping 通。
然后,百度
網上有很多五花八門的解決方法,主要是針對三個方面的
這里我會貼出幾個網址,因為我按照網站上面的做法沒有連接成功,最后是關閉了防火墻才解決的。我對這塊比較薄弱,就不誤人子弟了。貼出來是為了以后方便以后修改。
第一個操作是關閉匿名,開啟被動模式
第二個操作是開啟防火墻的21端口
第三個操作是修改selinux,開啟外網可訪問
[root@itdragon ~]# vim /etc/vsftpd/vsftpd.conf anonymous_enable=NO pasv_min_port=30000 pasv_max_port=31000 [root@itdragon ~]# service vsftpd restart [root@itdragon ~]# vim /etc/sysconfig/iptables -A INPUT -p tcp -m multiport --dport 20,21 -m state --state NEW -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT -A INPUT -p tcp --dport 30000:31000 -j ACCEPT [root@itdragon ~]# service iptables restart [root@itdragon ~]# getsebool -a | grep ftp allow_ftpd_anon_write --> off allow_ftpd_full_access --> off allow_ftpd_use_cifs --> off allow_ftpd_use_nfs --> off ftp_home_dir --> off ftpd_connect_db --> off ftpd_use_fusefs --> off ftpd_use_passive_mode --> off httpd_enable_ftp_server --> off tftp_anon_write --> off tftp_use_cifs --> off tftp_use_nfs --> off [root@itdragon ~]# setsebool -P allow_ftpd_full_access on [root@itdragon ~]# setsebool -P ftp_home_dir on
臨時關閉防火墻不過癮,直接永久關閉防火墻
[root@itdragon modprobe.d]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] [root@itdragon modprobe.d]# chkconfig iptables off
上傳失敗
在nginx 安裝目錄下創建了一個images文件夾,通過FileZilla上傳圖片提示錯誤
響應:553 Could not create file. 錯誤: 嚴重文件傳輸錯誤
解決方法如下
[root@itdragon html]# mkdir images [root@itdragon html]# chmod -R 777 images [root@itdragon html]# ll total 12 -rw-r--r--. 1 root root 537 Nov 18 10:53 50x.html drwxrwxrwx. 2 root root 4096 Nov 18 10:55 images -rw-r--r--. 1 root root 612 Nov 18 10:53 index.html [root@itdragon html]# vim /etc/vsftpd/vsftpd.conf local_root=/var/ftp [root@itdragon html]# service vsftpd restart
注意點
網絡要能ping通
防火墻的問題要處理好
不能創建文件問題
以上就是我們整理的最簡單的nginx安裝vsftpd的流程,大家在學習的時候如果有任何不明白的,可以在下方留言給我們。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。