Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

sudo /etc/init.d/mongodb start

 

Install Upstart script
We have created an Ubuntu Upstart script to handle running the Medici 2.0 web app. You can use this script to manually start and stop the Medici 2.0 web app, but more importantly you can use it to automatically start and stop the application when the server starts up or shuts down.

You can find the script attached to this wiki page. Once downloaded copy this script into the /etc/init/ directory of your Ubuntu machine, and open it in your favorite text editor. For this script to work properly you must ensure that the JAVA_HOME variable points to the Java installation directory on your machine, and that the APPLICATION_PATH variable points to the base directory of the Medici app on your machine. It is recommended that you create a new user to run the application. This can be any user with permission to read/write/execute the files in your Medici directory. Change the USER variable to reflect the user that you want to run the Medici web app.

Now you will need to run these two commands 'ln -s /lib/init/upstart-job /etc/init.d/medici' and 'update-rc.d medici defaults' as root. At this point you should be able to use 'start medici' and 'stop medici,' as root, to manually start or stop the web application. Note that if you changed the name of the .conf file (e.g. foo.conf), you will need to use that name with start/stop (e.g. start foo, stop foo).

Note: You need to run the Play 'stage' command, either from the Play console or as an argument to play. This will create the production environment script used to start the Play application, which is called from our script.