Source Control Woes and Resolutions

So a follow up to my Source Control woes from the past post.

First off, Mountain Lion has changed some of Apache's previous configuration settings--which would explain why it seemed like my changes only sometimes worked. So the lesson here, is if you're using Mountain Lion Server, Apache is configured to use the following location for your .conf files:
Notably, there's the standard httpd.conf, as well as website specific configs in the sites folder. This is also stark contrast from my previous Lion-upgraded-from-Snow-Leopard folder of...
Now that that's out of the way, configuration is relatively straight forward. Or is it? Well, it turns out, Subversion (and the Subversion server) are not installed (and actually Uninstalled with the upgrade) with Mountain Lion. So... once I figured out how to get Apache to accept my changes, I then I had figure out how the hell to reinstall Subversion. I hate having the grab some source and/or tar.gz files and run a few make commands--nor do I really want to install macports, homebrew, or fink. It turns out, there's a relatively simple way to reinstall the files you need!

  1. Open XCode
  2. Click XCode (menu) -> Preference
  3. Click on the Downloads Tab
  4. Install Command Line Tools
And viola--115 meg download later, and Subversion is reinstalled on your Mac. And turns out, so are the apache .so files. Well. One of the two. It turns out that auth_svn_module isn't installed. I won't lie. I don't really know what this does. Nor do I really care for tonight. Turns out, I can browse my file structure without it so, hurray! (I haven't tried writing yet.)

So for those naysayers out there who are sick of me not posting my code... at the bottom of my httpd.conf file, I've tucked this in...
LoadModule dav_svn_module /usr/libexec/apache2/mod_dav_svn.conf

  DAV svn
  SVNPath /Path/To/Subversion/Repo1
You may need to chmod and/or chown if necessary. You know the drill. Now, on to the fun stuff.

So, now that I'm successfully sick of apache, vi, httpd.conf, and for that matter--all .conf files, I figure I'm going to try to do as much as I can in OS X's Server.app...

So, I grab the latest version of Mercurial (HG) and install it. After some tutorials later, I determined using Terminal to create repos was great and all-but better yet, let's set up a Mercurial server in Apache...

So within Server.app, I create my Mercurial Website by doing this...
  1. Navigate to Websites...
  2. Click the plus button
  3. Fill in my domain name... in fact... let's use a Subdomain! source.example.com
  4. Any IP Address. Port 80... Actually...
  5. Let's use an Cert (and the port automagically changes to 443...)
  6. Store files in... wherever. I'm going to manually alias something...
  7. Who can Access... Oooh... I get to choose Open Directory groups... (this is much nicer than vi...)
  8. And. Done.
Now that I've successfully created a website... I can try hitting https://source.example.com, and viola! It prompts me for a UID and PW. Way to go Apple... I'm relatively impressed with the mostly unimpressive Server.app...

So, digging deep into my HDD (hey... I haven't yet upgraded this to an SSD...), I find myself navigating to the depths of the underworld of .conf files here...
And low and behold, I find this beautiful file there named...
And I decide to add...
WSGIScriptAlias / /var/hg/hgweb.wsgi
And of course the text of that file looks something like this...
config = "/var/hg/hgweb.conf"
import cgitb; cgitb.enable()
from mercurial import demandimport; demandimport.enable()
from mercurial.hgweb import hgweb
application = hgweb(config)
Of course, you'll actually want to download that text from somewhere with better documentation than me. So DON'T RELY ON ME FOR THAT TO BE ACCURATE... At least at 1AM on an incoherent Saturday night... (no, really, though, go here for details http://mercurial.selenic.com/wiki/HgWebDirStepByStep#Configuring_Apache_with_mod_wsgi)

And another thing not to rely on me for is your hgweb.conf file. Which looks something like this...
/repo1 = /var/hg/repos/repo1
baseurl = /
But again, it's 1am, and I'm incoherent at this point... (No really, go here... http://mercurial.selenic.com/wiki/HgWebDirStepByStep#Preparing_the_config)

And restart your web server. Oh. And whatever you do, do not use the following command...
sudo apachectl restart
Apparently that's bunk for OS X Server there days. Who knew? Try this instead:
sudo serveradmin web stop
sudo serveradmin web start
sudo serveradmin settings web
Sorry. Stop and Start. Restart may work. Settings is interesting. Seriously, though, read up. http://www.justinrummel.com/10-8-mountain-lion-server-what-changed/. Stuff's changed that I didn't know about. In fact, that would explain why my tinkering with Apache up until now felt like my changes weren't making it--they weren't.

And I'm incredibly tired. But I needed to document some of these ravings-of-a-lunatic before I crash and forget them all.

Zoidberg away!

No comments: