-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Deployment to JEE and Servlet containers
For JBoss 7.X, Wildfly 8.X (not tested for 9.X & 10.X) when deploying gitbucket, you will probably face the following deployment error: java.lang.NoClassDefFoundError: com/sun/net/ssl/internal/ssl/Provider
.
Due to class loading restrictions inside JBoss/Wildfly, you need to explicitly allow gitbucket to access some classes from the jdk. For that, modify gitbucket.war and add the following under WEB-INF\jboss-deployment-structure.xml
<jboss-deployment-structure>
<deployment>
<dependencies>
<system export="true">
<paths>
<path name="com/sun/net/ssl/internal/ssl" />
<path name="com/sun/net/ssl" />
</paths>
</system>
</dependencies>
</deployment>
</jboss-deployment-structure>
Wildfly 9.X & 10.X have the same class loading restrictions as previous versions. So also here you need to explicitly allow gitbucket to access some classes from the jdk. are similar to previous versions. Modify gitbucket.war and add the following under WEB-INF\jboss-deployment-structure.xml
<jboss-deployment-structure>
<deployment>
<dependencies>
<system export="true">
<paths>
<path name="com/sun/net/ssl/internal/ssl" />
<path name="com/sun/net/ssl" />
</paths>
</system>
<!-- add snakeyaml dependency -->
<module name="org.yaml.snakeyaml"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
You can use also a install script from here to install gitbucket on Wildfly 9.x & 10.x on Linux.
/bin/bash wildfly-install.sh [INSTALLDIR] [GITBUCKET-VERSION]
You can specify the install directory of your wilfly installation and the gitbucket version.
Example:
/bin/bash wildfly-install.sh [INSTALLDIR] [GITBUCKET-VERSION]
Note: The script must be run as root. The script assumes that wildfly is running with the user 'wildfly'. You can change this in your script if needed.
- install java8
- install tomcat7 Open /etc/tomcat/tomcat.conf and add the following line:
JAVA_OPTS="-Djava.security.egd=file:/dev/urandom" Also edit /etc/tomcat/server.xml to have an ending similar to this:
WEB-INF/web.xmlTime to get GitBucket itself. Make sure to change the version number to the latest:
- 'export GITBUCKET_VERSION='4.20.0''
- 'wget https://github.com/gitbucket/gitbucket/releases/download/${GITBUCKET_VERSION}/gitbucket.war'
- 'cp gitbucket.war /var/lib/tomcat/webapps/gitbucket.war'
- 'chown root.tomcat /var/lib/tomcat/webapps/gitbucket.war'
- 'restorecon -v /var/lib/tomcat/webapps/gitbucket.war'
- 'ln -s /usr/share/tomcat/.gitbucket /opt/gitbucket'
Make sure SELinux won’t intervene, so install the GitBucket SELinux policy module and also fix file permissions, as explained on the link.
Start tomcat
- 'service tomcat start'
- install java8
- install tomcat8
mkdir /var/gitbucket
chown tomcat8:tomcat8 /var/gitbucket
echo "GITBUCKET_HOME=/var/gitbucket" >> /etc/default/tomcat8
- deploy
gitbucket.war
into/var/lib/tomcat8/webapps
service tomcat8 restart
- install tomcat9
- install java8 (not java 11 because of some issues, see: https://github.com/gitbucket/gitbucket/issues/3183)
mkdir -p /home/tomcat9/.gitbucket
chown tomcat9:tomcat9 /home/tomcat9/.gitbucket
- deploy gitbucket.war into
/var/lib/tomcat9/webapps
service tomcat9 restart
if the service is not enabled (tomcat9)
systemctl enable tomcat9
TODO