Mar 1

VSFTPD and WordPress

Tags:

———————————————————————
– OVERVIEW / THOUGHT PROCESS –
———————————————————————

I was starting to get frustrated with the update and install process for WordPress.  Permissions were good and settings were correct, however when I filled in the connection information for the upgrade, a ‘Failed to Connect to FTP Server’ would rear it’s ugly head.

As I was troubleshooting, I ran across this option which allows WordPress to update without prompting for the connection information.  Its worked out for quite a while now, so I’d like to share the configuration with you.  Try it out and see if you like it.  If you don’t, no harm no foul!  Go back to the original configuration file and forget about the whole thing 🙂

# Credit goes to Brian

———————————————————————
– VSFTPD INSTALL / CONFIG (FTP SERVER) –
———————————————————————

# Once VSFTPD is setup, and the proper code is inserted into your WordPress config.php file, the updates and installs will be seamless and smooth.  When you hit the update or install button for whichever entity you need, WordPress and VSFTPD will take care of the rest.

$ sudo yum install vsftpd
# you will only need to do this if you don’t have vsftpd installed on your system.

$ sudo service vsftpd stop

$ cd /etc/vsftpd

$ sudo cp vsftpd.conf vsftpd.conf.orig
# ALWAYS back-up your original configuration file!  If you screw up, you can start over.

$ sudo nano vsftpd.conf
# (use ctl-o to save and ctl-x to exit)

# Change or add the following without the comment (#) character:
# listen=YES
# anonymous_enable=NO
# local_enable=YES
# write_enable=YES
# local_umask=022
# dirmessage_enable=YES
# use_localtime=YES
# xferlog_enable=YES
# secure_chroot_dir=/var/run/vsftpd/empty
# pam_service_name=vsftpd
# rsa_cert_file=/etc/ssl/certs/server.crt
# rsa_private_key_file=/etc/ssl/private/server.key
# ssl_enable=YES
# allow_anon_ssl=NO
# force_local_data_ssl=YES
# force_local_logins_ssl=YES
# ssl_tlsv1=YES
# ssl_sslv2=NO
# ssl_sslv3=NO
# anon_world_readable_only=NO
# anon_upload_enable=NO
# anon_mkdir_write_enable=NO
# connect_from_port_20=NO
# listen_port=2112

$ sudo service vsftpd restart

$ sudo service vsftpd enable
# Enable tells the server that you would like it to start this service every time you boot into linux.

# There are two configurations to consider with this tutorial.  The first is the server.key file that you used in the configuration.  I’ve covered the making of this file in the ‘Fedora (Let’s Make A Server!)‘ post.  The second thing to consider is the new port that you’ve configured for VSFTP and the firewall entry that could keep you out.  The iptables entry of that same post will explain the firewall.  But as you connect, make sure you use port 2112 (or whatever you set) so that you can get through.

—————————————–

Always remember… WHAT IF AND WHY NOT?!?