FFL2:FFL2 Main/Dev Environment/Configure Tomcat for FFL2 in Eclipse

From FFL Wiki
Jump to navigation Jump to search
  • Go to 'File | New | Other... | Server | Server' and click next
  • Choose the appropriate Tomcat version under 'Apache', enter the name as 'FFL2 Dev Tomcat Server' and click 'Next'.

  • Set the Tomcat installation directory (e.g. /opt/apache-tomcat-8.0.9) and click 'Next'
  • Add the fantacyweb project to the server and click 'Finish'

  • Open the server's context.xml file using Project Explorer

  • Click the 'Source' tab at the bottom of the editor pane and add the following data source config just before the closing </Context> tag
<Resource name="jdbc/FantacyDS"
		auth="Container"
		type="javax.sql.DataSource"
		maxActive="10"
		maxIdle="3"
		maxWait="10000"
		username="fantacist"
		password="password"
		driverClassName="com.mysql.jdbc.Driver"
		validationQuery="SELECT 1"
		url="jdbc:mysql://localhost:3306/fantacy?autoReconnect=true"/>

<Realm className="org.apache.catalina.realm.DataSourceRealm" 
		debug="99"
		localDataSource="true"
		dataSourceName="jdbc/FantacyDS"
		userTable="FantacyManager" 
		userNameCol="email" 
		userCredCol="password_hash"
		digest="SHA"
		userRoleTable="FantacyManagerRoleByEmail" 
		roleNameCol="roleName"/>

  • Save the file
  • Open the 'Servers' tab and click the 'Play' button