-
Notifications
You must be signed in to change notification settings - Fork 2
Installation Guide
The following steps will help you installing the cassandra platform on your system:
- Install MongoDB on your system. Perhaps the Developers-quickstart-guide could be of help.
- Install Tomcat on your system (The platform was developed using Tomcat 7).
- Make sure that you start Tomcat using Java 7. A solution to accomplish this create a
setenv.sh
file inCATALINA_HOME
addingJRE_HOME=/path/to/your/java7/installation
. Then make it executablechmod 755 setenv.sh
. Check-out http://localhost:8080 to test if Tomcat is working.
- Secure Tomcat (see next section in the current page)
- Download the Cassandra platform bundle (Add link)
- Configure the environment variables in the application's web.xml
mongo.host.address
andmongo.db
and set them to the MongoDB host address and the MongoDB database name to use. - Build the platform using
ant
. The CASSANDRA Ant page describes the specifics of the build process. - Optionally one can download a demo MongoDB database for quick-startup and demo purposes and restore it using
mongorestore
. - Start the Tomcat server. (
./startup.sh
) - Drop the
cassandra.war
file, found in the createddist
directory of the built Cassandra platfrom bundle after usingant
, in the webapps directory of the tomcat installation. The war archive will self-extract and create the webapp directory. - Go to https://localhost:8443/cassandra and enjoy!
- To shutdown Tomcat:
./shutdown.sh
In this section we will secure Tomcat to listen only via https on port 8443:
-
Create a key:
keytool -genkey -keyalg RSA -alias host -keystore keystore.jks -validity 999 -keysize 2048
-
Add the following connector to Tomcat server.xml configuration file:
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" keystoreFile="path/to/keystore.jks" keystorePass="changeit"/>
-
Make sure port 8080 redirect to 8443 (server.xml again):
<Connector connectionTimeout="20000" port="8080" protocol="HTTP/1.1" redirectPort="8443"/>
-
Add the following xml snippet into Tomcat's web.xml configuration file:
<!-- SSL settings. only allow HTTPS access to tomcat --> <security-constraint> <web-resource-collection> <web-resource-name>Entire Application</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
The procedure for adding users is as follows: Insert a user document in the database through the console interface of MongoDB or any other UI MongoDB client (for example rockmongo):
-
{ “username”: “demo”}
-
This document will have an ObjecID (for example “123”)
-
Run the tool md5hashgen.jar located under the folder tools
java –jar md5hashgen.jar secret 123
where secret is the chosen password and 123 the ObjectID
- The tool will output a password in the console (for example “a1s2d3f4”)
- Update the document in the MongoDB: { “username”: “demo”, “password”: “a1s2d3f4” }
Now the user can login with credentials demo and secret.