Question

Background:

I recently installed MAMP, and am using it as a production server. The server setup did not come with an FTP server, and from what I've read, you can set up an FTP server via mod_ftp, an Apache module. I am not an expert with Apache software or server admin, although I can learn quickly. I can get to the following point and then I get stuck. Can someone please help me out?

I checked out the mod_ftp module files from the repository, here: http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/ and I unzipped the contents into:

/Applications/MAMP/mod_ftp

I opened the README-FTP file (here):
http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/README-FTP

README-FTP:

To build and install as a DSO outside of the httpd source
build, from the ftp source root directory, simply;

    ./configure.apxs
    make
    make install

...

To build static, or as a DSO but within the same build as httpd,
copy the entire ftp source directory tree on top of your existing 
httpd source tree, and from the httpd source root directory

    ./buildconf  (to pick up ftp)
    ./configure --enable-ftp {your usual options}

and proceed as usual.

Some Questions:

  1. "build and install a DSO outside of the httpd source build, from the ftp source root directory" -- is the ftp source root directory the mod_ftp folder that I created from the zipped files I checked out from the repository?

  2. What does it mean "outside of the httpd source build"? -- is this the ServerRoot value I set in the httpd.conf as "/Applications/MAMP/Library" ?

  3. Likewise, what does "within the same httpd build" mean -- what location is this referring to?

  4. How do I know whether I want a static or DSO build?

  5. What is the statement: "copy the entire ftp source directory tree on top of your existing httpd source tree" actually asking me to do? (on top of?? As in, in the parent directory of the httpd source tree, or in the same directory?)

  6. If you've made it this far, I'd like to commend you!

From this point, I chose the first option, and entered the commands seen in README-FTP into my Terminal.

Here's what my terminal looks like:

$ ./configure.apxs
Configuring mod_ftp for APXS in /usr/sbin/apxs
Detecting features

Finished, run 'make' to compile mod_ftp

Run 'make FTPPORT=8021 install' to install mod_ftp
(The default FTPPORT is 21 if not specified)

The manual pages ftp/index.html and mod/mod_ftp.html
will be installed to help get you started.

The conf/extra/ftpd.conf will be installed as an example
for you to work from.  In your configuration file,
  /private/etc/apache2/httpd.conf
uncomment the line '#Include conf/extra/ftpd.conf'
to activate this example mod_ftp configuration.
$ make
Making all in modules/ftp
$ sudo make install
Password:
Making install in modules/ftp
/usr/share/apr-1/build-1/libtool --silent --mode=install cp mod_ftp.la /usr/libexec/apache2/
Installing configuration files
for i in /private/etc/apache2/httpd.conf /private/etc/apache2/original/httpd.conf; do \
        if test -f $i; then \
        (awk -f /applications/mamp/library/mod_ftp/build/addloadexample.awk \
            -v MODULE=ftp -v DSO=.so -v LIBPATH=libexec/apache2 \
            -v EXAMPLECONF=/private/etc/apache2/extra/ftpd.conf \
            < $i > $i.new && \
            mv $i $i.bak && mv $i.new $i \
            ) || true; \
        fi; \
        done
Preserving existing FTP documents
Installing header files
Installing online manual
$ 

So what do I do from here? I don't see mod_ftp.so anywhere, and I am particularly looking in this directory:

/Applications/MAMP/Library/modules (where all of Apache's other mod_*.so files are...)

and this directory:

/Applications/MAMP/mod_ftp/modules/ftp (where all of mod_ftp's various .c, .h and other files are)

Ultimately, I think the problem I am running into is that I don't understand how the file structures between my mod_ftp source folder and the httpd source folders need to be integrated in order to get the module running properly. Also, I don't know what I don't know, so there is probably one simple question to ask, but unfortunately I can't figure out how to ask it. Thank you for your help and patience!

Cheers!

P.S., yes, I have scoured the internet for hours.

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top