{"id":168,"date":"2006-03-07T12:13:54","date_gmt":"2006-03-07T17:13:54","guid":{"rendered":"http:\/\/blog.elharo.com\/blog\/?p=168"},"modified":"2008-05-28T15:33:50","modified_gmt":"2008-05-28T20:33:50","slug":"converting-a-mini-to-a-server-part-2-installing-apache","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/mac\/2006\/03\/07\/converting-a-mini-to-a-server-part-2-installing-apache\/","title":{"rendered":"Converting a Mini to a Server, Part 2: Installing Apache"},"content":{"rendered":"<p> To summarize <a href=\"\/blog\/mac\/2006\/03\/07\/converting-the-mini-to-a-server-preliminaries\/\">what has gone before<\/a>, 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:<\/p>\n<div><samp>&#8211;prefix=\/usr\/httpd &#8211;enable-auth-anon &#8211;enable-auth-digest &#8211;enable-auth-dbm &#8211;enable-deflate &#8211;enable-expires &#8211;enable-headers &#8211;enable-mime-magic &#8211;enable-rewrite &#8211;enable-speling &#8211;enable-ssl &#8211;enable-unique-id &#8211;enable-usertrack &#8211;enable-vhost-alias &#8211;enable-include &#8211;enable-so<\/samp><\/div>\n<p>Now let&#8217;s configure:<br \/>\n<!--more--><\/p>\n<p><samp>$ ~\/httpd-2.0.55$ .\/configure &#8211;prefix=\/usr\/httpd &#8211;enable-auth-anon &#8211;enable-auth-digest &#8211;enable-auth-dbm &#8211;enable-deflate &#8211;enable-expires &#8211;enable-headers &#8211;enable-mime-magic &#8211;enable-rewrite &#8211;enable-speling &#8211;enable-ssl &#8211;enable-unique-id &#8211;enable-usertrack &#8211;enable-vhost-alias &#8211;enable-include &#8211;enable-so<br \/>\nchecking for chosen layout&#8230; Apache<br \/>\nchecking for working mkdir -p&#8230; yes<br \/>\nchecking build system type&#8230; i386-apple-darwin8.5.3<br \/>\nchecking host system type&#8230; i386-apple-darwin8.5.3<br \/>\nchecking target system type&#8230; i386-apple-darwin8.5.3<\/samp><\/p>\n<p><samp>Configuring Apache Portable Runtime library &#8230;<\/samp><\/p>\n<p><samp>checking for APR&#8230; reconfig<br \/>\nconfiguring package in srclib\/apr now<br \/>\nchecking build system type&#8230; i386-apple-darwin8.5.3<br \/>\n&#8230;<br \/>\nconfig.status: creating include\/ap_config_auto.h<br \/>\nconfig.status: executing default commands<\/samp><\/p>\n<p>OK. That seems to have worked. Now let&#8217;s make it.<\/p>\n<p><samp>$ ~\/httpd-2.0.55$ make<br \/>\nMaking all in srclib<br \/>\nMaking all in apr<br \/>\nMaking all in strings<br \/>\n\/bin\/sh \/Users\/elharo\/httpd-2.0.55\/srclib\/apr\/libtool &#8211;silent &#8211;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 &amp;&amp; touch apr_cpystrn.lo<br \/>\n&#8230;<br \/>\n\/usr\/bin\/ld: warning multiple definitions of symbol _regfree<br \/>\n\/Users\/elharo\/httpd-2.0.55\/srclib\/pcre\/.libs\/libpcre.a(pcreposix.o) definition of _regfree in section (__TEXT,__text)<br \/>\n\/usr\/lib\/gcc\/i686-apple-darwin8\/4.0.1\/..\/..\/..\/libpthread.dylib(regfree.So) definition of _regfree<br \/>\n<\/samp><\/p>\n<p>Interestingly although this sort of big compile always spins up the fans on my dual G5, I still can&#8217;t hear a whisper out of the Mini.<\/p>\n<p>Now let&#8217;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&#8217;t so this shouldn&#8217;t overwrite anything. Here we go:<\/p>\n<pre><samp>$sudo make install\r\n~\/httpd-2.0.55$ sudo make install\r\n\r\nWe trust you have received the usual lecture from the local System\r\nAdministrator. It usually boils down to these three things:\r\n\r\n    #1) Respect the privacy of others.\r\n    #2) Think before you type.\r\n    #3) With great power comes great responsibility.\r\n\r\nPassword:\r\nMaking install in srclib\r\nMaking install in apr\r\nsed 's,^(location=).*$,1installed,' < apr-config > apr-config.out\r\nMaking all in strings\r\n...\r\nmkdir \/usr\/httpd\/man\/man8\r\nmkdir \/usr\/httpd\/manual\r\nInstalling build system files\r\n<\/samp><\/pre>\n<p>Ok. Appears to have installed. Now let&#8217;s see if it&#8217;s on. Nope. OK. Let&#8217;s turn it on:<\/p>\n<pre><samp>$ sudo \/usr\/httpd\/bin\/apachectl start\r\nPassword:\r\n<\/samp><\/pre>\n<p>Hmm, I can&#8217;t connect. I wonder why? <tt>ps<\/tt> shows it running:<\/p>\n<div><samp>~\/httpd-2.0.55$ ps -aux|grep http<br \/>\nroot     26982   0.0  0.2    30976   1932  ??  Ss    8:14AM   0:00.45 \/usr\/httpd\/bin\/httpd -k start<br \/>\nnobody   26983   0.0  0.1    30976    976  ??  S     8:15AM   0:00.00 \/usr\/httpd\/bin\/httpd -k start<br \/>\nnobody   26984   0.0  0.1    30976    976  ??  S     8:15AM   0:00.00 \/usr\/httpd\/bin\/httpd -k start<br \/>\nnobody   26985   0.0  0.1    30976    976  ??  S     8:15AM   0:00.00 \/usr\/httpd\/bin\/httpd -k start<br \/>\nnobody   26986   0.0  0.1    30976    976  ??  S     8:15AM   0:00.00 \/usr\/httpd\/bin\/httpd -k start<br \/>\nnobody   26987   0.0  0.1    30976    976  ??  S     8:15AM   0:00.00 \/usr\/httpd\/bin\/httpd -k start<br \/>\nelharo   26991   0.0  0.0    27708      0  p2  R+    8:16AM   0:00.00 grep http<br \/>\n<\/samp><\/div>\n<p>Oh wait. I know. I forgot to open up port 80 in the firewall. Let&#8217;s do that. Hmm, VNC can&#8217;t connect. I&#8217;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.<\/p>\n<p>This is becoming tiresome. Perhaps I should snag the <abbr title=\"Display Keyboard Mouse\">DKM<\/abbr> from my Windows\/Ubuntu dual boot box instead, at least for the time being. <\/p>\n<p>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&#8217;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&#8217;m going to have figure out how to fix that. <\/p>\n<p>Meanwhile, as long as we&#8217;re up and running let&#8217;s grab all the files from the current server. The Cafes and elharo.com won&#8217;t run yet because they require MySQL and PHP, but I should be able to bring up www.xom.nu on the new system since that&#8217;s pure HTML. Instead of just copying the httpd.conf file, from the old server I edited manaully to make sure there weren&#8217;t any other issues. The old one referred to some modules and files and virtual hosts I haven&#8217;t installed yet. After doing that, a quick <samp>sudo \/usr\/httpd\/bin\/apachectl restart<\/samp>  and the server&#8217;s up and running. <\/p>\n<p>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&#8217;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&#8217;s 216.254.67.101. Now let&#8217;s login to the router and map that IP to the Mini&#8217;s internal address. <\/p>\n<p>Hmm, there doesn&#8217;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&#8217;s web site, it looks like this model doesn&#8217;t support more than one external IP address (though they don&#8217;t come out and say that.) Bummer. I&#8217;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?<\/p>\n<p>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.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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: &#8211;prefix=\/usr\/httpd &#8211;enable-auth-anon &#8211;enable-auth-digest &#8211;enable-auth-dbm &#8211;enable-deflate &#8211;enable-expires &#8211;enable-headers &#8211;enable-mime-magic &#8211;enable-rewrite &#8211;enable-speling &#8211;enable-ssl &#8211;enable-unique-id &#8211;enable-usertrack &#8211;enable-vhost-alias &#8211;enable-include &#8211;enable-so Now let&#8217;s configure:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[410],"class_list":["post-168","post","type-post","status-publish","format-standard","hentry","category-mac","tag-flash"],"_links":{"self":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/168","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/comments?post=168"}],"version-history":[{"count":0,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/168\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}