Custom PlantUML Server - tttaaaa/gollum GitHub Wiki
Install local PlantUML server
These instructions have been tested on Debian Jessie and Ubuntu 14.04 LTS distributions.
sudo apt-get install maven graphviz openjdk-7-jdk git-core
git clone https://github.com/plantuml/plantuml-server.git
cd plantuml-server
mvn package
After building the package you can start a local server using the embedded jetty server:
mvn jetty:run
The server will then be available on http://localhost:8080/plantuml.
Run PlantUML with Tomcat
First you need to create a plantuml.war file from the source code:
sudo apt-get install tomcat7 graphviz openjdk-7-jdk git-core maven
git clone https://github.com/plantuml/plantuml-server.git
cd plantuml-server
mvn package
Then copy the plantuml.war file generated when building the package (mvn package) to the Tomcat applications folder:
sudo cp plantuml.war /var/lib/tomcat7/webapps/plantuml.war
sudo chown tomcat7:tomcat7 /usr/share/jetty/webapps/plantuml.war
sudo service restart tomcat7
After restarting Tomcat the application will be running on the server port 8080. You can change the port and other parameters in the /etc/tomcat7/server.xml file.
Configuring a PlantUML server
By default gollum-lib expects the PlantUML server to be located on http://localhost:8080/plantuml/png. If the PlantUML server is on a different location you can change the default by calling the following snipped in your code:
require "gollum-lib"
Gollum::Filter::PlantUML.configure do |config|
config.url = "http://my-own-plantuml.com:8080/plantuml/png"
end
Gollum configuration
If you are using Gollum you can create a config.rb file with the snipped above to configure the PlantUML server endpoint:
## file: config.rb
## Note: do not require gollum-lib
Gollum::Filter::PlantUML.configure do |config|
config.url = "http://my-own-plantuml.com:8080/plantuml/png"
end
then you can invoke Gollum using the --config option:
my-wiki$ gollum --config config.rb
PNG, SVG, ASCII
PlantUML can generate diagrams in PNG, SVG and ASCII formats. The way you select which format you want is by replacing the last part of the URL path: