How can I set up the Subversion Apache server to start automatically on reboot?

To set up the server so that it starts automatically when rebooted, you will need to have root/sudo access and follow these steps.

  1. Edit the configuration. When a process is started at server startup it runs as root. You do not want the CSVN console to run as root, you want it to run as a specific user -- whatever your login user is.
    1. To do this, edit the file data/conf/csvn.conf.
      • $ vi data/conf/csvn.conf
    2. Scroll down a little bit until you see #RUN_AS_USER= . Uncomment it out and add your username.

      Example:

      RUN_AS_USER=user1
    3. Save the changes.
  2. Install the application.
    • $ export JAVA_HOME
    • $ sudo -E bin/csvn install

    This installs the application so that it will run at startup. The script will swap to the user specified before it starts the console. Please note the JAVA_HOME requirement - you must have set the environment variable for your profile (or the entire system) so that it will be visible when the process starts.

    When you install csvn as a service, you can control it with these commands:
    • $ sudo service csvn status
    • $ sudo service csvn start
    • $ sudo service csvn stop