Skip to content

Commit 7567532

Browse files
author
Glamdring
committed
updated documentaiton
1 parent 49c7e48 commit 7567532

5 files changed

Lines changed: 71 additions & 33 deletions

File tree

‎Deployment.md‎

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,34 @@
1-
Deploying on Openshift
1+
Deploying
22
======================
33

4-
Register for openshift account and create a tomcat 7 app with mysql support. Execute the following command in a newly-created directory (e.g. statealerts-deployment)
4+
Make sure you have installed MySQL and Tomcat (at least 7). Nginx / apache with forwarding to Tomcat is also desirable.
55

6-
rhc app create -a statealerts jbossews-2.0 mysql-5.1
6+
Copy the war file from _webapp/target_ into the _webapps_ server folder as _ROOT.war_
77

8-
Clone the openshift git repo:
8+
In _$TOMCAT/conf/server.xml_ find the _Connector_ element and add _URIEncoding="utf-8"_ attribbute so it looks like
99

10-
git clone <your repo>
11-
12-
Delete the _src_ folder and _pom.xml_ file from the template
13-
14-
cd statealerts
15-
git rm -r src/ pom.xml
16-
17-
Copy the prebuid war into _webapps_ folder as _ROOT.war_
18-
19-
cp <path-to-source>/webapp/target/statealerts-0.0.1-SNAPSHOT.war webapps/ROOT.war
20-
21-
In _.openshift/config/server.xml_ find _Connector_ element and add _URIEncoding="utf-8"_ attribbute so it looks like
22-
23-
<Connector address="${OPENSHIFT_JBOSSEWS_IP}"
24-
port="${OPENSHIFT_JBOSSEWS_HTTP_PORT}"
10+
<Connector port="..."
2511
protocol="HTTP/1.1"
2612
connectionTimeout="20000"
27-
URIEncoding="utf-8"
13+
URIEncoding="UTF-8"
2814
redirectPort="8443"/>
2915

30-
In _.openshift/action_hooks_ folder create a file called _pre_start_jbossews_ with following contents
16+
And also add the following at the bottom of the _Engine_ element:
3117

32-
export CATALINA_OPTS="-Dstatealerts.config.location=${OPENSHIFT_REPO_DIR}/config -Duser.timezone=UTC"
33-
34-
In repository root folder create folder called _config_ and copy there all files from _project-root/config_ (at least the following configuration files _statealert.properties_, _extractors.json_, _ehcache.xml_)
18+
<Host name="yourdomain.com" appBase="webapps" unpackWARs="true" autoDeploy="true">
19+
<Alias>www.yourdomain.com</Alias>
20+
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs/access" prefix="welshare_access_" suffix=".log" pattern="%h %l %u %t &quot;%r&quot; %s %b, t=%D" resolveHosts="false"/>
21+
<Valve className="org.apache.catalina.valves.StuckThreadDetectionValve" threshold="60" />
22+
</Host>
3523

36-
Commit your changes
24+
Also change the defaultHost of your Engine:
3725

38-
git add webapps config .openshift
39-
git commit -m "Inital commit for state alerts app."
26+
<Engine name="Catalina" defaultHost="yourdomain.com">
27+
4028

41-
To deploy the application execute
29+
Create a config folder (e.g. /var/config) and copy there all files from _project-root/config_ (at least the following configuration files _statealert.properties_, _extractors.json_, _ehcache.xml_)
4230

43-
git push
31+
Add the following in catalina.sh
4432

45-
Note: If the disk space on the server is over, you have to clean the git repo. Follow these steps to do so: https://www.openshift.com/forums/openshift/how-to-erase-all-history-from-a-git-repository-on-openshift-and-start-over-with
33+
export CATALINA_OPTS="-Dstatealerts.config.location=/var/config -Duser.timezone=UTC"
34+

‎OpenshiftDeployment.md‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Deploying on Openshift
2+
======================
3+
4+
Register for openshift account and create a tomcat 7 app with mysql support. Execute the following command in a newly-created directory (e.g. statealerts-deployment)
5+
6+
rhc app create -a statealerts jbossews-2.0 mysql-5.1
7+
8+
Clone the openshift git repo:
9+
10+
git clone <your repo>
11+
12+
Delete the _src_ folder and _pom.xml_ file from the template
13+
14+
cd statealerts
15+
git rm -r src/ pom.xml
16+
17+
Copy the prebuid war into _webapps_ folder as _ROOT.war_
18+
19+
cp <path-to-source>/webapp/target/statealerts-0.0.1-SNAPSHOT.war webapps/ROOT.war
20+
21+
In _.openshift/config/server.xml_ find _Connector_ element and add _URIEncoding="utf-8"_ attribbute so it looks like
22+
23+
<Connector address="${OPENSHIFT_JBOSSEWS_IP}"
24+
port="${OPENSHIFT_JBOSSEWS_HTTP_PORT}"
25+
protocol="HTTP/1.1"
26+
connectionTimeout="20000"
27+
URIEncoding="utf-8"
28+
redirectPort="8443"/>
29+
30+
In _.openshift/action_hooks_ folder create a file called _pre_start_jbossews_ with following contents
31+
32+
export CATALINA_OPTS="-Dstatealerts.config.location=${OPENSHIFT_REPO_DIR}/config -Duser.timezone=UTC"
33+
34+
In repository root folder create folder called _config_ and copy there all files from _project-root/config_ (at least the following configuration files _statealert.properties_, _extractors.json_, _ehcache.xml_)
35+
36+
Commit your changes
37+
38+
git add webapps config .openshift
39+
git commit -m "Inital commit for state alerts app."
40+
41+
To deploy the application execute
42+
43+
git push
44+
45+
Note: If the disk space on the server is over, you have to clean the git repo. Follow these steps to do so: https://www.openshift.com/forums/openshift/how-to-erase-all-history-from-a-git-repository-on-openshift-and-start-over-with

‎README.md‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,9 @@ More information <a href="http://techblog.bozho.net/?p=1215">in this article</a>
3131
webapp
3232
=======
3333

34-
The webapp is a ready-to-use i18nizable web-application that can be deployed with just a few steps (by default we deploy it at OpenShift). It stores and indexes the scraped documents and provides a UI for searching and subscribing for email alerts.
34+
The webapp is a ready-to-use i18nizable web-application that can be deployed with just a few steps (by default we deploy it at OpenShift). It stores and indexes the scraped documents and provides a UI for searching and subscribing for email alerts.
35+
36+
Deployment:
37+
38+
* <a href="Deployment.md">Regular</a>
39+
* <a href="OpenshiftDeployment.md">OpenShift</a>

‎webapp/config/mail.properties‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#gmail session settings
21
mail.transport.protocol=smtps
32
mail.smtp.auth=true
43
mail.smtp.starttls.enable=true

‎webapp/src/main/resources/logback.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</encoder>
1010
</appender>
1111

12-
<logger name="bg.statealerts" level="all" />
12+
<logger name="bg.statealerts" level="warn" />
1313
<logger name="org.hibernate" level="warn" />
1414
<root level="info">
1515
<appender-ref ref="console" />

0 commit comments

Comments
 (0)