You are currently looking at an older section of the wincent.dev website.
Please check the new version of the site at https://wincent.dev/ for updated content.

wincent knowledge base

« Building Subversion 1.2 on Mac OS X 10.4.1 | Main | Upgrading to Subversion 1.2.1 on Mac OS X 10.4.2 »

May 30, 2005

Disaster recovery notes

I've had a fairly bad run lately (kernel panics, disk corruption, reinstalls). Here are some notes I made while configuring some UNIX tools — Apache 2, Subversion and the like — on the fresh install. These notes contain a lot of hard-coded paths that are specific to my installation but they may be of use to somebody out there...

# install wget
curl -O ftp://ftp.deepspace6.net/pub/ds6/sources/wget/wget-1.10-beta1.tar.bz2
tar xjf wget-1.10-beta1.tar.bz2 
cd wget-1.10-beta1/
./configure --with-ssl
make
src/wget --version
sudo make install

# install pstree wget ftp://ftp.thp.Uni-Duisburg.de/pub/source/pstree.tar.gz tar xzf pstree.tar.gz gcc -O -o pstree pstree.c ./pstree sudo install pstree /usr/local/bin/pstree
# install pwgen wget http://kent.dl.sourceforge.net/sourceforge/pwgen/pwgen-2.03.tar.gz tar xzf pwgen-2.03.tar.gz cd pwgen-2.03/ ./configure make ./pwgen -h sudo make install
# install aee wget http://www.users.qwest.net/~hmahon/sources/aee-2.2.3.tar.gz tar xzf aee-2.2.3.tar.gz cd aee-2.2.3/ make sudo make install
# install ee wget http://www.users.qwest.net/~hmahon/sources/ee-1.4.2.src.tgz tar xzf ee-1.4.2.src.tgz cd easyedit/ make sudo make install
# install Apache 2 wget http://apache.rediris.es/httpd/httpd-2.0.54.tar.bz2 tar xjf httpd-2.0.54.tar.bz2 cd httpd-2.0.54/ ./buildconf ./configure --prefix=/usr/local/apache2 --enable-dav --enable-so --enable-ssl --enable-deflate make sudo make install
# Subversion support sudo mkdir -p /usr/local/apache2/var/dav echo 'svn::200:200::0:0:Subversion:/var/empty:/usr/bin/false' |sudo niload -v passwd / echo 'svn:*:200:svn' | sudo niload -v group / sudo chown svn:svn /usr/local/apache2/var/dav
# autolaunch Apache 2 on booting sudo cp -R /System/Library/StartupItems/Apache /Library/StartupItems/Apache2 sudo mv /Library/StartupItems/Apache2/Apache /Library/StartupItems/Apache2/Apache2
# install Subversion wget http://subversion.tigris.org/downloads/subversion-1.2.0.tar.bz2 tar xjf subversion-1.2.0.tar.bz2 cd subversion-1.2.0/ sh ./autogen.sh && ./configure && make make check sudo make install

Make edits to "/usr/local/apache2/conf/httpd.conf" as indicated below:

/conf/httpd.conf
219c219
< Listen 80
---
> Listen 8080
231a232,233
> LoadModule dav_svn_module     modules/mod_dav_svn.so
> LoadModule authz_svn_module   modules/mod_authz_svn.so
267,268c269,270
< User nobody
< Group #-1
---
> User svn
> Group svn
358,359c360,361
<     Order allow,deny
<     Allow from all
---
>     Order deny,allow
>     Deny from all
1032a1035,1047
> 
> DavLockDB /usr/local/apache2/var/dav/DavLock
> 
> <Location /svnrep>
>     DAV svn
>     SVNParentPath /Users/wincent/Developer/svnrep
>     AuthType Basic
>     AuthName "Subversion repository"
>     AuthUserFile /Users/wincent/Developer/svnrep-auth
>     Require valid-user
>     Order deny,allow
>     Allow from all
> </Location>

Make edits to "/Library/StartupItems/Apache2/Apache2":

11,22c11,13
<     if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then
<         echo "Starting Apache web server"
<         if [ ! -e /etc/httpd/httpd.conf ] ; then
<                 cp -p /etc/httpd/httpd.conf.default /etc/httpd/httpd.conf
<         fi
<         apachectl start
<         if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then
<             if [ -x /usr/sbin/webperfcachectl ]; then
<                 echo "Starting web performance cache server"
<                 /usr/sbin/webperfcachectl start
<             fi
<         fi
---
>     if [ "${WEBSERVER2:=-NO-}" = "-YES-" ]; then
>         echo "Starting Apache 2 web server"
>         /usr/local/apache2/bin/apachectl start
28,33c19,20
<     if [ -x /usr/sbin/webperfcachectl ]; then
<         echo "Stopping web performance cache server"
<         /usr/sbin/webperfcachectl stop
<     fi
<     echo "Stopping Apache web server"
<     apachectl stop 
---
>     echo "Stopping Apache 2 web server"
>     /usr/local/apache2/bin/apachectl stop
38,52c25,33
<     if [ "${WEBSERVER:=-NO-}" = "-YES-" ]; then
<         echo "Restarting Apache web server"
<         apachectl restart
<         if [ "${WEBPERFCACHESERVER:=-NO-}" = "-YES-" ]; then
<             if [ -x /usr/sbin/webperfcachectl ]; then
<                 echo "Restarting web performance cache server"
<                 /usr/sbin/webperfcachectl restart
<             fi
<         fi
<     else
<         StopService
<     fi
< }
< 
< RunService "$1"
---
>     if [ "${WEBSERVER2:=-NO-}" = "-YES-" ]; then
>         echo "Restarting Apache 2 web server"
>         /usr/local/apache2/bin/apachectl restart
>     else                               
>         StopService                    
>     fi                                 
> }                                      
>                                        
> RunService "$1"

Make edits to "/etc/hostconfig":

13a14
> WEBSERVER2=-YES-

Make edits to "/Library/StartupItems/Apache2/StartupParameters.plist":

2,3c2,3
<   Description     = "Apache web server";
<   Provides        = ("Web Server");
---
>   Description     = "Apache Subversion server";
>   Provides        = ("Apache Subversion Server");

And finally fire up Apache 2. I had to reset my repository password for some reason but after doing that everything works fine.

sudo /usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/htpasswd -m ~/Developer/svnrep-auth wincent

Posted by wincent at May 30, 2005 12:14 PM