Author Topic: ProFTPD Module 'mod_deflate' installation  (Read 39999 times)

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
ProFTPD Module 'mod_deflate' installation
« on: January 23, 2009, 04:42:19 pm »
Hello,

I have a ProFTPD server running, and need Mode-Z support.  I'm pretty new at Ubuntu, and not very knowledgeable yet.  Could someone explain to me how to install mod_deflate?
I've searched online for about an hour, poured over everything at castaglia.org, and still don't understand.  First off, which directory does the .c file need to be extracted to?  I don't have a 'proftpd-dir/contrib/' folder anywhere that I can find...

Thanks in advance,
-Aaron

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5450
    • View Profile
    • http://www.castaglia.org/
Re: ProFTPD Module 'mod_deflate' installation
« Reply #1 on: January 23, 2009, 04:44:40 pm »
The installation instructions for most of the modules on castaglia.org assume that you are installing from source.  You will need to install proftpd from source if you want to use the mod_deflate module.

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
Re: ProFTPD Module 'mod_deflate' installation
« Reply #2 on: January 26, 2009, 01:18:25 pm »
Installing from source seems a bit over my head;  I have a working ProFTPD install running, along with Webmin.  Is is worth the risk of breaking something, and how likely is it that something will break?  Are there any other FTP Server which can be simply configured to utilized Mode-Z without too much trouble?

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
Re: ProFTPD Module 'mod_deflate' installation
« Reply #3 on: January 26, 2009, 06:15:53 pm »
I tried installing from source, and when I execute the 'make' command, all goes seemingly well until the following:

mod_deflate.c:32:18: error: zlib.h: No such file or directory
mod_deflate.c:62: error: ‘Z_DEFAULT_STRATEGY’ undeclared here (not in a function)
mod_deflate.c:67: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
mod_deflate.c: In function ‘deflate_zstrerror’:
mod_deflate.c:83: error: ‘Z_OK’ undeclared (first use in this function)
mod_deflate.c:83: error: (Each undeclared identifier is reported only once
mod_deflate.c:83: error: for each function it appears in.)
mod_deflate.c:86: error: ‘Z_STREAM_END’ undeclared (first use in this function)
mod_deflate.c:89: error: ‘Z_NEED_DICT’ undeclared (first use in this function)
mod_deflate.c:92: error: ‘Z_ERRNO’ undeclared (first use in this function)
mod_deflate.c:95: error: ‘Z_DATA_ERROR’ undeclared (first use in this function)
mod_deflate.c:98: error: ‘Z_MEM_ERROR’ undeclared (first use in this function)
mod_deflate.c:101: error: ‘Z_BUF_ERROR’ undeclared (first use in this function)
mod_deflate.c:104: error: ‘Z_VERSION_ERROR’ undeclared (first use in this function)
mod_deflate.c: In function ‘deflate_netio_close_cb’:
mod_deflate.c:118: error: ‘z_stream’ undeclared (first use in this function)
mod_deflate.c:118: error: ‘zstrm’ undeclared (first use in this function)
mod_deflate.c:127: warning: implicit declaration of function ‘deflateEnd’
mod_deflate.c:128: error: ‘Z_OK’ undeclared (first use in this function)
mod_deflate.c:147: warning: implicit declaration of function ‘inflateEnd’
mod_deflate.c: In function ‘deflate_netio_open_cb’:
mod_deflate.c:172: error: ‘z_stream’ undeclared (first use in this function)
mod_deflate.c:172: error: ‘zstrm’ undeclared (first use in this function)
mod_deflate.c:173: error: ‘Z_NULL’ undeclared (first use in this function)
mod_deflate.c:183: error: ‘deflate_zbuf’ undeclared (first use in this function)
mod_deflate.c:187: warning: implicit declaration of function ‘deflateInit2’
mod_deflate.c:187: error: ‘Z_DEFLATED’ undeclared (first use in this function)
mod_deflate.c:191: error: ‘Z_OK’ undeclared (first use in this function)
mod_deflate.c:196: error: ‘Z_MEM_ERROR’ undeclared (first use in this function)
mod_deflate.c:197: error: ‘Z_STREAM_ERROR’ undeclared (first use in this function)
mod_deflate.c:207: warning: implicit declaration of function ‘inflateInit2’
mod_deflate.c: In function ‘deflate_netio_read_cb’:
mod_deflate.c:243: error: ‘z_stream’ undeclared (first use in this function)
mod_deflate.c:243: error: ‘zstrm’ undeclared (first use in this function)
mod_deflate.c:253: error: ‘deflate_zbuf’ undeclared (first use in this function)
mod_deflate.c:268: warning: implicit declaration of function ‘inflate’
mod_deflate.c:268: error: ‘Z_NO_FLUSH’ undeclared (first use in this function)
mod_deflate.c:270: error: ‘Z_STREAM_END’ undeclared (first use in this function)
mod_deflate.c:273: error: ‘Z_OK’ undeclared (first use in this function)
mod_deflate.c: In function ‘deflate_netio_shutdown_cb’:
mod_deflate.c:335: error: ‘z_stream’ undeclared (first use in this function)
mod_deflate.c:335: error: ‘zstrm’ undeclared (first use in this function)
mod_deflate.c:338: error: ‘Z_NULL’ undeclared (first use in this function)
mod_deflate.c:341: warning: implicit declaration of function ‘deflate’
mod_deflate.c:341: error: ‘Z_FINISH’ undeclared (first use in this function)
mod_deflate.c:343: error: ‘Z_OK’ undeclared (first use in this function)
mod_deflate.c:344: error: ‘Z_STREAM_END’ undeclared (first use in this function)
mod_deflate.c:350: error: ‘deflate_zbuf’ undeclared (first use in this function)
mod_deflate.c: In function ‘deflate_netio_write_cb’:
mod_deflate.c:373: error: ‘z_stream’ undeclared (first use in this function)
mod_deflate.c:373: error: ‘zstrm’ undeclared (first use in this function)
mod_deflate.c:376: error: ‘Bytef’ undeclared (first use in this function)
mod_deflate.c:376: error: expected expression before ‘)’ token
mod_deflate.c:379: error: ‘Z_NO_FLUSH’ undeclared (first use in this function)
mod_deflate.c:380: error: ‘Z_OK’ undeclared (first use in this function)
mod_deflate.c:387: error: ‘deflate_zbuf’ undeclared (first use in this function)
mod_deflate.c: In function ‘deflate_sess_init’:
mod_deflate.c:702: error: ‘deflate_zbuf’ undeclared (first use in this function)
mod_deflate.c: In function ‘deflate_init’:
mod_deflate.c:719: error: expected ‘)’ before ‘ZLIB_VERSION’
At top level:
cc1: error: unrecognized command line option "-Wno-long-double"
make[1]: *** [mod_deflate.o] Error 1
make[1]: Leaving directory `/home/aaron/proftpd-1.3.1/modules'
make: *** [modules] Error 2

I do have 'mod_deflate.c' in the /contrib folder.  What else am I doing wrong?

Thank you for your patience!

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5450
    • View Profile
    • http://www.castaglia.org/
Re: ProFTPD Module 'mod_deflate' installation
« Reply #4 on: January 26, 2009, 07:09:39 pm »
It looks like you need the zlib development package (called "zlib-dev" or "libz-dev" on some systems), which contains the zlib header.  This is necessary for compiling mod_deflate.

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
Re: ProFTPD Module 'mod_deflate' installation
« Reply #5 on: January 26, 2009, 08:45:19 pm »
I downloaded the zlib package, and re-ran the 'make' and 'make install' commands.  This time there were no errors, but ProFTPD did not install.  I ran them under root, and tried the 'make install' command several times without success.  When I execute the command 'proftpd' from terminal, it doesn't give me an error either, leading me to believe the program is partially installed or something.

Any ideas?

Output from install attempt:

root@ubuntu-server:/home/aaron/proftpd-1.3.1# make install
cd lib/ && make lib
make[1]: Entering directory `/home/aaron/proftpd-1.3.1/lib'
make[1]: Nothing to be done for `lib'.
make[1]: Leaving directory `/home/aaron/proftpd-1.3.1/lib'
cd src/ && make src
make[1]: Entering directory `/home/aaron/proftpd-1.3.1/src'
make[1]: Nothing to be done for `src'.
make[1]: Leaving directory `/home/aaron/proftpd-1.3.1/src'
cd modules/ && make static
make[1]: Entering directory `/home/aaron/proftpd-1.3.1/modules'
make[1]: Leaving directory `/home/aaron/proftpd-1.3.1/modules'
test -z """" -a -z """" || (cd modules/ && make shared)
make[1]: Entering directory `/home/aaron/proftpd-1.3.1/lib/libcap'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/aaron/proftpd-1.3.1/lib/libcap'
test -z """" || (cd locale/ && make locale)
/bin/sh ./libtool --mode=link gcc -L./lib    -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/table.o src/regexp.o src/dirtree.o src/support.o src/netaddr.o src/inet.o src/child.o src/parser.o src/log.o src/lastlog.o src/xferlog.o src/bindings.o src/netacl.o src/class.o src/scoreboard.o src/help.o src/feat.o src/netio.o src/response.o src/ident.o src/data.o src/modules.o src/display.o src/auth.o src/fsio.o src/mkhome.o src/ctrls.o src/event.o src/var.o src/trace.o src/utf8.o src/proctitle.o src/pidfile.o src/env.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_delay.o modules/mod_cap.o  modules/module_glue.o  -Llib/libcap -lcap -lsupp -lcrypt 
gcc -o proftpd src/main.o src/timers.o src/sets.o src/pool.o src/table.o src/regexp.o src/dirtree.o src/support.o src/netaddr.o src/inet.o src/child.o src/parser.o src/log.o src/lastlog.o src/xferlog.o src/bindings.o src/netacl.o src/class.o src/scoreboard.o src/help.o src/feat.o src/netio.o src/response.o src/ident.o src/data.o src/modules.o src/display.o src/auth.o src/fsio.o src/mkhome.o src/ctrls.o src/event.o src/var.o src/trace.o src/utf8.o src/proctitle.o src/pidfile.o src/env.o modules/mod_core.o modules/mod_xfer.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_delay.o modules/mod_cap.o modules/module_glue.o  -L/home/aaron/proftpd-1.3.1/lib -L/home/aaron/proftpd-1.3.1/lib/libcap -lcap -lsupp -lcrypt
cd utils/ && make utils
make[1]: Entering directory `/home/aaron/proftpd-1.3.1/utils'
make[1]: Nothing to be done for `utils'.
make[1]: Leaving directory `/home/aaron/proftpd-1.3.1/utils'
/usr/bin/install -c -s -o root -g root -m 0755 proftpd /usr/local/sbin/proftpd
if [ -f /usr/local/sbin/in.proftpd ] ; then \
      rm -f /usr/local/sbin/in.proftpd ; \
   fi
ln -s proftpd /usr/local/sbin/in.proftpd
chown -h root:root /usr/local/sbin/in.proftpd
test -z """" -a -z """" || (cd modules/ && make install)
/usr/bin/install -c -s -o root -g root -m 0755  ftpcount /usr/local/bin/ftpcount
/usr/bin/install -c -s -o root -g root -m 0755  ftpdctl  /usr/local/bin/ftpdctl
/usr/bin/install -c -s -o root -g root -m 0755 ftpshut  /usr/local/sbin/ftpshut
/usr/bin/install -c -s -o root -g root -m 0755  ftptop   /usr/local/bin/ftptop
/usr/bin/install -c -s -o root -g root -m 0755  ftpwho   /usr/local/bin/ftpwho
if [ ! -f /usr/local/etc/proftpd.conf ] ; then \
      /usr/bin/install -c -o root -g root -m 0644 \
                 ./sample-configurations/basic.conf \
                        /usr/local/etc/proftpd.conf ; \
   fi
/usr/bin/install -c -o root -g root -m 0644 ./src/ftpdctl.8    /usr/local/man/man8
/usr/bin/install -c -o root -g root -m 0644 ./src/proftpd.8    /usr/local/man/man8
/usr/bin/install -c -o root -g root -m 0644 ./utils/ftpshut.8  /usr/local/man/man8
/usr/bin/install -c -o root -g root -m 0644 ./utils/ftpcount.1 /usr/local/man/man1
/usr/bin/install -c -o root -g root -m 0644 ./utils/ftptop.1   /usr/local/man/man1
/usr/bin/install -c -o root -g root -m 0644 ./utils/ftpwho.1   /usr/local/man/man1
/usr/bin/install -c -o root -g root -m 0644 ./src/xferlog.5    /usr/local/man/man5
/usr/bin/install -c -o root -g root -m 0644 config.h /usr/local/include/proftpd/config.h
cd include/ && make install
make[1]: Entering directory `/home/aaron/proftpd-1.3.1/include'
make[1]: Leaving directory `/home/aaron/proftpd-1.3.1/include'
test -z """" || (cd locale/ && make install)

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5450
    • View Profile
    • http://www.castaglia.org/
Re: ProFTPD Module 'mod_deflate' installation
« Reply #6 on: January 26, 2009, 10:48:44 pm »
Looks like proftpd installed as /usr/local/sbin/proftpd; is that not the expected location?

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
Re: ProFTPD Module 'mod_deflate' installation
« Reply #7 on: January 27, 2009, 09:49:10 pm »
That wasn't the expected location.   :-[  I pointed webmin to that location, and it picked up Proftpd, although it does not show up as installed in synaptic.  Is there another way to find out if something has been correctly installed? 

In the modules.conf file, line 7, where do the DSO modules reside at?  When I try to start the service, I get the error ' - Fatal: unknown configuration directive 'ModulePath' on line 7 of '/etc/proftpd/modules.conf' ' 

I've looked at modules.conf, and it points to the directory where ProFTPD was installed from.  My previous, working config file points to '/usr/lib/proftpd', which no longer exists.

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5450
    • View Profile
    • http://www.castaglia.org/
Re: ProFTPD Module 'mod_deflate' installation
« Reply #8 on: January 28, 2009, 12:08:33 am »
The "unknown configuration directive 'ModulePath'" error means that your configure line, when compiling proftpd, did not include --enable-dso.

You might want to read through:

  http://www.proftpd.org/docs/howto/Compiling.html

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
Re: ProFTPD Module 'mod_deflate' installation
« Reply #9 on: January 28, 2009, 04:41:04 pm »
I read through the page you provided, and added 'enable-dso' to my configuration command.  Thank you.  Now when I try to configure, my command "./configure --enable-dso --with-modules=mod_deflate" nets me no errors, but when I execute the 'make' command, all goes well until the following:


gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I../lib/libltdl  -O2 -Wall -Wno-long-double -c mod_dso.c
gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include -I../lib/libltdl  -O2 -Wall -Wno-long-double -c mod_deflate.c
mod_deflate.c: In function ‘deflate_netio_read_cb’:
mod_deflate.c:245: warning: pointer targets in assignment differ in signedness
At top level:
cc1: error: unrecognized command line option "-Wno-long-double"
make[1]: *** [mod_deflate.o] Error 1
make[1]: Leaving directory `/agpro_files/proftpd/modules'
make: *** [modules] Error 2


I've tried it a couple times, running 'make clean' before running the ./configure command once again.  Any idea what causes this?  I can't find anything else out about these errors online.




Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5450
    • View Profile
    • http://www.castaglia.org/
Re: ProFTPD Module 'mod_deflate' installation
« Reply #10 on: January 28, 2009, 11:56:04 pm »
Ah, that particular issue.  The short story is that it's a combination of a subtle gcc bug and a subtle proftpd configure operation.  The proftpd configure script wants to use the -Wno-long-double gcc option, to avoid gcc warnings on Mac OS X.  Newer gcc versions, if they are given an option they don't know (like -Wno-long-double) AND run into a warning in the code, choke.

The easiest thing to do is to use proftpd-1.3.2rc4; the proftpd configure script was updated to only use -Wno-long-double on Mac OS X (whose gcc *does* support that option), and no where else.

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
Re: ProFTPD Module 'mod_deflate' installation
« Reply #11 on: January 29, 2009, 02:34:44 pm »
I downloaded the .rc4 version, deleted all files associated with the previous one, extracted into the same directory, copied mod_deflate.c into /contrib, and ran the ./configure command as before.  Now when I run the make command, I get the following at the end:
Code: [Select]
gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include  -O2 -Wall -c mod_deflate.c
mod_deflate.c:69: error: ‘PR_TUNABLE_XFER_BUFFER_SIZE’ undeclared here (not in a function)
mod_deflate.c: In function ‘deflate_netio_read_cb’:
mod_deflate.c:245: warning: pointer targets in assignment differ in signedness
make[1]: *** [mod_deflate.o] Error 1
make[1]: Leaving directory `/agpro_files/proftpd/modules'
make: *** [modules] Error 2

If I go ahead and run 'make install', it gives me this after about half a second:

Code: [Select]
make[1]: Entering directory `/agpro_files/proftpd/modules'
gcc -DHAVE_CONFIG_H  -DLINUX  -I.. -I../include  -O2 -Wall -c mod_deflate.c
mod_deflate.c:69: error: ‘PR_TUNABLE_XFER_BUFFER_SIZE’ undeclared here (not in a function)
mod_deflate.c: In function ‘deflate_netio_read_cb’:
mod_deflate.c:245: warning: pointer targets in assignment differ in signedness
make[1]: *** [mod_deflate.o] Error 1
make[1]: Leaving directory `/agpro_files/proftpd/modules'
make: *** [modules] Error 2

I was getting these errors with the other version of ProFTPD as well, see my previous post, they're near the top of the excerpt.http://

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5450
    • View Profile
    • http://www.castaglia.org/
Re: ProFTPD Module 'mod_deflate' installation
« Reply #12 on: January 29, 2009, 05:29:31 pm »
Ah, I see the issue.  I've released mod_deflate-0.3.1 on castaglia.org; it should compile properly now.

Offline Bravo

  • New user
  • *
  • Posts: 12
    • View Profile
Re: ProFTPD Module 'mod_deflate' installation
« Reply #13 on: January 29, 2009, 06:59:31 pm »
Okay,  I've downloaded that version, uninstalled and ran 'make clean', etc, etc.  I installed using the 1.3.2 rc version, and the installation went without a hitch.  Now, however, when I attempt to start the ProFTPd server in Webmin, I receive the error:

Code: [Select]
 Fatal: ModulePath: error checking '/usr/lib/proftpd': No such file or directory on line 7 of '/etc/proftpd/modules.conf' 
Line 7 is:
Code: [Select]
 ModulePath /usr/lib/proftpd 
Which does not exist.  I know that the modules are supposed to be installed under /libexec.  However, the only libexec on my entire computer is empty, and it is found under '/usr/local/libexec', and is empty.  Any idea where my modules are?

Offline castaglia

  • Administrator
  • Support Hero
  • *****
  • Posts: 5450
    • View Profile
    • http://www.castaglia.org/
Re: ProFTPD Module 'mod_deflate' installation
« Reply #14 on: January 29, 2009, 09:14:08 pm »
The libexec/ directory is used for shared/DSO modules (i.e. the modules you list in your configure command with --with-shared), but not for static modules.  You can simply create the /usr/lib/proftpd directory to quell the error; proftpd should run with an empty ModulePath directory.