Project

General

Profile

AMI Eclipse Quick Start Guide » History » Version 12

Amber Herold, 01/22/2010 06:09 PM

1 1 Amber Herold
h1. AMI Eclipse Quick Start Guide
2
3 5 Amber Herold
{{>toc}}
4 1 Amber Herold
5
h2. 1. Get the Eclipse executable
6
7
# AMI has a preconfigured version available at [  ...  ]
8
# Copy it to ...
9
# Double click the eclipse executable to open. If using a machine that was setup with the AMI kickstart program, you will need to update [...]
10
11
h2. 2. Create a Workspace and get the MyAMI code from Subversion
12
13
# Double click the eclipse executable found in the eclipse directory.
14 2 Amber Herold
# When it opens, it will prompt you to choose a workspace. This workspace will hold a local copy of the myami code for you to work on. A good workspace location is a amiworkspace in your home directory. That is /home/username/amiworkspace.
15 3 Amber Herold
# From the menu, select Window -> Open Perspective -> SVN Repository Exploring. This will open a view labeled SVN Repositories.
16
# Go to File -> New -> Repository Location.
17
# In the URL field type: http://emg.nysbc.org/svn/myami to get the Appion and Leginon code.
18 1 Amber Herold
# Press the Finish button at the bottom of the dialog. A new repository will appear in the SVN Repositories view.
19
# Click on the arrow next to the repository icon to view the trunk, branches and tags associated with the repository.
20
# Click on the trunk to highlight it. Right click and select Checkout. This will get the code from the repo and put it in your workspace. When the operation completes, you will find a myami directory under amiworkspace in your home directory.
21
22
h2. 3. Configure your Development Environment
23
24
There are 2 types of development that you will most often do with the MyAMI code, Python for core processing and PHP for the web interface.
25
 
26
h3. 1. Setup the Python environment
27
28 6 Amber Herold
Go to Window -> Preferences -> PyDev -> Editor -> Interpreter – python. Press the Auto Config button then press OK.
29 1 Amber Herold
30
h3. 2. Setup the PHP environment
31
32 9 Amber Herold
There are two ways to view the web applications that you are developing in your home directory. If you are developing on a machine that does not have a local Apache server, you can use the Cronus3 web server. Also note that the directions below will not get project_tools running. It is currently undergoing many changes and directions will be added when that process is complete.
33 1 Amber Herold
34 4 Amber Herold
h4. Use Cronus3 to view your web app
35 1 Amber Herold
36 2 Amber Herold
# Open a terminal and go to your home directory: @$ cd ~@
37
# If is does not exist, create a directory called ami_html/: @$ mkdir ami_html/
38
# Change directories to ami_html:  $cd ami_html@
39
# Create a symbolic link to the web app directory in your workspace: @$ ln -s /home/[username]/amiworkspace/myami/myamiweb@
40 3 Amber Herold
# Try to browse to the project in a web browser ( http://cronus3/~username/myamiweb ). You should see an error because config.php failed to open.
41 1 Amber Herold
  
42 9 Amber Herold
h4. Create your config file
43 1 Amber Herold
 
44
*IMPORTANT:* Never check your local copy of the config files into Subversion. We don't want to share our database user information with the world.
45
46 7 Amber Herold
# Change directories to the myamiweb project: $ cd ~/amiworkspace/myami/myamiweb
47
# Copy config.php.template to config.php: $ cp config.php.template config.php
48
# Open config.php for editting: $ vi config.php
49
# Make the following changes to config.php:
50
51
<pre>
52
// --- Set your leginon MySQL database server parameters
53
54
$DB_HOST        = "cronus4";
55
$DB_USER        = "usr_object";
56
$DB_PASS        = "";
57
$DB             = "dbemdata";
58
59
// --- XML test dataset
60
$XML_DATA = "test/viewerdata.xml";
61
62
// --- Project database URL
63
64 8 Amber Herold
$PROJECT_URL = "http://cronus3.scripps.edu/~[username]/project_tools";
65 7 Amber Herold
$PROJECT_DB_HOST = "cronus4";
66
$PROJECT_DB_USER = "usr_object";
67
$PROJECT_DB_PASS = "";
68
$PROJECT_DB = "project";
69
</pre>
70 1 Amber Herold
71 4 Amber Herold
h4. Use your local Apache server to view your web app
72 1 Amber Herold
73
# Make sure you are logged in as root. ($ su)
74 11 Amber Herold
# Make sure Apache is installed. There should be /etc/init.d/httpd on your machine. Start apache with $ /etc/init.d/httpd start. 
75 1 Amber Herold
# Point a web browser to http://localhost/ and make sure you see the apache test page.
76
# Make sure Apache is configured for php
77 11 Amber Herold
# the Apache config file is at /etc/httpd/conf
78
# web files should be at /var/www/html
79
## create  symbolic link to your workspace in /var/www/html
80
## Try to view at http://localhost/myamiweb 
81
## Not working because need the files on phpami
82
### go to phpami in your myamiweb workspace and create symbolic links to each file that remove the .php file extension
83
### put a symbolic link to this folder from user/share ( $ ln -s /home/amber/amiworkspace/myami/phpami php )
84
# To debug PHP issues check http://localhost/myamiweb/info.php
85 12 Amber Herold
# For everythingto work, need to install plugins like MRC module