I have been trying to install and configure ProFTPd 1.3.8c on CentOS 7, but when I try to start the service, it fails.
Installation and Configuration Process:
Here's a summary of my installation and configuration steps:
Installing Dependencies:
Configuring the Service:
Modifying the Init Script (/etc/init.d/proftpd)
I made the following changes:
Configuring ProFTPd:
In /etc/proftpd/proftpd.conf, I made the following changes:
Path Setup:
Creating Required Directories:
Issues Encountered:
After performing these steps, I attempted to start the ProFTPd service with the following command:
But it failed with this message:
I tried running the following commands to troubleshoot:
The output showed:
in the log, it says that
Troubleshooting Attempts:
Ensured Directory Permissions: I created the necessary directories and changed the ownership and permissions:
Modified proftpd.service File:
In /home/a/proftpd-1.3.8c/contrib/dist/rpm/proftpd.service, I updated the ExecStart line to ensure the correct binary is used:
Current Status:
The service still fails to start, even after these modifications. The log error message indicates that it still cannot create the PID file in /run/proftpd/.and the log file itself stop to record the activities
My Questions:
Could this issue be related to file system permissions or the user under which ProFTPd is running?
What steps can I take to resolve the PID file creation issue?
Are there any other configuration changes I might be missing that could be preventing ProFTPd from starting?
Thank you for your help!I am using the terminal with the username "a", not "ftpuser", and while I reopen a terminal, the newly added path in $PATH disappear!
EDIT**#################################################**
i have used
Installation and Configuration Process:
Here's a summary of my installation and configuration steps:
Installing Dependencies:
sudo yum install openssl-devel
cd /home/a/
wget ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.8c.tar.gz
yum install gcc gcc-c++ autoconf automake
tar -xzf proftpd-1.3.8c.tar.gz
cd proftpd-1.3.8c
./configure --prefix=/usr/local/proftpd \
--sysconfdir=/etc/proftpd \
--enable-nls \
--enable-openssl \
--enable-shadow
make
make install
Configuring the Service:
cp contrib/dist/rpm/proftpd.init.d /etc/init.d/proftpd
chmod +x /etc/init.d/proftpd
chkconfig --add proftpd
chkconfig proftpd on
Modifying the Init Script (/etc/init.d/proftpd)
I made the following changes:
Creating FTP User and Group:# From:
[ ${NETWORKING} = "no" ] && exit 1
# To:
[[ ${NETWORKING} = "no" ]] && exit 1
And later in the script, I changed:
# From:
[ -x /usr/sbin/proftpd ] || exit 5
# To:
[ -x /usr/local/proftpd/sbin/proftpd ] || exit 5
Firewall Configuration:
firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
groupadd ftpgroup
useradd -g ftpgroup -d /var/ftp -s /sbin/nologin ftpuser
Configuring ProFTPd:
In /etc/proftpd/proftpd.conf, I made the following changes:
User ftpuser
Group ftpgroup
PidFile /run/proftpd/proftpd.pid
TransferLog /var/log/proftpd/transfer.log
SystemLog /var/log/proftpd/syslog.log
Path Setup:
nano ~/.bash_profile
# Add:
export PATH=$PATH:/usr/local/proftpd/sbin
source ~/.bash_profile
Creating Required Directories:
sudo mkdir -p /var/log/proftpd/
sudo mkdir -p /run/proftpd/
sudo chown ftpuser:ftpgroup /run/proftpd/
sudo chmod 755 /run/proftpd/
Issues Encountered:
After performing these steps, I attempted to start the ProFTPd service with the following command:
service proftpd start
But it failed with this message:
vbnet
Copy code
Starting proftpd (via systemctl): Warning: proftpd.service changed on disk. Run 'systemctl daemon-reload' to reload units.
Job for proftpd.service failed because the control process exited with error code. See "systemctl status proftpd.service" and "journalctl -xe" for details.
[FAILED]
I tried running the following commands to troubleshoot:
systemctl status proftpd
The output showed:
I also checked the logs with journalctl -xe and found the error:● proftpd.service - LSB: ProFTPd FTP Server
Loaded: loaded (/etc/rc.d/init.d/proftpd; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Fri 2025-01-03 06:39:09 EST; 14s ago
in the log, it says that
error writing PidFile '/run/proftpd/proftpd.pid': No such file or directory
Troubleshooting Attempts:
Ensured Directory Permissions: I created the necessary directories and changed the ownership and permissions:
sudo mkdir -p /run/proftpd/
sudo chown ftpuser:ftpgroup /run/proftpd/
sudo chmod 755 /run/proftpd/
Modified proftpd.service File:
In /home/a/proftpd-1.3.8c/contrib/dist/rpm/proftpd.service, I updated the ExecStart line to ensure the correct binary is used:
ExecStart = /usr/local/proftpd/sbin/proftpd --nodaemon $PROFTPD_OPTIONS
ExecStartPre=/usr/local/proftpd/sbin/proftpd --configtest
Current Status:
The service still fails to start, even after these modifications. The log error message indicates that it still cannot create the PID file in /run/proftpd/.and the log file itself stop to record the activities
My Questions:
Could this issue be related to file system permissions or the user under which ProFTPd is running?
What steps can I take to resolve the PID file creation issue?
Are there any other configuration changes I might be missing that could be preventing ProFTPd from starting?
Thank you for your help!I am using the terminal with the username "a", not "ftpuser", and while I reopen a terminal, the newly added path in $PATH disappear!
EDIT**#################################################**
i have used
to better save the $PATH, and change the ftpgroup and ftpuser to the user of sudo, and after restart it again, the logs says that it isecho 'export PATH=$PATH:/usr/local/proftpd/sbin' >> ~/.bashrc
source ~/.bashrc
2025-01-03 07:06:17,300 vbox proftpd[19715] vbox: ProFTPD 1.3.8c (maint) (built Fri Jan 3 2025 06:22:03 EST) standalone mode STARTUP
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Failed binding to 0.0.0.0, port 21: Address already in use
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Check the ServerType directive to ensure you are configured correctly
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Check to see if inetd/xinetd, or another proftpd instance, is already using 0.0.0.0, port 21
2025-01-03 07:27:11,746 vbox proftpd[21234] vbox: Unable to start proftpd; check logs for more details