首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ProFTPd服务自动关闭

ProFTPd服务自动关闭
EN

Ask Ubuntu用户
提问于 2014-09-15 14:27:34
回答 2查看 9.8K关注 0票数 2

我在运行UbuntuLinux14.04的服务器上安装了ProFTPd服务。我不知道为什么ProFTPd会自动关闭。我有足够的内存和CPU,我真的不知道为什么会这样。我还检查了ProFTPd配置文件,我仍然没有弄清楚。

代码语言:javascript
复制
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
# 

# Includes DSO modules
Include /etc/proftpd/modules.conf

# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6             on
# If set on you can experience a longer connection delay in many cases.
IdentLookups            off

ServerName          "Debian"
ServerType          standalone
DeferWelcome            off

MultilineRFC2228        on
DefaultServer           on
ShowSymlinks            on

TimeoutNoTransfer       600
TimeoutStalled          600
TimeoutIdle         1200

DisplayLogin                    welcome.msg
DisplayChdir                .message true
ListOptions                 "-l"

DenyFilter          \*.*/

# Use this to jail all users in their homes 
#DefaultRoot ~

# RequireValidShell     off

# Port 21 is the standard FTP port.
Port                21

# In some cases you have to specify passive ports range to by-pass
# firewall limitations. Ephemeral ports can be used for that, but
# feel free to use a more narrow range.
# PassivePorts                  49152 65534

# If your host was NATted, this option is useful in order to
# allow passive tranfers to work. You have to use your public
# address and opening the passive ports used on your firewall as well.
# MasqueradeAddress     1.2.3.4

# This is useful for masquerading address with dynamic IPs:
# refresh any configured MasqueradeAddress directives every 8 hours
<IfModule mod_dynmasq.c>
# DynMasqRefresh 28800
</IfModule>

# To prevent DoS attacks, set the maximum number of child processes
# to 30.  If you need to allow more than 30 concurrent connections
# at once, simply increase this value.  Note that this ONLY works
# in standalone mode, in inetd mode you should use an inetd server
# that allows you to limit maximum number of processes per service
# (such as xinetd)
MaxInstances            30

# Set the user and group that the server normally runs at.
User                proftpd
Group               nogroup

# Umask 022 is a good standard umask to prevent new files and dirs
# (second parm) from being group and world writable.
Umask               022  022
# Normally, we want files to be overwriteable.
AllowOverwrite          on

# Uncomment this if you are using NIS or LDAP via NSS to retrieve passwords:
# PersistentPasswd      off

# This is required to use both PAM-based authentication and local passwords
# AuthOrder         mod_auth_pam.c* mod_auth_unix.c

# Be warned: use of this directive impacts CPU average load!
# Uncomment this if you like to see progress and transfer rate with ftpwho
# in downloads. That is not needed for uploads rates.
#
# UseSendFile           off

TransferLog /var/log/proftpd/xferlog
SystemLog   /var/log/proftpd/proftpd.log

# Logging onto /var/log/lastlog is enabled but set to off by default
#UseLastlog on

# In order to keep log file dates consistent after chroot, use timezone info
# from /etc/localtime.  If this is not set, and proftpd is configured to
# chroot (e.g. DefaultRoot or <Anonymous>), it will use the non-daylight
# savings timezone regardless of whether DST is in effect.
#SetEnv TZ :/etc/localtime

<IfModule mod_quotatab.c>
QuotaEngine off
</IfModule>

<IfModule mod_ratio.c>
Ratios off
</IfModule>


# Delay engine reduces impact of the so-called Timing Attack described in
# http://www.securityfocus.com/bid/11430/discuss
# It is on by default. 
<IfModule mod_delay.c>
DelayEngine on
</IfModule>

<IfModule mod_ctrls.c>
ControlsEngine        off
ControlsMaxClients    2
ControlsLog           /var/log/proftpd/controls.log
ControlsInterval      5
ControlsSocket        /var/run/proftpd/proftpd.sock
</IfModule>

<IfModule mod_ctrls_admin.c>
AdminControlsEngine off
</IfModule>

#
# Alternative authentication frameworks
#
#Include /etc/proftpd/ldap.conf
#Include /etc/proftpd/sql.conf

#
# This is used for FTPS connections
#
#Include /etc/proftpd/tls.conf

#
# Useful to keep VirtualHost/VirtualRoot directives separated
#
#Include /etc/proftpd/virtuals.conf

# A basic anonymous configuration, no upload directories.

# <Anonymous ~ftp>
#   User                ftp
#   Group               nogroup
#   # We want clients to be able to login with "anonymous" as well as "ftp"
#   UserAlias           anonymous ftp
#   # Cosmetic changes, all files belongs to ftp user
#   DirFakeUser on ftp
#   DirFakeGroup on ftp
# 
#   RequireValidShell       off
# 
#   # Limit the maximum number of anonymous logins
#   MaxClients          10
# 
#   # We want 'welcome.msg' displayed at login, and '.message' displayed
#   # in each newly chdired directory.
#   DisplayLogin            welcome.msg
#   DisplayChdir        .message
# 
#   # Limit WRITE everywhere in the anonymous chroot
#   <Directory *>
#     <Limit WRITE>
#       DenyAll
#     </Limit>
#   </Directory>
# 
#   # Uncomment this if you're brave.
#   # <Directory incoming>
#   #   # Umask 022 is a good standard umask to prevent new files and dirs
#   #   # (second parm) from being group and world writable.
#   #   Umask               022  022
#   #            <Limit READ WRITE>
#   #            DenyAll
#   #            </Limit>
#   #            <Limit STOR>
#   #            AllowAll
#   #            </Limit>
#   # </Directory>
# 
# </Anonymous>

# Include other custom configuration files
Include /etc/proftpd/conf.d/
<Global>
DefaultRoot ~
AllowOverwrite on
</Global>

我有什么办法阻止它自己关闭吗?

谢谢。

EN

回答 2

Ask Ubuntu用户

回答已采纳

发布于 2017-02-05 23:26:33

禤浩焯的回答是什么帮助我找到了我所需要的,但更详细地说,我所做的一切完全奏效了。

对我来说,关键是我将monit作为一个解决方案来安装,它可以监视proftpd进程,并确保它在任何时候都在运行,如果它检测到服务没有运行,那么它就会启动它。

First

确保先更新和升级

代码语言:javascript
复制
apt-get update
apt-get upgrade

第二

下载和安装莫尼特

代码语言:javascript
复制
apt-get install monit

第三代

代码语言:javascript
复制
cd /etc/monit/
vi monitrc

找到注释行set httpd port 2812 and并取消注释/更改为

代码语言:javascript
复制
set httpd port 2812

如果您希望能够访问它,而不是仅从本地主机,而是远程访问,请删除“和”。

那么只有取消注释行

代码语言:javascript
复制
allow admin:monit

这是您登录所需的用户身份验证凭据,根据您的需要更改它们。

然后将这个添加到文件中,我在页面底部添加了我的。更改您的端口号以匹配您的端口号,否则默认为21。

代码语言:javascript
复制
check process proftpd with pidfile /var/run/proftpd.pid
start program = "/etc/init.d/proftpd start"
stop program  = "/etc/init.d/proftpd stop"
if failed port 21 protocol ftp then restart

然后重新启动服务

代码语言:javascript
复制
/etc/init.d/monit restart

你完了然后..。欢迎你!这是一张很好的照片,让你看看它是什么样子

您可以从youripordomain.com:2812访问web接口。

Monit将不断检查服务,如果不运行,将启动它。您想要检查的任何服务都有很好的工具。

边注

如果您在monit中启动了接收状态“不存在”,那么请检查proftpd的PID文件中的proftpd PID是否匹配。

首先,确保proftpd正在运行/etc/init.d/proftpd start

然后在终端中键入top并查找当前正在运行的proftpd的PID

转到/var/run/proftpd.PID,确保该文件中的PID与top中的PID匹配。如果没有,则在文件中更改它并重新启动monit。

/etc/init.d/monit restart

票数 2
EN

Ask Ubuntu用户

发布于 2015-08-15 21:44:08

我找到了解决办法。

不知道这是不是最好的,但它对我有用。

我为proftpd服务设置了一个监视器,如果检测到proftps为off,我将调用proftpd启动命令,仅此而已。

希望这能有所帮助。

票数 3
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/524334

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档