背景:
我最近安装了 MAMP,并将其用作生产服务器。服务器设置没有附带 FTP 服务器,根据我的阅读,您可以通过 Apache 模块 mod_ftp 设置 FTP 服务器。我不是 Apache 软件或服务器管理员方面的专家,尽管我可以快速学习。我可以达到以下几点,然后我被卡住了。有人可以帮我吗?
我从存储库中检查了 mod_ftp 模块文件,这里:
http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/
我将内容解压缩到:
/Applications/MAMP/mod_ftp
我打开了 README-FTP 文件(在这里):
http://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/README-FTP
自述文件-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.
一些问题:
httpd 源码树”居然要我做?(在上面??如在 httpd 源码树的父目录中,还是在同一目录中?)
从这一点开始,我选择了第一个选项,并将 README-FTP 中看到的命令输入到我的终端中。
这是我的终端的样子:
$ ./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
$
那么我该怎么做呢?
我在任何地方都看不到 mod_ftp.so,而且我特别关注这个目录:
/Applications/MAMP/Library/modules (where all of Apache's other mod_*.so files are...)
和这个目录:
/Applications/MAMP/mod_ftp/modules/ftp (where all of mod_ftp's various .c, .h and other files are)
最终,我认为我遇到的问题是我不明白我的 mod_ftp 源文件夹和 httpd 源文件夹之间的文件结构需要如何集成才能使模块正常运行。另外,我不知道我不知道什么,所以可能有一个简单的问题要问,但不幸的是我不知道如何问。感谢您的帮助和耐心!
干杯!
PS,是的,我已经在互联网上搜索了几个小时。
最佳答案
我最终放弃了 MAMP 并使用 Mac 的内置服务器。通过“系统偏好设置”>“共享”菜单,您可以启用文件共享,其中有一个“选项” Pane ,允许您“使用 FTP 共享文件和文件夹”。我能够通过 Comcast Business 获得静态 IP 地址,并在路由器的 21 端口上配置端口转发以接受流量。然后,我可以使用我的 FTP 客户端以“123.456.789:21”之类的东西作为我的主机连接到我的路由器。不是最好或最安全的解决方案,但它确实有效,因此请谨慎对待。
关于ftp - 如何在 MAMP 服务器上安装 mod_ftp 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10021602/