Uli's Web Site
MAS - My own MAMP-like Subversion installation
You may be familiar with MAMP. MAMP is a desktop application that contains a complete Apache server, with PHP and SQL, which you can launch by simply double-clicking one application.
Getting the packages
Since I need to configure the stuff to go in different folders, I'm downloading the sources from the public folder of wsanchez's public iDisk, not the finished installer packages. To prevent screwing up my current system, I'm also doing this on a separate partition on my external hard disk.
Once I had a fresh throw-away OS X plus Xcode tools installed (I left out stuff I wouldn't need like printer drivers, localisations etc.) I extracted the archives. This required use of the Terminal:
slab:~ ulikusterer$ tar -xvzf neon-0.26.0.tar.gzand the likes, as OS X's built-in unzipper would simply hang trying to unpack these archives. No idea why, but Activity Monitor let me kill BOMArchiveHelper and its tar processes that had accumulated.
To build libxml2, I first open its folder and read the file INSTALL. It tells me it follows the Unix standard, so I cd into its folder and type
slab:~ ulikusterer$ ./configure --helpto get a list of options. From that, I guess that I will have to use the following command to build libxml2:
slab:~ ulikusterer$ ./configure --prefix=/Applications/MASslab:~ ulikusterer$ makeslab:~ ulikusterer$ make installConfigure will now set up a lot of stuff for the build and spew a lot of messages until it displays: "Done Configuring", and then we'll get more spewage with warnings from the compiler before we have a build of the first library we need. So far, so good. On to the next one.
I try the same procedure for expat, after cding into its folder:
slab:~ ulikusterer$ ./configure --prefix=/Applications/MASslab:~ ulikusterer$ makeslab:~ ulikusterer$ make install
During building of neon later on, I found out that it was missing a header named libint.h. A quick Google showed me that this was part of Gettext, which OS X seems to not include. So, I'm installing that as well. Since Wilfredo doesn't have it on his iDisk as far as I could see, I got the sources for that from the GNU Gettext Homepage. Then I built it using
slab:~ ulikusterer$ ./configure --prefix=/Applications/MAS --enable-csharp=noslab:~ ulikusterer$ makeslab:~ ulikusterer$ make installThe C-Sharp part is necessary so we don't get errors when it can't find a copy of Mono or so on your system.
Okay, next up is Neon. Neon doesn't have an INSTALL file, but luckily follows the standard anyway. So, once I've read configure's help, I go for:
slab:~ ulikusterer$ ./configure --prefix=/Applications/MAS --with-libs=/Applications/MAS:/usrslab:~ ulikusterer$ makeslab:~ ulikusterer$ make installI also wanted to pass --with-ssl=openssl, but for some reason got an "invalid argument to binary -" error. Since SSL isn't vital, I decided to skip and try the next library first.
APR is easily built the same way, however for APR-util, we have to modify the configure call slightly:
slab:~ ulikusterer$ ./configure --prefix=/Applications/MAS --with-libs=/Applications/MAS:/usr --with-apr=/Applications/MASto tell it where it can find its copy of APR.
Building Apache 2 (httpd)
Works with the following command:
slab:~ ulikusterer$ ./configure --prefix=/Applications/MAS --with-libs=/Applications/MAS:/usr --enable-so --enable-dav-fs --enable-dav-lock --enable-dav --with-port=8800
Again, we need to add a few parameters to the configure line to make Subversion use the versions of APR and Neon we already built instead of compiling its own version of those:
slab:~ ulikusterer$ ./configure --prefix=/Applications/MAS --with-libs=/Applications/MAS:/usr --with-apr=/Applications/MAS --with-apr-util=/Applications/MAS --with-apxs=/Applications/MAS/bin/apxsHere I get a few linker warnings about libiconv.la being moved. Anybody know whether this is bad? I also get an error because I have neon 0.26.0 instead of 0.25.5, so I'm not specifying --with-neon=/Applications/MAS here to get SVN to use its own copy of Neon, I hope that doesn't cause conflicts.
I'm no security guru, so I'm going to trust the Apache guys to ship with a reasonably safe default. The file we want to edit first is /Applications/MAS/conf/httpd.conf. Apache was smart enough to set up most things the way we wanted it already, like defaulting the ServerRoot to /Applications/MAS. However, a few things still need setup:
Change the Listen 80 directive to listen to a different port, so people who want to run Mac OS X's regular Apache along with the Apache 2 we're using for Subversion, they won't fight for the same port. I'm choosing
Listen 8800like I did it for the previous Subversion installation (this may already be set due to the configure parameter above).
Change User and Group from daemon to www, to match what OS X's standard Apache uses.
Starting Apache for a short test run
To test whether everything's working so far, use the following command:
slab:~ ulikusterer$ /Applications/MAS/bin/apachectl startNow you should be able to view your server at http://127.0.0.1:8800/ or whatever port you chose. To quit the server again, use
slab:~ ulikusterer$ /Applications/MAS/bin/apachectl stopWhile I was at it, I zipped up the MAS folder, rebooted, copied it to the internal partition, and tried to run the unzipped version on the internal disk's system. It worked! Of course, like MAMP it is hard-wired to run in /Applications, but isn't that what we wanted to achieve? What doesn't work, however, is just copying over the file. Then you get an error about special permissions... hmmm... I'll have to work on that.
Setting up the Subversion Server
To get a working server, we need to create a repository, though:
slab:~ ulikusterer$ /Applications/MAS/bin/svnadmin create /Applications/MAS/repositoriesOnce that is done, we need to add some lines to the end of our httpd.conf file:
<Location /svn> DAV svn SVNPath /Applications/MAS/repositories AuthType Basic AuthName "Subversion Repository" AuthUserFile /Applications/MAS/conf/svn-auth-file Require valid-user</Location>Note that this refers to the file svn-auth-file that will hold our passwords, which we have yet to create using:
htpasswd -c /Applications/MAS/conf/svn-auth-file username(Where you'd replace username with whatever user name you want to use). This will create the file and ask you for a password to use for that account. If you want to, you can add more users using the same line (but without the -c option).
And now, we have a nice little subversion server. When we launch the server as described above and enter our subversion URL http://127.0.0.1:8800/svn/ we get asked for our password and we can access the (empty) repository.
A few minutes later, I've cobbled together a small GUI to start and stop the server, and to set up an initial password or add more users.
If you have comments, suggestions etc., feel free to leave them by using the comment form below, or visit the MAS Sourceforge project:
Created: 2006-07-15 @526 Last change: 2020-09-29 @094 | Home | Admin | Edit|
© Copyright 2003-2020 by M. Uli Kusterer, all rights reserved.