When Snow Leopard configures Apache and subversion to install xcode, it automatically installs the support for subversion. However, when I configure the HTTP support for subversion, I always report SVN: Options of 'HTTP: // localhost/svnrep ': 200 OK (http: // localhost) error. In desperation, You have to configure the HTTPS method. The result is OK, I really don't know what's wrong. The configuration is very simple, that is, remove the comment in/etc/apache2/httpd. conf:
Include/private/etc/apache2/extra/httpd-ssl.conf
Then generate the certificate:
Sudo OpenSSL req-New-X509-days 3650-nodes-out/etc/apache2/Apache. pem-keyout/etc/apache2/Apache. pem
Just answer the question and the certificate will be fine.
Edit httpd-ssl.conf, add the following line
Sslcertificatefile "/private/etc/apache2/Apache. pem"
Configure Apache support for subversion:
$ Sudo VI/etc/apache2/extra/httpd-subversion.conf
Java code
- Namevirtualhost*: 443
- <Virtualhost *: 443>
- Servername localmac
- Serveradmin webmaster @ localmac
- <Location/>
- Dav SVN
- Svnpath/users/user1/svnrep
- Authtype basic
- Authname "Local subversion repository"
- Authuserfile/etc/apache2/subversion. htpasswd
- Require valid-user
- </Location>
- Errorlog/var/log/apache2/error-ssl.log
- Loglevel warn
- Serversignature on
- </Virtualhost>
NameVirtualHost *:443<VirtualHost *:443> ServerName localmac ServerAdmin webmaster@localmac <Location /> DAV svn SVNPath /Users/user1/svnrep AuthType Basic AuthName "Local Subversion Repository" AuthUserFile /etc/apache2/subversion.htpasswd Require valid-user </Location> ErrorLog /var/log/apache2/error-ssl.log LogLevel warn ServerSignature On</VirtualHost>
Here I use the virtualhost method and add it to/etc/hosts.
127.0.0.1 localmac
That's simple, but it took me a day.