It's time to get XNAT ready for initialization and configuration. To do this, you need to start the Tomcat service, which in turn loads XNAT into the application server process.
You have only a couple more steps to get XNAT up and running:
- Create the base XNAT configuration file
- Start Tomcat
Create the base XNAT configuration file
When you set the value for xnat.home in the Tomcat configuration file, you told XNAT where to go to find its basic system configuration. Most of the configuration for XNAT 1.7 is stored in the database, but the configuration for accessing the database can't be stored in the database. For this, XNAT looks in the xnat.home folder for the subfolder config and the file xnat-conf.properties. We will create this file now.
Copy and paste this text into the editor:
The values set in here for datasource.url, datasource.username, and datasource.password should work in your current virtual machine because the database is named
xnat, the database user is named
xnat, etc. If you've changed any of these values, you'll need to modify the contents of this configuration appropriately as well.
You can download a version of this file directly to your config folder:
The last step here will display the properties file so that you can verify the proper contents were retrieved.
When adding the configuration file, the full absolute path to the file should be:
Starting Tomcat really means starting XNAT for the first time. Before doing so, you should make sure that you've copied the XNAT war file to /var/lib/tomcat7/webapps/ROOT.war and that there is no folder named /var/lib/tomcat7/webapps/ROOT (Tomcat will use the folder instead of the war file). If that's all good, you can start the service:
The last command here uses the tail command to monitor the Tomcat start-up log. This is a good way to determine when XNAT has finished initializing and is ready to accept requests: once you see that message INFO: Server startup in ... ms, you'll know that you can go to the application in your browser.
If anything goes wrong during these steps, there are a couple places you can look for more information:
- The XNAT logs are located in the logs folder under your user's home folder. These can help with errors inside of XNAT.
- The Tomcat logs are located in the folder /var/log/tomcat7. These can help with start-up and configuration errors.
- The nginx logs are located in the folder /var/log/nginx. These can help if there are issues with the proxy connection between nginx and Tomcat.
- If you've installed or worked with XNAT before, you'll notice that there are no steps to configure and populate the initial XNAT database. These steps are actually performed by XNAT itself on the fly as it starts up for the first time.
- If you happen to run: ls /var/lib/tomcat7/webapps after the Tomcat restart, you will see that a ROOT directory does exist now. Don't panic. Tomcat expands the war file when it starts up.
Tomcat has successfully started and the XNAT service has completed its initialization. Your XNAT server is ready to start working.
- No labels