1
votes

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.

2
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
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
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
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
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

2 Answers

0
votes

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.

0
votes

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