Agilefant instance creation guide to non spesific directory
Create new project
Check out new project from SVN to use as the basis of the installation.
You can either use Subclipse or SVN shell program.
We suggest you use the latest Agilefant.org release from tags directory.
Edit database connection
Database connection settings can be found in conf/database-mysql5.properties.
Change database name as desired:
hibernate.connection.url=jdbc:mysql:
Deploy web application
Stop Tomcat before deploying the application:
- Edit build.properties in the project root directory.
- Change propery deploy.dir.local to point to the directory you want to create the new Agilefant installation. E.g. deploy.dir.local = /home/myfant.
- Edit database-mysql5.properties file and change hibernate.connection.url to match you database name (e.g. jdb:mysql://localhost/mydatabase).
- Make sure that you have execution and write rights to the deployh.dir.local directory.
- Run deploy-local ANT task.
You should now have a directory containing all agilefant-files.
Create database
Edit the init-db.sql script in doc/sql directory. Change at least the database name and make note of it.
DROP DATABASE IF EXISTS mydatabase;
CREATE DATABASE mydatabase;
GRANT ALL ON mydatabase.* TO agilefant IDENTIFIED BY 'agilefant';
USE mydatabase;
Grant privileges to user 'agilefant':
sudo mysql -u root -e-p "grant all privileges on mydatabase.* to 'agilefant'@'localhost' identified by 'agilefant'"
Login to MySQL using command line tool:
sudo mysql -u root -p
and create database:
\. init-db.sql
\. create-db.sql
\. insert-users.sql
These scripts are found in doc/sql directory.
The username and password of initial user can be found insert-users.sql. Remember to change your password during first login to Agilefant!
Change deploy dir ownership to tomcat5
sudo chown -R tomcat5:tomcat5 /home/myfant
You might want to add yourself to the tomcat5 group and give write rights to deploy dir.
Configure Tomcat
Create myfant.xml -file to /opt/tomcat/conf/Catalina/localhost:
sudo nano /opt/tomcat/conf/Catalina/localhost
Add following lines:
<Context path="/myfant" docBase="/home/myfant" debug="0" reloadable="false">
</Context>
Start Tomcat:
Configure Apache
Create myfant.conf file to /etc/apache2/services/available directory:
sudo nano /etc/apache2/services/available/myfant.conf
Add following lines to the file:
<Location /myfant>
ProxyPass http: ProxyPassReverse http: Order Allow,Deny
Allow from all
</Location>
Create symbolic link to the config file:
sudo ln -s /etc/apache2/services/available/myfant.conf /etc/apache2/services/http/myfant.conf
If all goes well, you should be able to access AgilEFant using context
path agilefant (http://<yourServer>/myfant. AgilEFant writes a log
to logs/agilefant.log under Tomcat home so you might want to check it
in case you encounter any problems. Also logs/catalina.out can be useful.
Tomcat
Selecting Java version
The Java version Tomcat is using is configured from the initialization script usually located in /etc/init.d/. Stop Tomcat using the initialization script before before editing the initialization.
JAVA_HOME variable in the initialization script should point to your chosen Java version. Java runtime environment installations are susually located in /usr/lib/jvm/.
JAVA_HOME=/usr/lib/jvm/java-6-sun
After changing the path you can restart Tomcat.
Fixing UTF-8 encoding
If UTF-8 encoding doesn't seem to work, make sure that your server.xml file doesn't have property useBodyEncodingFormURI="true". server.xml is usually located in tomcat/conf directory.
<Connector port="8380" useBodyEncodingFormURI="true" /> <!-- WRONG -->
should be
<Connector port="8380" /> <!-- CORRECT -->