-
Notifications
You must be signed in to change notification settings - Fork 57
Two Servers Mode
To be sure, the Chat will never interfere with eXo Platform, you can install it on a separated server. It's of course the recommended configuration.
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
If you have a problem of dependency during the building, try adding eXo Mirror in your Maven settings :
<mirrors>
<mirror>
<id>exo-central-server</id>
<name>eXo Central Server</name>
<url>http://repository.exoplatform.org/public/</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
Prerequisite : install MongoDB. then configure your chat.properties file like :
dbServerHost=localhost
dbServerPort=27017
dbName=chat
dbAuthentication=false
dbUser=admin
dbPassword=pass
chatServerBase=http://localhost:8888
chatPortalPage=/portal/intranet/chat
chatIntervalNotif=3000
chatIntervalChat=3000
chatIntervalSession=60000
chatIntervalStatus=15000
chatIntervalUsers=5000
chatPassPhrase=your-passphrase-here
chatCronNotifCleanup=0 0/60 * * * ?
publicMode=true
publicAdminGroup=/platform/administrators
You can notice here, we call Chat Server on port 8888.
Important : don't forget to change the passphrase (chatPassPhrase) !
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-standalone/target/chatServer.war chat-server/webapps/
cd chat-server
./bin/catalina.sh run
Prerequisite : install eXo Platform 4 and rename it tomcat/
Use eXo start script :
cd tomcat
./start_eXo.sh
Now, point your browser to http://localhost:8080/portal/ and create your administrator account.
cd tomcat
./stop_eXo.sh #or CTRL+C in your terminal
Prerequisite : install eXo Platform 4 Tomcat bundle and rename it tomcat/
cp data/chat.properties tomcat/conf/
cp exo-addons-chat-extension-config/target/exo-addons-chat-extension-config-0.7.0.jar tomcat/lib/
cp application/target/chat.war tomcat/webapps/
cp exo-addons-chat-extension/target/chat-extension.war tomcat/webapps/
Note : XXX in the jar stands for its version (i.e. 0.7.0 or 0.7.0-SNAPSHOT). There's also a source jar (chat-extension-config-XXX-sources.jar). This jar can be ignored.
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>
This is a feedback from the Community : On windows, you should also :
- Add "Header set Access-Control-Allow-Origin www.localhost.com" in your httpd.conf file
- Check your firewall rules (open 80 and 8280 port)
Now, point your browser to http://localhost:8888/portal/intranet/ and login with your administrator
You should have a new entry for the Chat in the Left Menu.