Deploying Admin
- After checking out admin, set $ADMIN_HOME the root directory where the build.xml is located.
- Set $TOMCAT_HOME to the location of tomcat. On Linux, that's usually /usr/share/tomcat. It should contain directories(or symlinks to directories) like webapps, logs, and conf.
- $JAVA_HOME should be configured to point to JDK directory.
- $ANT_HOME should point to the ant executable, if not in $PATH.
- Copy the spring.properties template to it's permanent location. cp $ADMIN_HOME/WEB-INF/src/spring.properties.tpl $ADMIN_HOME/WEB-INF/src/spring.properties
- Update spring.properties configuration to fit your environment.
- Generate the tomcat keystore with 'montana' as the password(for local dev): $JAVA_HOME/bin/keytool -genkey -alias admin.votesmart.org -keyalg RSA -keystore $TOMCAT_HOME/conf/pvskeystore
- Update $TOMCAT_HOME/conf/server.xml with the information in the section server.xml
- Get the libraries in WEB-INF/lib that aren't in the repos from another system.
- Change directory to $ADMIN_HOME, type ant and return. This will compile and deploy the project for the first time.
- Start the Tomcat server
- The server should be started without any error message, open up browser and type 'http://localhost:8080/admin' a login page should be displayed, type 'guest' as username 'guest' as password, you should be logged in.
At this point, development environment has been setup correctly.
Use 'ant test' for running JUnit tests.
Use 'ant jr' to build jasper reports.
'ant clean', 'ant deploy', 'ant jsp', etc. Look at build.xml
server.xml
Make sure you have an SSL Connector setup with the keystore we have setup. For a development environment, you may want to lower the thread counts to save resources.
<Connector
port="8443" minSpareThreads="5" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="relative/path/to/keystore" keystorePass="[password]"
/>
port="8443" minSpareThreads="5" maxSpareThreads="75"
enableLookups="true" disableUploadTimeout="true"
acceptCount="100" maxThreads="200"
scheme="https" secure="true" SSLEnabled="true"
keystoreFile="relative/path/to/keystore" keystorePass="[password]"
/>
We also need a JDBCRealm setup. It should look like the following, updated with your connection information:
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.postgresql.Driver"
connectionURL="jdbc:postgresql://[servername]/pvsadmin"
connectionName="[username]"
connectionPassword="[password]"
digest="MD5" userTable="public.user" userNameCol="user_id" userCredCol="password"
userRoleTable="user_role" roleNameCol="role_id"/>
driverName="org.postgresql.Driver"
connectionURL="jdbc:postgresql://[servername]/pvsadmin"
connectionName="[username]"
connectionPassword="[password]"
digest="MD5" userTable="public.user" userNameCol="user_id" userCredCol="password"
userRoleTable="user_role" roleNameCol="role_id"/>
CategoryITDocs