Project

General

Profile

majic_1811.txt

Marius Gligor, 12/23/2013 08:36 AM

Download (9.38 KB)

 
1
Testing chuiWeb on MAJIC server: 
2

    
3
1. Create on your home directory the following structure:
4

    
5
~/testing
6
    /majic
7
      /build
8
        /lib
9
      /run
10
        /server
11
      /p2j
12
        /build
13
          /lib
14
    
15
2. Download the MAJIC jar files to ~/testing/majic/build/lib
16

    
17
  $ scp -P 2224 $USER@localhost:~/testing/majic/build/lib/*.jar ~/testing/majic/build/lib/
18

    
19
3. Download MAJIC server configuration files from ~/testing/majic/run/server
20

    
21
You may download the entire folder which take some time:
22
  
23
  $ scp -P 2224 $USER@localhost:~/testing/majic/run/server/* ~/testing/majic/run/server/
24

    
25
Or you can download only some specific files
26
  
27
  $ scp -P 2224 $USER@localhost:~/testing/majic/run/server/*-directory.xml ~/testing/majic/run/server/
28
  $ scp -P 2224 $USER@localhost:~/testing/majic/run/server/*_server.xml ~/testing/majic/run/server/
29
  $ scp -P 2224 $USER@localhost:~/testing/majic/run/server/*.store ~/testing/majic/run/server/
30
  $ scp -P 2224 $USER@localhost:~/testing/majic/run/server/*.sh ~/testing/majic/run/server/
31
  $ scp -P 2224 $USER@localhost:~/testing/majic/run/server/*.properties ~/testing/majic/run/server/
32

    
33
4. Build p2j project than the spawner and copy all the files from $P2J_HOME/build/lib to ~/testing/majic/p2j/build/lib
34
  
35
  $ ant all (jar)
36
  $ ant -Dhave.pam=yes -Dpost.build=yes native
37
  $ cp -r -v $P2J_HOME/build/lib/ ~/testing/majic/p2j/build/lib
38

    
39
5. Go to ~/testing/majic/run/server
40

    
41
  $ cd ~/testing/majic/run/server
42
  
43
6. Open the file gso-directory.xml using your preferred text editor and do the following changes:
44
   
45
 a.) Change PostgreSQL port number. 
46
     Go to the following node.
47
 
48
   <node-attribute name="value" value="jdbc:postgresql://localhost:<port_numer>/gso_20090909_staging"/>
49
   
50
   Replace the <port_number> with 25432. You already have a ssh tunnel when you run the gcd_remote.sh
51
   script which allow you to access the remote postgres server using the local port 25432.
52
   You can check by trying to connect to the postgres server using the pgAdmin GUI tool using:
53
     Host: localhost 
54
     Port: 25432.   
55
     Username and Password are listed on gso-directory.xml.
56

    
57
   <node-attribute name="value" value="jdbc:postgresql://localhost:25432/gso_20090909_staging"/>
58
   
59
 b.) Add gso server to the acl/admin/001300 node subjects list:
60

    
61
      <node class="container" name="acl">
62
        ...
63
        <node class="container" name="admin">
64
          ...
65
          <node class="container" name="001300">
66
            <node class="strings" name="subjects">
67
              <node-attribute name="values" value="admins"/>
68
              <!-- Add server names -->
69
              <node-attribute name="values" value="gso"/>
70
            </node>
71
            <node class="adminRights" name="rights">
72
              <node-attribute name="permissions" value="'01'B"/>
73
              <node-attribute name="type" value="0"/>
74
            </node>
75
            <node class="resource" name="resource-instance">
76
              <node-attribute name="reference" value="/"/>
77
              <node-attribute name="reftype" value="TRUE"/>
78
            </node>
79
          </node>
80
   
81
   NOTE: This settings are for gso server on which the tests has been done. 
82
   For other servers you should add also the name of specified server.
83
   Example:
84

    
85
   <node class="container" name="server">
86
      ...
87
      <node class="container" name="security">
88
         ...
89
         <node class="container" name="acl">
90
            ...
91
            <!- Change this node and add process name ->
92
            <node class="container" name="admin">
93
               <node class="container" name="001300">
94
                  <node class="strings" name="subjects">
95
                    <node-attribute name="values" value="admins"/>
96
                    <!-- Add server names -->
97
                    <node-attribute name="values" value="gso"/>
98
                    <node-attribute name="values" value="rfq"/>
99
                    <node-attribute name="values" value="lcq"/>
100
                    <node-attribute name="values" value="mcn"/>
101
                    <node-attribute name="values" value="osc"/>
102
                    <node-attribute name="values" value="gyr"/>
103
                  </node>
104
                  <node class="adminRights" name="rights">
105
                    <node-attribute name="permissions" value="'01'B"/>
106
                    <node-attribute name="type" value="0"/>
107
                  </node>
108
                  <node class="resource" name="resource-instance">
109
                    <node-attribute name="reference" value="/"/>
110
                    <node-attribute name="reftype" value="TRUE"/>
111
                  </node>
112
               </node>
113
   
114
 c.) Add chuiWeb node. At least the chuiWeb node must contains the enabled attribute set to true.
115
     If enabled node is missing or it value is false the chuiWeb is not available.
116

    
117
      <node class="container" name="gso">
118
        ...
119
        <node class="container" name="chuiWeb">
120
          <node class="boolean" name="enabled">
121
            <node-attribute name="value" value="TRUE"/>
122
          </node>
123
        </node>
124

    
125
   Default values are provided for missing attributes (see ClientBuilderOptions and TerminalOptions).
126
   The default values are suitable for testing purposes only and you are able to spawn web clients only for user account on which the P2J server is running.   
127

    
128
   The values from directory override the default values. On production some files should be shared by all accounts.
129
   A complete node should looks as follow:   
130
      
131
        <node class="container" name="chuiWeb">
132
          <node class="boolean" name="enabled">
133
            <node-attribute name="value" value="TRUE"/>
134
          </node>
135
          <node class="boolean" name="secure">
136
            <node-attribute name="value" value="TRUE"/>
137
          </node>
138
          <node class="string" name="spawner">
139
            <node-attribute name="value" value="/usr/share/p2j/spawn"/>
140
          </node>
141
          <node class="string" name="command">
142
            <node-attribute name="value" value="java"/>
143
          </node>
144
          <node class="integer" name="poolSize">
145
            <node-attribute name="value" value="8"/>
146
          </node>
147
          <node class="integer" name="30000">
148
            <node-attribute name="value" value="12"/>
149
          </node>
150
          <node class="string" name="jvmArgs">
151
            <node-attribute name="value" value="-Xmx512m -XX:MaxPermSize=64m -Djava.awt.headless=true"/>
152
          </node>
153
          <node class="string" name="classpath">
154
            <node-attribute name="value" value="/usr/share/p2j/lib/p2j.jar"/>
155
          </node>
156
          <node class="string" name="libPath">
157
            <node-attribute name="value" value="/usr/share/p2j/lib"/>
158
          </node>
159
          <node class="string" name="workingDir">
160
            <node-attribute name="value" value="./"/>
161
          </node>
162
          <node class="string" name="configFile">
163
            <node-attribute name="value" value="config.xml"/>
164
          </node>
165
          <node class="integer" name="rows">
166
            <node-attribute name="value" value="24"/>
167
          </node>
168
          <node class="integer" name="columns">
169
            <node-attribute name="value" value="80"/>
170
          </node>
171
          <node class="string" name="background">
172
            <node-attribute name="value" value="0x000000"/>
173
          </node>
174
          <node class="string" name="foreground">
175
            <node-attribute name="value" value="0xFFA500"/>
176
          </node>
177
          <node class="string" name="selection">
178
            <node-attribute name="value" value="0x0000FF"/>
179
          </node>
180
          <node class="string" name="fontname">
181
            <node-attribute name="value" value="monospaced"/>
182
          </node>
183
          <node class="integer" name="fontsize">
184
            <node-attribute name="value" value="12"/>
185
          </node>
186
        </node>
187
        
188
 d.) Add rights to access Spawn interface via RemoteObject protocol /server/security/acl/net/00240:
189

    
190
   <node class="container" name="server">
191
      ...
192
      <node class="container" name="security">
193
         ...
194
         <node class="container" name="acl">
195
            ...
196
            <node class="container" name="net">
197
               ...
198
               <!-- Add this node -->
199
               <node class="container" name="002400">
200
                  <node class="strings" name="subjects">
201
                    <node-attribute name="values" value="all_others"/>
202
                  </node>
203
                  <node class="netRights" name="rights">
204
                    <node-attribute name="permissions" value="'0101'B"/>
205
                  </node>
206
                  <node class="resource" name="resource-instance">
207
                    <node-attribute name="reference" value="com.goldencode.p2j.main.Spawner"/>
208
                    <node-attribute name="reftype" value="TRUE"/>
209
                  </node>
210
                </node>
211

    
212
 e.) Save your changes and exit from editor.
213
   
214
7. From the same location start the server.
215

    
216
  $ ./server.sh
217

    
218
8. Wait until the sever is ready. Check the server.log file from time to time:
219

    
220
  $ tail server.log
221
  
222
  until you'll see the following message:
223
  
224
  [12/23/2013 11:06:50 EET] (SessionManager.listen():INFO) {00000000:00000001:gso} Server ready
225
  
226
  or an error message if the server cannot be started for some reasons.
227
  
228
9. When the server is ready open the following URL on your web browser (Firefox):
229

    
230
  https://localhost:<gso_admin_port>/chui
231
  
232
  Where the <gso_admin_port> is the GSO admin port usually 7673.
233
  The <gso_admin_port> is also listed on the gso-directory.xml file.
234