-
Notifications
You must be signed in to change notification settings - Fork 58
Two Servers Mode
Prerequisite : install Maven 3.
git clone https://github.com/exo-addons/chat-application.git
cd chat-application
then build the project with maven :
mvn clean install
Prerequisite : install MongoDB. then configure your chat.properties file like :
dbServerHost=localhost
dbServerPort=27017
dbName=chat
dbAuthentication=false
dbUser=admin
dbPassword=pass
chatServerUrl=http://localhost:8888/chatServer
chatPortalPage=/portal/intranet/chat
You can notice here, we call Chat Server on port 8888.
Prerequisite : install Apache Tomcat 7 and rename it chat-server/
Change the conf/server.xml to port 8280 :
<Connector port="8280" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8243" URIEncoding="UTF-8" />
<Connector port="8209" protocol="AJP/1.3" redirectPort="8243" URIEncoding="UTF-8" />
cp data/chat.properties chat-server/conf/
cp server/target/chatServer.war chat-server/webapps/
cd chat-server
./bin/catalina.sh run
Prerequisite : install eXo Platform 3.5 Tomcat bundle and rename it tomcat/
cp data/chat.properties tomcat/conf/
cp server/target/chatServer.jar tomcat/lib/
cp application/target/chat.war tomcat/webapps/
Use eXo start script :
cd tomcat
./start_eXo.sh
The Chat Application is using extensive use of Ajax calls. For this to run in multiple servers mode, the client must call the server on the same domain name and same protocol (that's the easier way to avoid anti-fishing security in modern browsers).
This easiest way to do so is to use Apache to re-route the requests using ProxyPass module.
In your Apache, configure some Proxy Pass rules, here's an example :
<VirtualHost *:8888>
ServerName www.localhost.com
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /chatServer http://localhost:8280/chatServer
ProxyPassReverse /chatServer http://localhost:8280/chatServer
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/
</VirtualHost>
Now, point your browser to http://localhost:8888/portal/intranet/ and login with john/gtn
You will then 2 new applications you can find in the Applications section.