Namestitev SubmitServer » History » Version 5
Gašper Fele-Žorž, 07.02.2011 12:53
1 | 1 | Gašper Fele-Žorž | h1. Namestitev SubmitServer |
---|---|---|---|
2 | 1 | Gašper Fele-Žorž | |
3 | 1 | Gašper Fele-Žorž | Najprej namestimo potrebne dodatne pakete: |
4 | 1 | Gašper Fele-Žorž | |
5 | 1 | Gašper Fele-Žorž | <pre> |
6 | 1 | Gašper Fele-Žorž | apt-get install tomcat6 mysql-server subversion ant liblog4j1.2-java libmysql-java |
7 | 1 | Gašper Fele-Žorž | </pre> |
8 | 1 | Gašper Fele-Žorž | |
9 | 1 | Gašper Fele-Žorž | Geslo za root mysql je na marmoset.fri.uni-lj.si enako geslu za root sicer. |
10 | 1 | Gašper Fele-Žorž | |
11 | 2 | Gašper Fele-Žorž | Nato "dodamo userja":http://dev.mysql.com/doc/refman/5.1/en/adding-users.html in "ustvarimo podatkovno bazo":http://dev.mysql.com/doc/refman/5.0/en/create-database.html na mysql: |
12 | 1 | Gašper Fele-Žorž | |
13 | 1 | Gašper Fele-Žorž | <pre> |
14 | 1 | Gašper Fele-Žorž | shell> mysql -u root -p |
15 | 1 | Gašper Fele-Žorž | mysql> create user 'marmoset'@'localhost' identified by 'malaopica'; |
16 | 1 | Gašper Fele-Žorž | mysql> create database marmoset character set = utf8; |
17 | 1 | Gašper Fele-Žorž | mysql> grant all privileges on marmoset.* to 'marmoset'@'localhost'; |
18 | 1 | Gašper Fele-Žorž | </pre> |
19 | 1 | Gašper Fele-Žorž | |
20 | 5 | Gašper Fele-Žorž | Popravimo /etc/mysql/my.cnf po vzorcu: |
21 | 5 | Gašper Fele-Žorž | <pre> |
22 | 5 | Gašper Fele-Žorž | [mysqld] |
23 | 5 | Gašper Fele-Žorž | character-set-server = utf8 |
24 | 5 | Gašper Fele-Žorž | |
25 | 5 | Gašper Fele-Žorž | [client] |
26 | 5 | Gašper Fele-Žorž | default-character-set = utf8 |
27 | 5 | Gašper Fele-Žorž | </pre> |
28 | 5 | Gašper Fele-Žorž | |
29 | 5 | Gašper Fele-Žorž | Bazo kot root ponovno zaženemo z: |
30 | 5 | Gašper Fele-Žorž | <pre> |
31 | 5 | Gašper Fele-Žorž | /etc/init.d mysql |
32 | 5 | Gašper Fele-Žorž | </pre> |
33 | 1 | Gašper Fele-Žorž | Preverimo, če baza deluje: |
34 | 1 | Gašper Fele-Žorž | |
35 | 1 | Gašper Fele-Žorž | <pre> |
36 | 1 | Gašper Fele-Žorž | polz@bober:~$ mysql -u marmoset -p -D marmoset |
37 | 1 | Gašper Fele-Žorž | Enter password: |
38 | 1 | Gašper Fele-Žorž | Welcome to the MySQL monitor. Commands end with ; or \g. |
39 | 1 | Gašper Fele-Žorž | Your MySQL connection id is 43 |
40 | 1 | Gašper Fele-Žorž | Server version: 5.1.49-3 (Debian) |
41 | 1 | Gašper Fele-Žorž | |
42 | 1 | Gašper Fele-Žorž | Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. |
43 | 1 | Gašper Fele-Žorž | This software comes with ABSOLUTELY NO WARRANTY. This is free software, |
44 | 1 | Gašper Fele-Žorž | and you are welcome to modify and redistribute it under the GPL v2 license |
45 | 1 | Gašper Fele-Žorž | |
46 | 1 | Gašper Fele-Žorž | Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. |
47 | 1 | Gašper Fele-Žorž | |
48 | 1 | Gašper Fele-Žorž | mysql> |
49 | 1 | Gašper Fele-Žorž | </pre> |
50 | 1 | Gašper Fele-Žorž | |
51 | 1 | Gašper Fele-Žorž | Če deluje, lahko iz svn repozitorija poberemo marmoset. Uporabimo kopijo, ki je na redmine. |
52 | 1 | Gašper Fele-Žorž | |
53 | 1 | Gašper Fele-Žorž | <pre> |
54 | 1 | Gašper Fele-Žorž | polz@bober:~$ svn co https://lusy.fri.uni-lj.si/svn/marmoset/ |
55 | 1 | Gašper Fele-Žorž | </pre> |
56 | 1 | Gašper Fele-Žorž | |
57 | 4 | Gašper Fele-Žorž | Če bi slučajno kdo še hotel uporabiti marmoset iz git snapshota, potlej bi moral |
58 | 4 | Gašper Fele-Žorž | popraviti še datoteko "build.xml" - iz neznanega razloga developerji niso hoteli, |
59 | 4 | Gašper Fele-Žorž | da bi se v .war spravila celotna aplikacija. Popraviti je torej treba pravilo |
60 | 4 | Gašper Fele-Žorž | "war", da potlej izgleda takole: |
61 | 4 | Gašper Fele-Žorž | |
62 | 4 | Gašper Fele-Žorž | <pre> |
63 | 4 | Gašper Fele-Žorž | <war |
64 | 4 | Gašper Fele-Žorž | destfile="${dist}/${warfile}" |
65 | 4 | Gašper Fele-Žorž | webxml="WebRoot/WEB-INF/web.xml" |
66 | 4 | Gašper Fele-Žorž | > |
67 | 4 | Gašper Fele-Žorž | <fileset dir="WebRoot"> |
68 | 4 | Gašper Fele-Žorž | <!-- |
69 | 4 | Gašper Fele-Žorž | <exclude name="WEB-INF/classes/edu/umd/cs/submitServer/shared/*class"/> |
70 | 4 | Gašper Fele-Žorž | <exclude name="WEB-INF/lib/log4j.jar"/> |
71 | 4 | Gašper Fele-Žorž | --> |
72 | 4 | Gašper Fele-Žorž | </fileset> |
73 | 4 | Gašper Fele-Žorž | </war> |
74 | 4 | Gašper Fele-Žorž | </pre> |
75 | 4 | Gašper Fele-Žorž | |
76 | 1 | Gašper Fele-Žorž | Ustvarimo tabele v bazi: |
77 | 1 | Gašper Fele-Žorž | |
78 | 1 | Gašper Fele-Žorž | <pre> |
79 | 1 | Gašper Fele-Žorž | polz@bober:~/marmoset$ cd SubmitServerModelClasses/trunk/SubmitServerModelClasses/dbScripts/ |
80 | 1 | Gašper Fele-Žorž | polz@bober:~/marmoset/SubmitServerModelClasses/trunk/SubmitServerModelClasses/dbScripts$ mysql -u marmoset -p -e "source marmoset-schema.sql" -D marmoset |
81 | 5 | Gašper Fele-Žorž | polz@bober:~/marmoset/SubmitServerModelClasses/trunk/SubmitServerModelClasses/dbScripts$ mysql -u marmoset -p -e "source sql-patches/project-starter-file-archives.sql" -D marmoset |
82 | 1 | Gašper Fele-Žorž | </pre> |
83 | 1 | Gašper Fele-Žorž | |
84 | 1 | Gašper Fele-Žorž | Ustvarimo uporabnika v bazi. Najprej popravimo bootstrap.sql, ki vsebuje nekaj takega: |
85 | 1 | Gašper Fele-Žorž | |
86 | 1 | Gašper Fele-Žorž | <pre> |
87 | 1 | Gašper Fele-Žorž | INSERT INTO students |
88 | 1 | Gašper Fele-Žorž | VALUES (DEFAULT, 'USERNAME', 'UNIKATNA_ID_ŠTEVILKA', 'IME', 'PRIIMEK', 'yes', DEFAULT, DEFAULT, DEFAULT, 'GESLO'); |
89 | 1 | Gašper Fele-Žorž | </pre> |
90 | 1 | Gašper Fele-Žorž | |
91 | 1 | Gašper Fele-Žorž | Nato izvedemo: |
92 | 1 | Gašper Fele-Žorž | <pre> |
93 | 1 | Gašper Fele-Žorž | mysql -u marmoset -p -e "source bootstrap.sql" -D marmoset |
94 | 1 | Gašper Fele-Žorž | </pre> |
95 | 1 | Gašper Fele-Žorž | |
96 | 1 | Gašper Fele-Žorž | Namestimo SubmitServer na Tomcat - pred tem lahko popravimo local.properties, kjer je mogoče nastaviti direktorij, |
97 | 1 | Gašper Fele-Žorž | v katerega se marmoset namesti. V svn je različica, ki ima ta direktorij nastavljen na /var/lib/tomcat6 |
98 | 1 | Gašper Fele-Žorž | |
99 | 1 | Gašper Fele-Žorž | <pre> |
100 | 1 | Gašper Fele-Žorž | polz@bober:~/marmoset# cd SubmitServer/trunk/SubmitServer2/ |
101 | 1 | Gašper Fele-Žorž | polz@bober:~/marmoset/SubmitServer/trunk/SubmitServer2# ant production.install |
102 | 1 | Gašper Fele-Žorž | </pre> |
103 | 1 | Gašper Fele-Žorž | |
104 | 1 | Gašper Fele-Žorž | Nastavimo Tomcat tako, da bo classe iskal tudi v direktoriju, kjer je večina javanskih knjižnic. SubmitServer namreč od tam potrebuje log4j knjižnico. Popravimo datoteko |
105 | 1 | Gašper Fele-Žorž | <pre>/etc/tomcat6/catalina.properties</pre> tako, da k common.loader dodamo ",/usr/share/java/*.jar": |
106 | 1 | Gašper Fele-Žorž | <pre> |
107 | 1 | Gašper Fele-Žorž | common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar,/var/lib/tomcat6/common/classes,/var/lib/tomcat6/common/*.jar,/usr/share/java/*.jar |
108 | 1 | Gašper Fele-Žorž | </pre> |
109 | 1 | Gašper Fele-Žorž | |
110 | 1 | Gašper Fele-Žorž | Med nastavitve Tomcata dodamo podatke o podatkovni bazi, na katero se SubmitServer povezuje. To storimo tako, da v <pre>/etc/tomcat6/web.xml</pre> dodamo nekaj vnosov "<context-param>". |
111 | 1 | Gašper Fele-Žorž | Konec datoteke potem izgleda takole: |
112 | 1 | Gašper Fele-Žorž | |
113 | 1 | Gašper Fele-Žorž | <pre> |
114 | 1 | Gašper Fele-Žorž | <context-param> |
115 | 1 | Gašper Fele-Žorž | <param-name>authentication.service</param-name> |
116 | 1 | Gašper Fele-Žorž | <param-value>edu.umd.cs.submitServer.GenericStudentPasswordAuthenticationService</param-value> |
117 | 1 | Gašper Fele-Žorž | </context-param> |
118 | 1 | Gašper Fele-Žorž | <context-param> |
119 | 1 | Gašper Fele-Žorž | <param-name>database.server.jdbc.url</param-name> |
120 | 1 | Gašper Fele-Žorž | <param-value>jdbc:mysql://localhost/marmoset</param-value> |
121 | 1 | Gašper Fele-Žorž | </context-param> |
122 | 1 | Gašper Fele-Žorž | <context-param> |
123 | 1 | Gašper Fele-Žorž | <param-name>database.user</param-name> |
124 | 1 | Gašper Fele-Žorž | <param-value>marmoset</param-value> |
125 | 1 | Gašper Fele-Žorž | </context-param> |
126 | 1 | Gašper Fele-Žorž | <context-param> |
127 | 1 | Gašper Fele-Žorž | <param-name>database.password</param-name> |
128 | 1 | Gašper Fele-Žorž | <param-value>malaopica</param-value> |
129 | 1 | Gašper Fele-Žorž | </context-param> |
130 | 1 | Gašper Fele-Žorž | <context-param> |
131 | 1 | Gašper Fele-Žorž | <param-name>database.driver</param-name> |
132 | 1 | Gašper Fele-Žorž | <param-value>org.gjt.mm.mysql.Driver</param-value> |
133 | 1 | Gašper Fele-Žorž | </context-param> |
134 | 1 | Gašper Fele-Žorž | </web-app> |
135 | 1 | Gašper Fele-Žorž | </pre> |
136 | 1 | Gašper Fele-Žorž | |
137 | 1 | Gašper Fele-Žorž | Ponovno zaženemo Tomcat: |
138 | 1 | Gašper Fele-Žorž | <pre> |
139 | 1 | Gašper Fele-Žorž | bober:/home/polz/marmoset/SubmitServer/trunk/SubmitServer2# /etc/init.d/tomcat6 restart |
140 | 1 | Gašper Fele-Žorž | </pre> |
141 | 1 | Gašper Fele-Žorž | |
142 | 1 | Gašper Fele-Žorž | Bravo! S tem je SubmitServer v principu nameščen. Zakaj le v principu? Zato, ker je treba omogočiti dostop do njega prek https. |
143 | 1 | Gašper Fele-Žorž | Postopek je opisan "tukaj":http://tomcat.apache.org/tomcat-6.0-doc/ssl-howto.html . Vseeno na hitro povzetek. |
144 | 1 | Gašper Fele-Žorž | |
145 | 1 | Gašper Fele-Žorž | Najprej ustvarimo ključe: |
146 | 1 | Gašper Fele-Žorž | <pre> |
147 | 1 | Gašper Fele-Žorž | bober:~# keytool -genkey -alias tomcat -keyalg RSA -keystore /usr/share/tomcat6/.keystore |
148 | 1 | Gašper Fele-Žorž | </pre> |
149 | 1 | Gašper Fele-Žorž | |
150 | 1 | Gašper Fele-Žorž | Geslo si seveda zapomnimo. |
151 | 1 | Gašper Fele-Žorž | |
152 | 1 | Gašper Fele-Žorž | Nato nastavimo tomcat, da jih uporabi. To storimo tako, da v <pre>/etc/tomcat6/server.xml</pre> odkomentiramo in dodamo geslo v odsek: |
153 | 1 | Gašper Fele-Žorž | |
154 | 1 | Gašper Fele-Žorž | <pre> |
155 | 1 | Gašper Fele-Žorž | <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" |
156 | 1 | Gašper Fele-Žorž | maxThreads="150" scheme="https" secure="true" |
157 | 4 | Gašper Fele-Žorž | keystorePass="GESLO" URIEncoding="UTF-8" |
158 | 1 | Gašper Fele-Žorž | clientAuth="false" sslProtocol="TLS" /> |
159 | 1 | Gašper Fele-Žorž | </pre> |
160 | 1 | Gašper Fele-Žorž | |
161 | 1 | Gašper Fele-Žorž | Ponovno zaženemo Tomcat: |
162 | 1 | Gašper Fele-Žorž | <pre> |
163 | 1 | Gašper Fele-Žorž | bober:/home/polz/marmoset/SubmitServer/trunk/SubmitServer2# /etc/init.d/tomcat6 restart |
164 | 1 | Gašper Fele-Žorž | </pre> |
165 | 3 | Gašper Fele-Žorž | |
166 | 3 | Gašper Fele-Žorž | Če kaj ne deluje, si razčesnemo glavo. |