I successfully installed subversion on my server. When I run the command:
which svn
I get the response:
/usr/bin/svn
I create a repository inside my root directory which is my httpdocs folder with the following command:
svnadmin create ~/svn
I successfully created the following files and folders and configured them and I see the following files and directories inside the svn directory:
conf db format hooks locks README.txt
But I cannot create trunk, branch, and tag directories. In fact I cannot create directories period. Here is the command I have been using:
svn mkdir file:///httpdocs/svn/site
When I make this command the message I get is the following:
svn: Could not use external editor to fetch log message; consider setting the
$SVN_EDITOR environment variable or using the --message (-m) or --file (-F) options
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set, and no
'editor-cmd' run-time configuration option was found
Also When I type in url:
http://mydomain.com/svn
I get the follwoing message:
404 - Not Found
What do I need to do to configure my repository, check to see if my repository is actually working. Oh and I did run the following command:
svnserve -d
That's not how you get Subversion to work with Apache httpd if that's what you're trying to do. You need the mod_dav and mod_dav_svn modules for Apache. You might have to recompile Apache to get these.
Once you get mod_dav and mod_dav_svn installed, you need to configure your httpd.conf file (or put a configuration file under your httpd's
conf.d
depending how it's configured on your system) for it to work.In the end, it's not all that difficult. Most Apache installations have mod_dav and mod_dav_svn added in, and you can see if your http.conf file is configured correctly. The on line Subversion manual will have everything you need to get it working.
Read the message. It says Could not use external editor because you didn't specify one. Again the Subversion on line manual explains it in detail.
Basically, when you commit a change in Subversion, you need to create a commit message. This can be done in two ways:
-m
option likesvn commit -m "This is my commit message"
.SVN_EDITOR
,VISUAL
, orEDITOR
to the name of the program you want to use. For example, in Windows, you'd sayC:> set EDITOR=notepad.exe
. On Unix, you'd say something like$ export EDITOR=vi
. Subversion first checks the value of theSVN_EDITOR
variable, thenVISUAL
, thenEDITOR
. If none of them are set, it gives you the error you saw.Why did you get it on the
svn mkdir
command?Because you use the URL form of the command, it will make the directory, then commit the change, thus the need for a commit message. This should work:
Now, you need to move your repository out of your HTTPDOCs directory. That's a very bad thing to have because it hurts your web server.
If you don't want to use the
file://
protocol, you can usesvnserve
. This is a built-in Subversion repository server and uses thesvn://
protocol. Observe:Your repository also becomes accessible to all the machines on your network too. Using svnserve is much simpler than Apache httpd, but there are a few issues:
svnserve
since it wants to use port 3690 and it doesn't like to share. With Apache httpd, you can have multiple repositories.By the way, if you haven't, go through the Subversion on line manual. It's one of the best manuals I've seen for any open source project.
1 When you setup your repository using
svnserve
, you need to edit thesvnserve.conf
file by enabling the linepassword-db = passed
which is about line #20 in the file. Then you have to edit thepassed
file (located in the same directory) to configure the users and their passwords. Both are very straight forward, but easy to forget, and if you don't do it, you can't commit anything into your repository.