1

I'm trying to use Cygwin to install Apache, but I keep running into an error that I can't find a solution to.

I'm following the instructions on the official Apache site for installing Apache 2.4 on a UNIX-like system, I downloaded the tar.gz version of Apache 2.4.7, as well as the latest versions of APR and the APR utilities (as recommended by the instructions), and then installed Cygwin with all of the default packages and any packages that matched the following search terms in the Cygwin installer:

  • autoconf
  • binutils
  • gcc
  • libtool
  • make
  • openssl
  • pcre
  • tcp

Next, I copied the httpd-2.4.7.tar.gz, apr-1.5.0.tar.gz and apr-util-1.5.3.tar.gz files into the Cygwin base directory and started up Cygwin. After that, I unzipped and untarred the three files and then moved both APR directories to the /httpd-2.4.7/srclib directory and removed the version number from the directory names as the instructions say to do.

After that, I ran the following commands:

cd httpd-2.4.7
./configure
make

Everything configures properly without any errors, but partway through the compilation process that make performs, I get the following error, which can also be seen in the screenshot below:

/httpd-2.4.7/srclib/apr-util/crypto/apr_passwd.c:165: undefined reference
to `crypt'

enter image description here

I have performed every search I can think of to solve the problem and tried several of the proposed solutions, but no matter what I do, I cannot resolve the issue.

Can someone please provide some advice on what to do? Thank you.

HartleySan
  • 7,404
  • 14
  • 66
  • 119
  • you coulud just install wampserver, which gives you a full apache install w/o having to compile it yourself. as for the actual problem, you're probably missing the crypt lib... run you cygwin installer and search for "crypt". it'll be in the libs section. – Marc B Feb 10 '14 at 02:58
  • Well, I already use XAMPP, so it's not an issue for actual development. I'm doing this more as an exercise, and I wanted to use Cygwin because it's a lot quicker and easier to set up than, say, Ubuntu. Anyway, I will try my luck with finding the crypt files and report back. – HartleySan Feb 10 '14 at 03:14
  • cygwin's handy, but I wouldn't use it to compile/run a webserver with. cygwin has a translation layer to map linux syscalls to windows, and it's not exactly "fast". good enough for basic stuff, but if you intend to do anything serious, you'd be better off with a full-blown native compile – Marc B Feb 10 '14 at 03:18
  • I agree 100%. Again, I'm doing this purely as a brain exercise. Someday, I will likely set up my own server in a true UNIX environment, but for now, I wanted to get my hands wet and learn the basics in a simple environment that won't totally screw things up. – HartleySan Feb 10 '14 at 03:19
  • I'd suggest playing with a virtualized environment, then. oracle virtualbox is free and can host a true unix/linux environment for you. screw something up, you kill the VM and start with a fresh one. no muss, no fuss. – Marc B Feb 10 '14 at 03:21
  • Yeah, I did install Ubuntu on VirtualBox before, but it seemed like it ran really slowly (maybe I didn't configure it properly). All the same, if I can't get Cygwin to work for me soon, then I will probably just try my hands at Ubuntu. Thanks again. By the way, I installed all "crypt"-related libraries, and `make` made it pass that error only to run into a new error: `/httpd-2.4.7/include/httpd.h:1022:5: error: unknown type name 'apr_thread_mutex_t'`. Looking into it now. – HartleySan Feb 10 '14 at 03:23
  • To compile some things in cygwin, you will have to install some -dev packages, either using the cygwin installer or by compiling those packages yourself in Cygwin. The last error you mentioned refers to APR. So, you will need to install "apr" as well (via cygwin). I'm surprised you don't get a "file not found" error for failure to find the appropriate header file – Brandin Feb 12 '14 at 18:27
  • Well, I installed APR and APR-Utils by downloading them from the Apache site, but I still get the issue. – HartleySan Feb 12 '14 at 20:52
  • Try with `make LDFLAGS=-lcrypt`, – TravorLZH Oct 20 '18 at 09:09

2 Answers2

0

Is there any reason you aren't using Apache that comes with Cygwin? If all you want to do is that, re-run the installer and search for Apache, it will show up. If you're feeling a bit more daring, check out this post on setting up apt-cyg:
apt-get for cygwin?
Apt is the Debian/Ubuntu package management tool and it is invoked at the CLI with apt-get. Hence, the port for Cygwin is apt-cyg.

Community
  • 1
  • 1
  • 1
    Thanks for the comment. That is a very valid point that I overlooked. I have since switched to just using a VirtualBox installation of Ubuntu for testing Apache installations on Linux, but thank you. – HartleySan Jul 01 '14 at 17:31
  • 1
    I tried apt-cyg, it does not have the apache2 package – rassa45 Jun 30 '15 at 22:33
0

I get the same error when compiling APR-Utils for httpd-2.4.16.

I think part of the reason to compile under Cygwin and not Native Win32 is that the current distribution of Visual Studio consumes 6 gigs of disk space - at least, it would, if I let that much bandwidth go through for something like that.

The apr and aprutils builds for cygwin, at the time of this writing, are not recognized by httpd when the configure script is executed.

As it stands - cygwin by itself is not suitable for installation of Apache HTTPD.

Options alternative to cygwin:

  • Cygwin community build script
  • Native Win32 build from source
  • Install Hypervisor, Install Linux Distribution, Install HTTPD
Mike Cluck
  • 31,869
  • 13
  • 80
  • 91