Конфигурация Proftpd для выполнения ftp/ftes ftps и sftp одновременно на другом порте

просто используйте error_page (можно изменить page_not_found.html на сценарий PHP):

error_page 404 /page_not_found.html;
location ~ \.php$ {
    fastcgi_pass   localhost:9000;
    include        fastcgi_params;
    fastcgi_intercept_errors on;
}

файл попытки должен перенаправить к другому серверу, если страница, не найденная.

3
задан 7 March 2016 в 18:57
1 ответ

Это возможно, и вот мой файл конфигурации:

#-----------------------------------------------------------------------
# Server Configuration: those parameters cannot be elsewhere
#-----------------------------------------------------------------------
ServerName                          "ftp daemon"
ServerType                          inetd
UseIPv6                             off

# Bar use of SITE CHMOD by default
<Limit SITE_CHMOD>
        DenyAll
</Limit>

SystemLog                           none
LogFormat                           authentication "%{%F %T}t %P  from: %a to: %{protocol}:%H:%p  user: %U       msg: %S"
LogFormat                           transfer       "%{%F %T}t %P  from: %a to: %{protocol}:%H:%p  user: %U       file: %f        cmd: %m %J"

ScoreboardFile                      /local/proftpd/var/proftpd.scoreboard


TLSProtocol                         SSLv3 TLSv1

<Global>
    #-----------------------------------------------------------------------
    # Generic Configuration
    #-----------------------------------------------------------------------
    DefaultRoot                         ~
    Umask                               022
    allowOverwrite                      on
    User                                nobody
    Group                               nobody
    ExtendedLog                         /var/log/proftpd_auth.log AUTH,EXIT,SEC authentication
    ExtendedLog                         /var/log/proftpd_xfer.log READ,WRITE transfer
    AuthOrder                           mod_sql.c mod_auth_unix.c mod_auth_pam.c

    #-----------------------------------------------------------------------
    # TLS Configuration
    #-----------------------------------------------------------------------
    TLSEngine                                               off
    TLSRSACertificateFile           /usr/local/proftpd/etc/proftpd.cert.pem
    TLSRSACertificateKeyFile        /usr/local/proftpd/etc/proftpd.key.pem
    TLSLog                                                  none
    TLSVerifyClient                                 off
    TLSRenegotiate                                  none
    TLSRequired                                     off
</Global>

# -----------------------------------------------------------------------------
#    __ _              __   __ _         _____ _____                    __
#   / _| |            / /  / _| |       |  ___/  ___|                  / _|
#  | |_| |_ _ __     / /  | |_| |_ _ __ | |__ \ `--.    ___ ___  _ __ | |_
#  |  _| __| '_ \   / /   |  _| __| '_ \|  __| `--. \  / __/ _ \| '_ \|  _|
#  | | | |_| |_) | / /    | | | |_| |_) | |___/\__/ / | (_| (_) | | | | |
#  |_|  \__| .__/ /_/     |_|  \__| .__/\____/\____/   \___\___/|_| |_|_|
#          | |                    | |
#          |_|                    |_|
# -----------------------------------------------------------------------------
<VirtualHost 0.0.0.0>
    Port                                    210
    TLSEngine                               on
</VirtualHost>

# -----------------------------------------------------------------------------
#    __ _         _____                    __
#   / _| |       /  ___|                  / _|
#  | |_| |_ _ __ \ `--.    ___ ___  _ __ | |_
#  |  _| __| '_ \ `--. \  / __/ _ \| '_ \|  _|
#  | | | |_| |_) /\__/ / | (_| (_) | | | | |
#  |_|  \__| .__/\____/   \___\___/|_| |_|_|
#          | |
#          |_|
# -----------------------------------------------------------------------------
<VirtualHost 0.0.0.0>
    Port                                    214
    TLSEngine                               on
    TLSOptions                              UseImplicitSSL
</VirtualHost>

# -----------------------------------------------------------------------------
#   _____  __ _                            __
#  /  ___|/ _| |                          / _|
#  \ `--.| |_| |_ _ __     ___ ___  _ __ | |_
#   `--. \  _| __| '_ \   / __/ _ \| '_ \|  _|
#  /\__/ / | | |_| |_) | | (_| (_) | | | | |
#  \____/|_|  \__| .__/   \___\___/|_| |_|_|
#                | |
#                |_|
# -----------------------------------------------------------------------------
<IfModule mod_sftp.c>
    <VirtualHost 0.0.0.0>
        Port                                    211
        SFTPEngine                              on
        SFTPLog                                 none
        SFTPHostKey                     /etc/ssh/ssh_host_dsa_key
        SFTPHostKey                     /etc/ssh/ssh_host_rsa_key
        SFTPAuthorizedUserKeys  file:../etc/ssh/authorized_keys
        SFTPCompression                 delayed
        MaxLoginAttempts                6
    </VirtualHost>
</IfModule>  
4
ответ дан 3 December 2019 в 06:08

Теги

Похожие вопросы