How to install a mod_ftp module on a MAMP server How to install a mod_ftp module on a MAMP server apache apache

How to install a mod_ftp module on a MAMP server


I ended up scrapping MAMP and using the Mac's built in server. Through the System Preferences > Sharing menu, you can enable file sharing, which has an Options pane that allows you to "Share files and folders using FTP." I was able to obtain a static IP address through Comcast Business, and configured port forwarding on port 21 in my router to accept traffic. Then, I could use my FTP client to connect to my router with something like "123.456.789:21" as my host. Wasn't the best or most secure solution, but it worked, so take it with a grain of salt.


Right, I finally managed to install this on Ubuntu LTS 16.04.

First of all, you should install svn and the apxs functionality by running
sudo apt-get install subversion apache2-dev.

Then, cd to a convenient folder, and run svn co http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/. This downloads everything in the folder named /trunk. Then, cd into the /trunk folder of the downloaded repo.

Then, run the stated instructions
./configure.apxs --> does something in the subfolder to enable makefile to work
make --> this compiles the contents of the repo and changes things around.
make install --> you may want to run with the suggested flag. Essentially copies things to where it needs to be copied, and creates the necessary modules.

The suggested ./buildconf and ./configure should only be done if you are compiling apache2 with ftp at the same time. Since you should already have apache2 installed, this is not the option that you should be doing. Just stick with the first set of instructions, which are used to compile mod_ftp independently of apache2 and patch things in as needed.

At this point, the installation should technically work. However, you are not fully out of the woods yet. If you restart apache2 at this point, it should fail to start. If you run systemctl -xe, you will see that it is due to syntax errors in various places of the config files where someone forgot to prepend a forward slash, so rather than being given relative to root, the directories being specified end up being relative to /etc/apache2 instead. Fix those, using the line numbers as a guide. The omissions may be found in the apache2.conf file that specify the location of the mod_ftp module, and in the ftpd.conf file that specify the location of the error log.

You now need to mess around with apache2.conf and ftpd.conf (found in the /extra subfolder of the /etc/apache2 folder). Make sure that the lines
include /etc/apache2/extra/ftpd.conf
LoadModule ftp_module /usr/lib/apache2/modules/mod_ftp.so are present and uncommented.
The first basically tells the main apache2.conf file to include the configuration files for mod_ftp to help with partitioning your http and ftp configuration settings. The second just makes sure that the ftp module is loaded so that it can interpret the directives in the ftpd.conf file. Thus, you won't need to add the line "FTP on" or specify ports, as those are handled in ftpd.conf perfectly well.

You should now be good to go. Just note that for some weird reason if you set the document root in ftpd.conf to be the same as that in apache2.conf, apache2 will still run normally. The ftp server will work normally but the http server will not work. No idea why, but if you want to do that a simple workaround is to just do a symlink to the http document root and set that as the ftp document root.