Converting a Mini to a Server, Part 2: Installing Apache

To summarize what has gone before, I now have headless, network access to the mini, gcc installed, and have found my preferred set of Apache config options. For future reference they are:

–prefix=/usr/httpd –enable-auth-anon –enable-auth-digest –enable-auth-dbm –enable-deflate –enable-expires –enable-headers –enable-mime-magic –enable-rewrite –enable-speling –enable-ssl –enable-unique-id –enable-usertrack –enable-vhost-alias –enable-include –enable-so

Now let’s configure:

$ ~/httpd-2.0.55$ ./configure –prefix=/usr/httpd –enable-auth-anon –enable-auth-digest –enable-auth-dbm –enable-deflate –enable-expires –enable-headers –enable-mime-magic –enable-rewrite –enable-speling –enable-ssl –enable-unique-id –enable-usertrack –enable-vhost-alias –enable-include –enable-so
checking for chosen layout… Apache
checking for working mkdir -p… yes
checking build system type… i386-apple-darwin8.5.3
checking host system type… i386-apple-darwin8.5.3
checking target system type… i386-apple-darwin8.5.3

Configuring Apache Portable Runtime library …

checking for APR… reconfig
configuring package in srclib/apr now
checking build system type… i386-apple-darwin8.5.3

config.status: creating include/ap_config_auto.h
config.status: executing default commands

OK. That seems to have worked. Now let’s make it.

$ ~/httpd-2.0.55$ make
Making all in srclib
Making all in apr
Making all in strings
/bin/sh /Users/elharo/httpd-2.0.55/srclib/apr/libtool –silent –mode=compile gcc -g -O2 -DHAVE_CONFIG_H -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I../include -I../include/arch/unix -c apr_cpystrn.c && touch apr_cpystrn.lo

/usr/bin/ld: warning multiple definitions of symbol _regfree
/Users/elharo/httpd-2.0.55/srclib/pcre/.libs/libpcre.a(pcreposix.o) definition of _regfree in section (__TEXT,__text)
/usr/lib/gcc/i686-apple-darwin8/4.0.1/../../../libpthread.dylib(regfree.So) definition of _regfree

Interestingly although this sort of big compile always spins up the fans on my dual G5, I still can’t hear a whisper out of the Mini.

Now let’s try to install the thing. First I checked to see if the built-in web server lives in /usr/httpd. It seems it doesn’t so this shouldn’t overwrite anything. Here we go:

$sudo make install
~/httpd-2.0.55$ sudo make install

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Making install in srclib
Making install in apr
sed 's,^(location=).*$,1installed,' < apr-config > apr-config.out
Making all in strings
mkdir /usr/httpd/man/man8
mkdir /usr/httpd/manual
Installing build system files

Ok. Appears to have installed. Now let’s see if it’s on. Nope. OK. Let’s turn it on:

$ sudo /usr/httpd/bin/apachectl start

Hmm, I can’t connect. I wonder why? ps shows it running:

~/httpd-2.0.55$ ps -aux|grep http
root 26982 0.0 0.2 30976 1932 ?? Ss 8:14AM 0:00.45 /usr/httpd/bin/httpd -k start
nobody 26983 0.0 0.1 30976 976 ?? S 8:15AM 0:00.00 /usr/httpd/bin/httpd -k start
nobody 26984 0.0 0.1 30976 976 ?? S 8:15AM 0:00.00 /usr/httpd/bin/httpd -k start
nobody 26985 0.0 0.1 30976 976 ?? S 8:15AM 0:00.00 /usr/httpd/bin/httpd -k start
nobody 26986 0.0 0.1 30976 976 ?? S 8:15AM 0:00.00 /usr/httpd/bin/httpd -k start
nobody 26987 0.0 0.1 30976 976 ?? S 8:15AM 0:00.00 /usr/httpd/bin/httpd -k start
elharo 26991 0.0 0.0 27708 0 p2 R+ 8:16AM 0:00.00 grep http

Oh wait. I know. I forgot to open up port 80 in the firewall. Let’s do that. Hmm, VNC can’t connect. I’m going to have to disconnect the monitor and keyboard from this system and plug them into the Mini again. I knew I should have bought that KVM. Thank Steve for hot plugging. I remember the bad old days when I worked at a computer rental joint; and we were terrified someone was going to plug or unplug an ADB device without first shutting down the system, thereby frying the motherboard.

This is becoming tiresome. Perhaps I should snag the DKM from my Windows/Ubuntu dual boot box instead, at least for the time being.

OK. After various swapping of DKM cables, the mini is now up and running, and displaying the usual Apache login screen. While I was at it, I moved it across the room and hooked it up to the wired network. VNC seems to be operating. However, sshd still has the problem that it doesn’t launch at system startup. Instead I have to login with VNC and turn it off and on again before I can ssh and scp. Sooner or later I’m going to have figure out how to fix that.

Meanwhile, as long as we’re up and running let’s grab all the files from the current server. The Cafes and won’t run yet because they require MySQL and PHP, but I should be able to bring up on the new system since that’s pure HTML. Instead of just copying the httpd.conf file, from the old server I edited manaully to make sure there weren’t any other issues. The old one referred to some modules and files and virtual hosts I haven’t installed yet. After doing that, a quick sudo /usr/httpd/bin/apachectl restart and the server’s up and running.

Next step is to log into the router and set up a route to the Mini, then change DNS to point to the new address. Hmm, wait a minute. Do I ahve more than one external DNS address any more? I used to but I may have lost those when I switched to ADSL from SDSL. Let’s login to Speakeasy and check. Hmm, looks like I have one extra inactive IP I can activate. That should be enough for now. For the record, it’s Now let’s login to the router and map that IP to the Mini’s internal address.

Hmm, there doesn’t seem to be an easy way to map a second IP address. This could get tricky. (This is a D-Link DI-624c router by the way.) Hunting through D-Link’s web site, it looks like this model doesn’t support more than one external IP address (though they don’t come out and say that.) Bummer. I’m going to have to get all the sites copied over before I flip the switch. Longer term, I may need to look for a more capable NAT/router/firewall. Any suggestions?

However, the basic server does seem to be operating. The next step will be to get MySQL and PHP installed on the Mini, and then copy over the WordPress databases. More on that tomorrow.

2 Responses to “Converting a Mini to a Server, Part 2: Installing Apache”

  1. Mokka mit Schlag » Converting a Mini to a Server, Part 3: MySQL and PHP Says:

    […] Mokka mit Schlag « Converting a Mini to a Server, Part 2: Installing Apache […]

  2. Mokka mit Schlag » Looking for a Router Says:

    […] This site is currently served by an ADSL line in my apartment as are several others I maintain. I recently noticed that my NAT/router/firewall device (a D-Link Airplus extreme-G Router) can’t map multiple IPs. That is, it forwards all port 80 requests to the same system. It can’t send requests for different external IP addresses to different internal IP addresses. This means I can only run one physical HTTP server. […]

Leave a Reply