Confluence Install Cookbook
Requirements
Atlassian
See https://confluence.atlassian.com/display/DOC/System+Requirements for newest requirements
OS and Hardware Settings
Virtual: Why not - the benefits are huge
Preferred OS: Ubuntu LTS 64-bit (this Cookbook is 90% Linux orientated)
Hardware: At least 2 vCPU's and at least 3 GB Ram
Mysql Settings
Preferred Database: MySQL (or Postgres)
Settings for MySQL (ref: MySQL)
transaction-isolation = READ-COMMITTED
log-bin=mysql-bin
binlog_format=row
default-storage-engine=innodb
max_allowed_packet=64M
[mysql]
default-character-set=utf8
[mysqldump]
max_allowed_packet=64M
Notice that max_allowed_packed=64M, where as this link says 32M, I have seen Gliffy updates fail with 32M
On large installations or where indexes are huge, changing innodb_lock_wait_timeout can be an option (Ref: JIRAKB)
innodb_lock_wait_timeout = 300
SMTP Access for sending mail
IMAP Access for picking up mail
Installation
Prepare database
Create the Database
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on confluence.* to confluence@localhost identified by '*******';
Query OK, 0 rows affected (0.00 sec)
Install binaries
Download Confluence from http://www.atlassian.com/software/confluence/download
Download the MySQL JDBC from http://dev.mysql.com/downloads/connector/j/
For the binary installer, JAVA is integrated, for EAR or WAR files this must be downloaded and installed separately.
Follow the required steps (remember path to Confluence_Install and Confluence_Home) and connect to the tomcat instance started; if the MySQL Driver can be found, restart the Tomcat.
Postinstall
This is where the tweaking comes into place, to avoid common problems:
confluence.cfg.xml
This file is found in Confluence_Home
Change the number of Database connections to higher than standard
Make sure that the ?autoReconnect=true is on the jdbc connection
setenv.sh
This file is found in the Confluence_Install/bin
Read Garbage Collector Performance Issues for settings
Add support for UTF-8 File system by adding -Dfile.encoding=UTF-8 to the JAVA_OPTS:
export JAVA_OPTS
Tweaking of memory and usage comes in play here, I prefer this for a 4 GB Server:
export JAVA_OPTS
For saving Garbage Collection in /pack/confluence/logs/gc.log for debugging
export JAVA_OPTS
If You are planning to run under the same Fully Qualified Domain - review https://jira.atlassian.com/browse/JRA-8726
server.xml
This file is found in Confluence_Install/conf
Binding to a fixed IP Address, add the address= to the connector. Also the port= can be changed (Under Linux only root can bond to 0-1023):
maxProcessors="75"
enableLookups="false" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000"
useURIValidationHack="false" />
To secure correct UTF-8 Handling, add URIEncoding="UTF-8" to the connector:
maxProcessors="75"
enableLookups="false" redirectPort="8443" acceptCount="10" debug="0" connectionTimeout="20000"
useURIValidationHack="false" URIEncoding="UTF-8" />
If behind a traffic Manager or Apache Proxy, add scheme=, proxyName= and proxyPort to the context t (See Apache2 Proxy Passing or Proxy Passing section belov)::
If the Tomcat needs to travel through symbolic links on the filesystem, add the allowLinking="true" to the context:
Tomcat 7.X - This is in server.xml
Tomcat 8.X - This is in context.xml
<Resources allowLinking="true" />
</Context>
If the Confluence instance need to run below root /, change the path= parameter:
Its possible to increase maxPostSize for faster page rending - https://confluence.atlassian.com/display/CONFKB/Slow+Page+Rendering+of+Large+Pages+Due+to+HTTP+POST+Limitations
Confluence running as Confluence user
Make sure Confluence is not running as root (for security reasons); look at Confluence_Install/bin/user.sh for a username:
CONF_USER="confluence" ##
# END INSTALLER MAGIC ! DO NOT EDIT !
export CONF_USER ##
And check the startup script /etc/init.d/confluence look like this (with the right path):
# Confluence Linux service controller script
cd "/pack/confluence/bin"
case "$1" in
start)
./start-confluence.sh
;;
stop)
./stop-confluence.sh
;;
restart)
./stop-confluence.sh
./start-confluence.sh
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
Finally, make sure the confluence user has access:
sudo chown -R confluence:confluence confluence
cd Confluence_Home
sudo chown -R confluence:confluence confluence-data
Other
Proxy passing
There are good reasons for using an Apache or Traffic Manager in front of the Confluence Installation, some are:
- No port changing (non-root users can assign to ports below 1024)
- Use of URL Rewrite
- Use of URL Blocking
- Use of Allow/Denial
- SSL offloading/handling outside the Confluence
Se my example in Apache2 Proxy Passing
Time And Date Setup
Time and Date should be set up according to
https://confluence.atlassian.com/display/DOC/Configuring+Time+and+Date+Formats
My formats for danish is:
Date Time Format dd-MM-yyyy HH:mm
Date Format dd-MM-yyyy
Logfiles
Logrotate
Set up logrotate to avoid ever growing catalina.out log file. Here Confluence_Install is /opt/confluence, logs are rotated daily and keept for 7 days:
daily
rotate 7
compress
copytruncate
delaycompress
missingok
size 10M
notifempty
}