{"id":181,"date":"2006-03-19T08:20:12","date_gmt":"2006-03-19T13:20:12","guid":{"rendered":"http:\/\/blog.elharo.com\/blog\/?p=181"},"modified":"2008-05-28T15:30:32","modified_gmt":"2008-05-28T20:30:32","slug":"converting-a-mini-to-a-server-part-4-launching-servers-at-startup","status":"publish","type":"post","link":"https:\/\/www.elharo.com\/blog\/mac\/2006\/03\/19\/converting-a-mini-to-a-server-part-4-launching-servers-at-startup\/","title":{"rendered":"Converting a Mini to a Server, Part 4: Launching Servers at Startup"},"content":{"rendered":"<p>I&#8217;ve now returned from Software Development 2006 and am ready to continue moving this server to my <a href=\"\/blog\/mac\/2006\/03\/06\/intel-mini-arrives\/\">new Mac Mini<\/a>. I had left it turned off while I was away. I turned it on, and loaded the first site into my browser; or rather I tried to load the first site. I couldn&#8217;t connect. Hmm, did I forget the IP address? Nope, I forgot to setup Apache to automatically launch at system startup. Let&#8217;s fix that.<br \/>\n<!--more--><\/p>\n<p>This is a little tricky because I want to do this without having any particular user logged in so I can&#8217;t just use System Preferences\/Accounts\/Login Items. However, <a href=\"http:\/\/www.developer.com\/tech\/article.php\/985561\">this Tomcat article<\/a> shows me what I need to do. I need to create the file \/System\/Library\/StartupItems\/Apache2 and in it I put these commands:<\/p>\n<pre><code>#!\/bin\/sh\r\n\r\n##\r\n# Apache HTTP Server\r\n##\r\n\r\n. \/etc\/rc.common\r\n\r\nStartService ()\r\n{\r\n        echo \"Starting Apache web server\"\r\n        \/usr\/httpd\/bin\/apachectl start\r\n}\r\n\r\nStopService ()\r\n{\r\n    echo \"Stopping Apache web server\"\r\n    \/usr\/httpd\/bin\/apachectl stop \r\n}\r\n\r\nRestartService ()\r\n{\r\n        echo \"Restarting Apache web server\"\r\n        \/usr\/httpd\/bin\/apachectl restart\r\n}\r\n\r\nRunService \"$1\"<\/code><\/pre>\n<p>OK. That&#8217;s done. Let&#8217;s restart the Mini and see if it works. Nope. It doesn&#8217;t. Is there an error message in the console? No, that would be too easy. OK, Suppose I try to start the server manually. What happens then? That does seem to work.<\/p>\n<p>Ah, looks Like I forgot a file. I also need to create \/System\/Library\/StartupItems\/Apache2\/StartupParameters.plist and in it I put this text:<\/p>\n<pre><code>{\r\n  Description     = \"Apache web server\";\r\n  Provides        = (\"Web Server\");\r\n  Uses            = (\"Disks\", \"NFS\");\r\n}<\/code><\/pre>\n<p>Bingo! It&#8217;s working. Next step. Installing WordPress.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve now returned from Software Development 2006 and am ready to continue moving this server to my new Mac Mini. I had left it turned off while I was away. I turned it on, and loaded the first site into my browser; or rather I tried to load the first site. I couldn&#8217;t connect. Hmm, [&hellip;]<\/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-181","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\/181","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=181"}],"version-history":[{"count":0,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.elharo.com\/blog\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}