在Debian上,您可以使用vsftpd作為FTP服務器。要自定義錯誤頁面,請按照以下步驟操作:
sudo apt-get update
sudo apt-get install vsftpd
/etc/vsftpd/
目錄下創建一個名為error.html
的文件。使用文本編輯器打開它,例如:sudo nano /etc/vsftpd/error.html
將您的自定義HTML代碼粘貼到此文件中,然后保存并關閉文件。
/etc/vsftpd.conf
文件:sudo nano /etc/vsftpd.conf
找到以下行(如果找不到,請添加它們):
#custom_error=NO
ftp_error_message_enable=YES
取消注釋custom_error=NO
(刪除行首的#號),并將其更改為custom_error=YES
。這將啟用自定義錯誤頁面。
保存并關閉配置文件。
重啟vsftpd服務以應用更改:
sudo systemctl restart vsftpd
現在,當用戶遇到FTP錯誤時,他們將看到您在error.html
文件中定義的自定義錯誤頁面。