RSS RSS feed | Atom Atom feed

HOWTO: Installing Subversion(1.4.3) and Apache(2.0.59) on OS X(10.4.9)

Prerequisites
  1. Xcode must be installed in order to compile subversion and apache
  2. OS X Firewall must be modified to allow port 8080 TCP traffic in the Sharing applet within System Preferences

Download the following(I have listed the versions I used in parentheses)
  1. Subversion source package and the dependency package(1.4.3) here
  2. Apache source code(2.0.59) here

Apache Steps
  1. Extract source code
    • tar xzvf httpd-2.0.59.tar.gz
  2. Set environment variable in terminal
    • export ac_cv_func_poll=no
  3. Edit apr_socket_send method in source code file srclib/apr/network_io/unix/sendrecv.c
    • Replace
    • do { rv = write(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR);
    • With
    • try_write: do { rv = write(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR);
    • Replace
    • else { do { rv = write(sock->socketdes, buf, (*len)); } while (rv == -1 && errno == EINTR); }
    • With
    • else { goto try_write; }
  4. Change directories into Apache Code
      cd httpd-2.0.59
  5. Configure build options
      ./configure --enable-mods-shared=most --enable-ssl --with-mpm=worker --without-berkeley-db
  6. Make source code
      make
  7. Install Apache to /usr/local/apache2
      sudo make install
Subversion Steps
  1. Extract source code
    • tar xzvf subversion-1.4.3.tar.gz
    • tar xzvf subversion-deps-1.4.3.tar.gz
  2. Change directories into Subversion Code
    • cd subversion-1.4.3
  3. Configure build options
    • ./configure --prefix=/usr/local \ --mandir=/usr/local/share/man --with-ssl \ --with-apxs=/usr/local/apache2/bin/apxs --with-zlib \ --enable-swig-bindings=no --without-berkeley-db \ --with-apr=/usr/local/apache2 \ --with-apr-util=/usr/local/apache2
  4. Make source code
    • make
  5. Install Subversion to /usr/local/bin
    • sudo make install
Configuration
  1. Edit httpd.conf file located at /usr/local/apache2/conf/httpd.conf
    • Replace
    • Listen 80
    • With
    • #Listen 80 Listen 8080
    • Replace
    • User nobody
    • With
    • #User nobody User www
    • Add Location block
    • <Location /svn> DAV svn SVNPath /Users/mike/svnrepo AuthType Basic AuthName "Subversion Repository" AuthUserFile /usr/local/apache2/etc/svn-auth-file Require valid-user </Location>
  2. Create directory for Apache username/passwords
    • /usr/local/apache2/etc
  3. Change directories into etc dir
    • cd /usr/local/apache2/etc
  4. Generate svn-auth-file for Apache
    • sudo htpasswd -c svn-auth-file mike
    • <enter password>
    • <confirm password>
  5. Create Subversion repository
    • svnadmin create /Users/mike/svnrepo
  6. Change user and group ownership of repository so Apache www user can modify files
    • sudo chown -R www:mike svnrepo
Start up Apache
  1. sudo /usr/local/apache2/bin/apachectl start
Browse your repository
  1. http://localhost:8080/svn
  2. Note: you will need to enter the username and password you created earlier in order to gain access